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
stdenv: add isELFExec, isELFDyn, fix wrappers #66725
Conversation
I wonder if we should do similar for wrap-gapps-hook @jtojnar? |
This seems alright, but it may take a while for this fix to go through staging (and might miss the release-19.09 cutoff). It would be good if we can get a fix for #65564 that avoids mass rebuilds, perhaps just inlining "isELFExec" in wrap-qt-apps-hook.sh would work? |
You think we couldn't merge staging more than two more times? |
I still think it will be a pretty large rebuild even if we do that. |
We could probably backport something less intrusive if we really have to. |
Yeah that seems reasonable. My main concern is changing setup.sh means we have to rebuild everything, which can take up to a week, while just changing qt5-stuff is much quicker. On the other hand, it usually turns out that staging rebuilds everything anyway. |
Checking for specific ELF types seemed very generic and useful outside of qt world too, like for the
|
Many GTK apps are written in scripting languages like Python so narrowing it down to ELF by default would not make sense. If we added a way to making it parametric with |
By the way, I could get rid of all the |
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.
Perl regex looks fine, standard output is ignored on grep correctly.
I've tested the bash functions by hand and they return the expected exit status.
Can we have comments like isELF
has above the functions?
1bab936
to
cb71651
Compare
Uploaded a new iteration, now with comments. I also updated the |
The reason that |
Makes sense, I'll skip changing |
These can be used to determine whether a ELF file with ELF header is an executable or shared library. We can't implement it in pure bash, as bash has problems with null bytes.
This ensures we only wrap executables, not shared libraries
cb71651
to
88146a0
Compare
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/nixos-19-09-feature-freeze/3707/7 |
Motivation for this change
wrapQtAppsHook
usesisELF
frompkgs/stdenv/generic/setup.sh
to determine whether to wrap a program or not.This can accidentially wrap
.so
files (and other non-executables), so I addedisELFExec
andisELFDyn
to be able to distinguish.Afterwards,
wrapQtAppsHook
is changed to useisELFExec
instead of justisELF
.Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)