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

Alias resolution bug in triangle shaped dependency tree with appendage #2576

Closed
3 tasks done
fourbft opened this issue Mar 7, 2018 · 1 comment
Closed
3 tasks done
Assignees
Milestone

Comments

@fourbft
Copy link

fourbft commented Mar 7, 2018

conan_alias_bug_demo.tar.gz

Applies to at least conan versions 0.29.2, 1.0.0-beta4, 1.1.0 and 1.1.1 (those are the ones that I tested).
Seen on Linux, but will almost certainly also apply to windows.

The following setup shows the problem:
I have boiled it down to four conan packages with the following dependency structure:

CD    ---   CB ---  CA
   \       /
      CC

Which means: package CD requires CC and CB, package CC requires CB and CB requires CA. The requirements all use an alias and not a particular version, like this:

"self.requires( "CC/ALIAS@user/testing")"

When building this structure from CA down to CD, conan fails with an error message while creating CD:

ERROR: CB/0.0.2@user/testing: Incompatible requirements obtained in different evaluations of 'requirements'
    Previous requirements: [CA/ALIAS@user/testing]
    New requirements: [CA/0.0.1@user/testing]

While, of course, the alias package "CA/ALIAS@user/testing" is actually pointing to the package "CA/0.0.1@user/testing".

To reproduce the bug, I've attached a tar archive that contains all the necessary code: four directories, CD through CA containing just a conanfile.py each and two scripts: 'build_CA_through_CD.sh' and 'cleanup.sh'.
Just, untar the archive anywhere, go to the directory conan_alias_bug_demo and start the script 'build_CA_through_CD.sh' (it doesn't do any magic, just four "conan create" and "conan alias" calls in the package subdirectories in the correct order). At the end of the script you'll see the above error message. The other script 'cleanup.sh' just cleans up the conan cache (removes the packages and aliases), for a clean rerun of the test.

To help us debug your issue please explain:

  • I've read the CONTRIBUTING guide.
  • I've specified the Conan version, operating system version and any tool that can be relevant.
  • I've explained the steps to reproduce the error or the motivation/use case of the question/suggestion.
@memsharded
Copy link
Member

There is a PR in : #2597 that could fix this case too.

It would really help if you could run from my source branch against your projects, to make sure everything looks good. I have added some new automatic tests, but validating against your project could be very useful. Many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants