Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] V2 Breaking change - options require name/version instead of just name #13417

Closed
John-LittleBearLabs opened this issue Mar 10, 2023 · 4 comments · Fixed by #13467
Closed
Assignees

Comments

@John-LittleBearLabs
Copy link

Environment details

  • Operating System+version: Fedora 36
  • Compiler+version: g++ 12.2.1
  • Conan version: 2.0.0
  • Python version: 3.10.10

Steps to reproduce

  1. Make a conanfile.txt with:
[requires]
boost/1.81.0
[generators]
CMakeDeps
[options]
# V1 allows...
boost:header_only=True
# V2 requires boost/1.81.0:header_only=True
  1. conan install .

Logs

======== Input profiles ========
Profile host:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=12
os=Linux
[conf]


Profile build:
[settings]
arch=x86_64
build_type=Release
compiler=gcc
compiler.cppstd=gnu17
compiler.libcxx=libstdc++11
compiler.version=12
os=Linux
[conf]


ERROR: Error while parsing [options] in conanfile
Options should be specified as 'pkg:option=value'
@pacemdei
Copy link

In contrast to the situation with the above mentioned profiles, a conditional dependency in the configure() method in conanfile.py, does not result in a warning, but simply ignores the option for the dependency i.e.

configure(self):
    self.options["dependency"].option  = foo

is ignored. Is this by design? I could not find any documentation about it.

On the other hand using wildcards seem to work
i.e.

configure(self):
    self.options["dependency/*"].option  = foo

works.

Environment details

conan: 2.0.1
compiler: gcc 12.2.1
os : Fedora 37
python: 3.11.2

@memsharded
Copy link
Member

Hi @John-LittleBearLabs

Thanks @pacemdei for the hints.

Yes, Conan 2.0 requires the name to be a full exact match, like zlib/1.2.13 or to be a pattern, like zlib*. But only the partial zlib name is no longer a match. This is expected and necessary to eliminate some ambiguity and issues that happened in 1.X.

The recommend syntax that will be jointly compatible in 1.X and 2.0 would be: self.options["zlib*"].some_option, and when possible in 2.0-only, it would be better to do self.options["zlib/*"].some_option.

@memsharded
Copy link
Member

We will be trying to restore the self.options["mydep"].myoption syntax in #13467, for 2.0.3.

@memsharded
Copy link
Member

#13467 merged, it will be in 2.0.3

ferdymercury added a commit to martukas/nuclei that referenced this issue Jun 7, 2023
ferdymercury added a commit to martukas/nuclei that referenced this issue Jun 12, 2023
ferdymercury added a commit to martukas/nuclei that referenced this issue Jun 12, 2023
ferdymercury added a commit to martukas/nuclei that referenced this issue Jun 12, 2023
ferdymercury added a commit to martukas/nuclei that referenced this issue Jun 12, 2023
ferdymercury added a commit to martukas/nuclei that referenced this issue Jun 12, 2023
ferdymercury added a commit to martukas/nuclei that referenced this issue Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants