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

[WIP] autoPatchelfHook: search a valid interpreter, or fail #66620

Open
wants to merge 7 commits into
base: master
from

Conversation

@layus
Copy link
Contributor

commented Aug 14, 2019

Motivation for this change

autoPachelfHook patches everything with the same interpreter
($NIX_CC/nix-support/dynamic-linker) even on incompatible binaries.
This happens in particular when building with multiStdenv.

See https://discourse.nixos.org/t/binary-still-not-working-even-when-properly-patchelfed/1570/3?u=layus for details.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @tadfisher

@layus layus requested a review from Ericson2314 as a code owner Aug 14, 2019

@layus layus changed the title autoPatchelfHook: search a valid interpreter, or fail [WIP] autoPatchelfHook: search a valid interpreter, or fail Aug 14, 2019

@layus

This comment has been minimized.

Copy link
Contributor Author

commented Aug 14, 2019

Tests finished. It seems that this patch breaks a lot of tools based on autoPatchelfHook. For example apktool fails with

searching an interpreted for /nix/store/yypk47fzqcbv0dkd9saaxfnlhcqj7qay-build-tools-28.0.3/libexec/android-sdk/build-tools/28.0.3/zipalign
found interpreter '/nix/store/iykxb0bmfjmi7s53kfg6pjbfpd8jmza6-glibc-2.27/lib/ld-linux-x86-64.so.2' for '/nix/store/yypk47fzqcbv0dkd9saaxfnlhcqj7qay-build-tools-28.0.3/libexec/android-sdk/build-tools/28.0.3/zipalign'
searching for dependencies of /nix/store/yypk47fzqcbv0dkd9saaxfnlhcqj7qay-build-tools-28.0.3/libexec/android-sdk/build-tools/28.0.3/zipalign
  libc++.so -> found: /nix/store/yypk47fzqcbv0dkd9saaxfnlhcqj7qay-build-tools-28.0.3/libexec/android-sdk/build-tools/28.0.3/lib64/libc++.so
setting RPATH to: /nix/store/yypk47fzqcbv0dkd9saaxfnlhcqj7qay-build-tools-28.0.3/libexec/android-sdk/build-tools/28.0.3/lib64
searching an interpreted for /nix/store/yypk47fzqcbv0dkd9saaxfnlhcqj7qay-build-tools-28.0.3/libexec/android-sdk/build-tools/28.0.3/aarch64-linux-android-ld
/nix/store/s50lkmcg73qpd1gdybryndpk46fb8xw9-auto-patchelf-hook/nix-support/setup-hook: line 110: /nix/store/hpzj855nkgjvg58nrhq4910sb9q3kss1-gcc-wrapper-7.4.0/nix-support/dynamic-linker-m32: No such file or directory
objdump: '': No such file
No interpreter found for arch i386 needed by ''
builder for '/nix/store/ffhs8yvjwg51p436dpjjc58a669hky5f-build-tools-28.0.3.drv' failed with exit code 1
cannot build derivation '/nix/store/h1pm5pgkvaaxsg51nknlrlap9kv8swwr-apktool-2.4.0.drv': 1 dependencies couldn't be built

@Mic92 Mic92 requested a review from aszlig Aug 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.