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
Bugfix: Overridden requirement not found in lockfile #8907
Bugfix: Overridden requirement not found in lockfile #8907
Conversation
This fixes bug conan-io#8870, but it changes the layout of dependency graphs and breaks several existing tests.
This reverts commit 0602878.
…dependencies If a ConanFile defines a requirement with the property 'override=True', GraphLock::lock_node() now searches the whole dependency graph instead of just the direct dependencies of corresponding node. This is necessary because requirements of a ConanFile that were defined with the property 'override=True' are not included in the 'requires' field of the node that corresponds to that recipe.
Hi @harendt Sorry this has taken a while to process. I am assigning it to next release, so we allocate some time to review it. |
Hi @harendt I have proposed an alternative solution to this fix in #9215. The principle is that overrides do already exist as real requires elsewhere, that will be correctly extracted from the lockfile, so they can be ignored, no need to lock an override. Please have a look. I have also added a way more simple test, probably it wasn't necessary a full CI test to fix this issue. I wanted to do a PR to your fork, but it is a bit outdated from develop branch, and I didn't want to push changes directly. I would like to keep your contribution and your test, if you want to extract my fix and my test from this PR to yours, I'd be happy. |
Sure, I can do that. What is your preferred way to "extract" your changes? Should I just merge your branch? Or should I cherry-pick your changes? In the latter case I would also have to rebase my branch onto the |
As you wish, at the end, the PR is squashed and merged, so whatever is easier for you. |
…t-not-found-in-lockfile' into bugfix/overridden-requirement-not-found-in-lockfile
Perfect, thanks for reporting and contributing this fix! Will be in next 1.39 |
Changelog: Bugfix: Fix that overridden requirements "cannot be found in lockfile".
Docs: omit
Fixes: #8870
In order to lock all
requires
of a recipe, the existing methodGraphLock::lock_node()
searches therequires
field of a graph node for the corresponding references. But requirements with the propertyoverride=True
are not included in the graph node'srequires
field, which leads to the error:Require '<package name>' cannot be found in lockfile
. To fix this issue, theGraphLock::lock_node()
method now searches transitiverequires
fields of a node if a requirement has the propertyoverride=True
. A corresponding integration test has been added. The new integration test is failing without the fix, but passing with the fix.develop
branch, documenting this one.)Note: By default this PR will skip the slower tests and will use a limited set of python versions. Check here how to increase the testing level by writing some tags in the current PR body text.