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
python/wrapper.nix: Don't try to wrap pyc files #25184
Conversation
Before, the python wrapper utility had several deficiencies: * It would attempt to wrap non-executable files (`.pyc` files, for example). * It would ignore all files in subdirectories of `$srcstore/bin`. Now, the python wrapper utility will wrap all executable files in the directory hierarchy rooted at `$srcstore/bin`. In addition, it will not attempt to wrap non-executable files.
@ahmedtd, thanks for your PR! By analyzing the history of the files in this pull request, we identified @peti, @FRidh and @domenkozar to be potential reviewers. |
This was originally part of #24944. |
Why would we want it to look into subdirectories of $srcstore/bin? There shouldn't even be any subdirectories. |
In other packages, omitting subdirectories had directly caused problems. You are correct, in this case, we could get away with something like
|
if [[ -d "$srcstore"/bin ]]; then | ||
find "$srcstore"/bin -type f -executable -print0 \ | ||
| while IFS= read -d "" srcfile; do | ||
dstfile="$out/bin/$(basename $srcfile)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this would create collisions, if "$srcstore"/bin/foo/bar
and "$srcstore"/bin/bar
exists
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
which packages are you referring to? |
@peti, |
Right, |
Not that I can think of. Now that I'm thinking of it, though, do any python packages put programs in |
Stalled |
Before, the python wrapper utility had several deficiencies:
.pyc
files, forexample).
$srcstore/bin
.Now, the python wrapper utility will wrap all executable files in the
directory hierarchy rooted at
$srcstore/bin
. In addition, it willnot attempt to wrap non-executable files.
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)