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

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

Closed

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.

@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants