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

Rust Nightly is missing a library #91314

Closed
witchof0x20 opened this issue Jun 22, 2020 · 5 comments · Fixed by #91327
Closed

Rust Nightly is missing a library #91314

witchof0x20 opened this issue Jun 22, 2020 · 5 comments · Fixed by #91327
Labels
0.kind: bug Something is broken 6.topic: rust

Comments

@witchof0x20
Copy link
Contributor

witchof0x20 commented Jun 22, 2020

Describe the bug

As of rust nightly 2020-06-22, Rust nightly cannot find libz.so.1
This issue is not present in Rust nightly 2020-06-21.

To Reproduce
Steps to reproduce the behavior:

nix-shell -p rustup
rustup update nightly
rustup run nightly rustc
/home/jade/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustc: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory

Expected behavior
rustc works

Additional context
This also happens with rust nightly from https://github.com/mozilla/nixpkgs-mozilla

Notify maintainers
@Mic92

Metadata

  • system: "x86_64-linux"
  • host os: Linux 5.4.46, NixOS, 20.03.2262.2b417708c28 (Markhor)
  • multi-user?: yes
  • sandbox: no
  • version: nix-env (Nix) 2.3.6
  • channels(root): "nixos-20.03.2262.2b417708c28, nixpkgs-unstable-20.09pre221694.342eaba9ebb"
  • channels(jade): ""
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module:
@witchof0x20 witchof0x20 added the 0.kind: bug Something is broken label Jun 22, 2020
@Mic92
Copy link
Member

Mic92 commented Jun 22, 2020

We are currently using patchelf in rustup internally to set the elf interpreter. Looks like we need to extend this to also extend the RPATH to add zlib. If someone makes a PR, I will review it! Not sure when I would get to implement that myself.

@Mic92
Copy link
Member

Mic92 commented Jun 22, 2020

@witchof0x20
Copy link
Contributor Author

I'm working on a patch for this. This is definitely the issue, just need to find the right way to extend the RPATH. I have something replacing it with a path containing zlib, but that overwrites the existing $ORIGIN/../lib, which breaks it. I would like to verify what is setting $ORIGIN/../lib there but hardcoding it should provide an early fix

@witchof0x20
Copy link
Contributor Author

witchof0x20 commented Jun 22, 2020

Extending the RPATH seems not to have worked

$ patchelf --print-rpath ~/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustc
$ORIGIN/../lib:/nix/store/byijk75wjm55sjngzl2zls2hgrg49lal-zlib-1.2.11/lib
$ .rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustc
.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/rustc: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory

@witchof0x20
Copy link
Contributor Author

I'm investigating patching the files in lib
This issue may have been introduced by rust-lang/rust#72696 so it's likely the new zlib dependency shows up in the LLVM libraries

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 6.topic: rust
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants