-
Notifications
You must be signed in to change notification settings - Fork 990
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 with mixed Alias and fixed version and mixed requires and build_requires #5468
Comments
Hi @fourbft and thanks a lot for the report. Yes, the case in which However, in the case the versions are different the error is right, as you cannot have the same package with different versions in a graph, no matter if it a require or a build require. |
Hi @danimtb,
yes, if you have a look at the files in the attached tar.gz archive above, this is exactly what I said in the comment in the build_requirements() function of CC/conanfile.py. So the problem seems to be, that the alias is not correctly resolved before comparison.
Yes, that's true. But that is not the case in our scenario. |
I have ran into this as well, but couldn't reproduce it reliably. Just a note! |
This is biting us too. |
Stumbled over this again today :/ |
Going to try to move this forward or at least conclude something. |
Looks it is not easy to solve, in the current algorithm, the alias is not "resolved" because another "CA" package has been already used as a transitive consumer of "CC". Resolving that alias in the algorithm might have performance implications in other cases. We need to take a closer look but not easy patch, sorry. |
I am proposing a PR #6236 for this issue. Might not solve all corner cases, but maybe it is not very risky, as it has been conditioned to already having a conflict. Lets see if we can make this into Conan 1.22 |
Hi all! This has been merged in develop, so it is available in https://test.pypi.org/. Will be released in 1.22, but if you could please give it a try, would be very useful. Thanks @fourbft @monsdar @michaelmaguire @Mark-Hatch-Bose ! |
Hi @memsharded I have been testing this fix on two different systems with different environments and it seems that the original issue has been fixed, but it has revealed another potential defect. I am no longer getting the error mentioned above but now instead I am getting the following error
It appears that in the evaluations of downstream requirements it is not resolving the alias correctly some of the time. This error is occurring for me maybe 25% of the time. Perhaps there is some sort of race condition somewhere? Where it lists the new requirements above, it is listing the alias instead of the actual channel which is the reason for the failure. I believe that here is where it it supposed to resolve the alias Some additional info about what I am trying to do that may help to debug.
|
Hi @memsharded, |
In the situation of three packages CA, CB and CC, where CB uses CA as requires(CA/1.0.0@...) with a fixed version / direct reference and CC uses CB as requires() and CA as build_requires(CA/ALIAS@...) via an alias, conan (version 1.16.1) fails to create CC with an error message of
even though the ALIAS points to the exact same version 1.0.0@user/testing of CA.
Here is a tarball with all needed files to reproduce the bug. Unpack and start "create_all_packages.sh" on a linux machine to reproduce the bug. (Use the contained "cleanup.sh" to clean the conan cache for a second run.)
conan_alias_bug_demo4.tar.gz
This issue is different from the situation in issue #4753 in that in this case, no different versions of the requires(CA) (in CB) and build_requires(CA) (in CC) are involved, but an alias and a direct reference to the exact same version of CA. But the issues might, of course, be related.
To help us debug your issue please explain:
The text was updated successfully, but these errors were encountered: