Skip to content
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

wrapQtAppsHook: use patchelf --print-interpreter instead of isELFExec #68513

Merged
merged 2 commits into from
Sep 13, 2019

Conversation

bjornfor
Copy link
Contributor

Motivation for this change

Wrap all executables, even PIEs. Without this change, programs like keepassxc do not start anymore since recent Qt wrapper changes.

Fixes #68404.
References #65399.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @

…xec`

Some executables are built as PIEs (e.g. keepassxc) and are technically
isELFDyn, not isELFExec. Without this change those executables will not
be wrapped.
Prevents messages like this in the build log:

  grep: <PATH>/bin: Is a directory
@FRidh
Copy link
Member

FRidh commented Sep 11, 2019

Am I correct that scripts won't be patched then? I proposed to patch those as well in #65372.

@bjornfor
Copy link
Contributor Author

Am I correct that scripts won't be patched then? I proposed to patch those as well in #65372.

Right, it doesn't wrap scripts, only ELFs. I didn't know about that PR before.

For me, this PR only fixes a regression introduced when the wrapQtAppsHook switched from using isELF to isELFExec, since at that time it stopped wrapping keepassc (and other PIEs).

@bjornfor
Copy link
Contributor Author

It's weird how many library files (*.so) are installed with the executable bit set. This would be so much easier if we could just iterate over executable files and wrap them. But doing that currently includes lots of *.so files.

@lheckemann
Copy link
Member

Is this a bugfix that needs backporting to 19.09?

@worldofpeace
Copy link
Contributor

Is this a bugfix that needs backporting to 19.09?

isELFExec is used in 19.09 so the aforementioned applications are not wrapped in the release.

@nbardiuk nbardiuk mentioned this pull request Sep 12, 2019
10 tasks
@bjornfor bjornfor merged commit d6e65ec into NixOS:master Sep 13, 2019
@bjornfor bjornfor deleted the fix-wrap-qt-apps-hook branch September 13, 2019 14:53
@lheckemann
Copy link
Member

so... yes, it does need a backport?

@worldofpeace
Copy link
Contributor

Yes @lheckemann, though in my opinion I would have waited for @ttuegel approval of the change...
See #68513 (comment)

@bjornfor
Copy link
Contributor Author

Backported to relese-19.09: f62222e, 29cb637.

@ttuegel
Copy link
Member

ttuegel commented Sep 15, 2019

LGTM 👍 Thanks!

@matthewbauer
Copy link
Member

Does this mean we should remove isELFExec and isELFDyn? It looks to me like they are not accurate enough to be useful.

matthewbauer added a commit to matthewbauer/nixpkgs that referenced this pull request Sep 18, 2019
This reverts commit e1b80a5.

This is broken in PIE (NixOS#68513). Best to not keep it in until something
else starts using it.
matthewbauer added a commit to matthewbauer/nixpkgs that referenced this pull request Sep 18, 2019
This is broken in PIE (NixOS#68513). Best to not keep it in otherwise something
else will start using it.

This reverts commit e1b80a5.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

wrapQtAppsHook fails to wrap PIEs
6 participants