Conan: '*:option=value" breaks on undefined option since 1.7.0

Created on 5 Sep 2018  路  3Comments  路  Source: conan-io/conan

Here's what I get with 1.6.1 (ignore the requirement not found error, it's normal):

$ conan --version
Conan version 1.6.1
$ conan create ./libalmath sbre/liberforce -o gtest:shared=True -o *:shared=True -o *:fPIC=True --build=missing
libalmath/0.1@sbre/liberforce: Exporting package recipe
Linter warnings
    WARN: Linter. Line 27: FIXME: build_requires = 'qibuild'
libalmath/0.1@sbre/liberforce: The stored package has not changed
libqi/0.1@sbre/nightly: Not found in local cache, looking in remotes...
libqi/0.1@sbre/nightly: Trying with 'conan-center'...
libqi/0.1@sbre/nightly: Trying with 'sbre-public'...
ERROR: Failed requirement 'libqi/0.1@sbre/nightly' from 'libalmath/0.1@sbre/liberforce'
ERROR: Unable to find 'libqi/0.1@sbre/nightly' in remotes

Now here's what I get from 1.7.0 to 1.7.2:

$ conan --version
Conan version 1.7.0
$ conan create ./libalmath sbre/liberforce -o gtest:shared=True -o *:shared=True -o *:fPIC=True --build=missing
Exporting package recipe
Linter warnings
    WARN: Linter. Line 27: FIXME: build_requires = 'qibuild'
libalmath/0.1@sbre/liberforce: The stored package has not changed
ERROR: /home/luismenina/devel/conan/conan-public-recipes/libalmath/test_package/conanfile.py: 'options.fPIC' doesn't exist
Possible options are []

Has the fPIC handling changed ? Am I supposed to add it to the conanfile of my test_package?
Isn't the point of *:option=value is to set the option for recipes that define the option, and let the option be ignored by others if it's not defined?

  • [X] I've read the CONTRIBUTING guide.
  • [X] I've specified the Conan version, operating system version and any tool that can be relevant.
  • [X] I've explained the steps to reproduce the error or the motivation/use case of the question/suggestion.
bug

All 3 comments

I've tested removing *:fPIC=True and I get the same for the shared option. This means for example that a consumer package that is an application (and so doesn't need the shared option), but links to one or several shared libraries can't be built using *:shared=True anymore. That's pretty much the use case of the test_package.

Seems related to this line in the 1.7.0 changelog:

Bugfix: Apply general scope options to a consumer ConanFile first.

Which appears to be PR #3361 .

Yes, this could be a regression. Let us have a look, will try to fix it asap.

Fixed! Will be in 1.7.3

Was this page helpful?
0 / 5 - 0 ratings