conan icon indicating copy to clipboard operation
conan copied to clipboard

[bug] default_options hide 'already assigned' error

Open a-zw opened this issue 3 years ago • 2 comments

Have two (mutually independent) packages depend on a third one but set an option in different ways. A fourth package depends on both of them to form a "diamond" shape. It is not possible to build the package satisfying both options at once and sometimes an error is shown. Conan should always show an error though.

More precisely, the "sometimes" depends on default_options being declared in the critical package or not.

Environment Details

  • Operating System+version: Tested with Linux but probably not relevant
  • Conan version: 1.44.1. 1.45.0
  • Python version: 3.8.5

Steps to reproduce

  1. Check out this repo: https://github.com/a-zw/conan-test

  2. Run the test.sh script. No error is shown.

  3. Now remove the default_options in lower/conanfile.py.

  4. Run the test.sh script again. See the error:

     ERROR: lower/1.0.0: mid_right/1.0.0 tried to change lower/1.0.0 option my_option to b
     but it was already assigned to a by mid_left/1.0.0
    

The behavior should be consistent in step 2 and 4 though.

a-zw avatar Feb 18 '22 13:02 a-zw

I'm not sure but #8135 could be related.

a-zw avatar Feb 18 '22 13:02 a-zw