Skip to content

androidenv.androidsdk: patch x64 interpreter path of emulator{,-check}#49564

Closed
nicknovitski wants to merge 1 commit intoNixOS:masterfrom
nicknovitski:androidsdk-patchelf-emulator
Closed

androidenv.androidsdk: patch x64 interpreter path of emulator{,-check}#49564
nicknovitski wants to merge 1 commit intoNixOS:masterfrom
nicknovitski:androidsdk-patchelf-emulator

Conversation

@nicknovitski
Copy link
Contributor

Currently the emulator and emulator-check binaries error with the message No such file or directory, due to a hard-coded interpreter path:

.emulator-wrapped:       ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.15, stripped
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • [ ] macOS (changes only effect x86-64 linux)
    • 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 nox --run "nox-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)
  • Fits CONTRIBUTING.md.

${stdenv.lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux") ''
for i in emulator emulator-check
do
patchelf --set-interpreter ${stdenv.cc.libc.out}/lib/ld-linux-x86-64.so.2 $i
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is this pull request that also extends the rpath: https://github.com/NixOS/nixpkgs/pull/49515/files

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I was able to run the binaries just by changing the interpreter, but maybe there were bugs I wasn't hitting.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After thinking about it a bit I think it might be also not necessary because the wrapper already puts the same shared library directory with LD_LIBRARY_PATH into the scope.

@GrahamcOfBorg GrahamcOfBorg added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Oct 31, 2018
@nicknovitski
Copy link
Contributor Author

Closing in favor of #49515

@nicknovitski nicknovitski deleted the androidsdk-patchelf-emulator branch November 1, 2018 01:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants