python/catch_conflicts: scan $out, not sys.path#284067
Closed
phaer wants to merge 1 commit intoNixOS:stagingfrom
Closed
python/catch_conflicts: scan $out, not sys.path#284067phaer wants to merge 1 commit intoNixOS:stagingfrom
phaer wants to merge 1 commit intoNixOS:stagingfrom
Conversation
Member
Author
|
Not sure what to do about the ofborg-eval & check-by-name failures; the very same commit evaluates cleanly for me locally when i.e. running "nix build .#poetry-core". Issue seems to be independent of this change, can reproduce with on |
This changes the non-legacy version of pythonCatchConflictsHook to recursively scan the output of the target derivation as well as its propagatedBuildInputs for duplicate dependencies. Previously, we did scan sys.path but did prove problematic as it produced false positives i.e. when build-time dependencies of hooks - such as setuptools in pythonCatchConflictsHook itself - where mistakenly flagged as duplicates; even though the are not included in the outputs of the target dervation. As all python runtime-dependencies are currently passed via propagatedBuildInputs in nixpkgs, scanning that plus site-packages seems sufficient to catch all conflicts that matter at runtime and less likely to produce false positives. The legacyHook in catch_conflicts_py2.py needs to be migrated as well, if it's still needed.
3783f7d to
a9861fa
Compare
13 tasks
Member
Author
|
has been merged as part of #287957 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes
This changes the non-legacy version of pythonCatchConflictsHook to recursively scan the output of the target derivation as well as its propagatedBuildInputs for duplicate dependencies.
Previously, we did scan sys.path but that did turn out to be problematic as it produced false positives i.e. when build-time dependencies of hooks - such as setuptools in pythonCatchConflictsHook itself - where mistakenly flagged as duplicates; even though the are not included in the outputs of the target dervation.
As all python runtime-dependencies are currently passed via propagatedBuildInputs in nixpkgs, scanning that plus site-packages seems sufficient to catch all conflicts that matter at runtime and less likely to produce false positives.
Status
DRAFT for discussion about a fix of #283695,
Please read the issue description for context.
Checked basic functionality on master, but needs further testing before I feel comfortable with a merge and the legacyHook in catch_conflicts_py2.py needs to be migrated as well, if it's still needed.
targets python-updates as quite a few rebuilds would be expected for hook change.
Add a 👍 reaction to pull requests you find important.