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 overlay: no such file or directory #66

Closed
sjmackenzie opened this issue Sep 12, 2017 · 6 comments
Closed

rust overlay: no such file or directory #66

sjmackenzie opened this issue Sep 12, 2017 · 6 comments

Comments

@sjmackenzie
Copy link

Expected behaviour:

Rust nightly is downloaded and run without a problem

Actual behaivour

Rust nightly fails with this error:

building path(s) ‘/nix/store/9pqiqhd52v73wmrpacv5fvhc1rys8ygy-rust-1.22.0-nightly-2017-09-11-eba374fb2’
unpacking sources
unpacking source archive /nix/store/mimkrwcq8qpch42qp9m9spj0lf3hlw52-rust-nightly-x86_64-unknown-linux-gnu.tar.gz
source root is .
setting SOURCE_DATE_EPOCH to timestamp 1505185995 of file ./env-vars
warning: file ./env-vars may be generated; SOURCE_DATE_EPOCH may be non-deterministic
patching sources
configuring
no configure script, doing nothing
building
no Makefile, doing nothing
installing
/nix/store/r071pbl8rdb65cjlv55h67ds24pllank-stdenv/setup: ./install.sh: /bin/bash: bad interpreter: No such file or directory
builder for ‘/nix/store/kkkzdk319lq3mk8cdna2i8dylmknhbc3-rust-1.22.0-nightly-2017-09-11-eba374fb2.drv’ failed with exit code 126

Steps to reproduce

install rust rightly using this repository.

@zimbatm
Copy link
Contributor

zimbatm commented Sep 12, 2017

Are you on NixOS?

It looks like the install.sh script needs to be patched to correct the bash path.

@sjmackenzie
Copy link
Author

Yes I'm on NixOS.

Has an upstream path changed to break the build, I'm pretty certain it's not me.

@rushmorem
Copy link

rushmorem commented Sep 12, 2017

I'm running into this issue as well. For me, on NixOS 17.09.git.b50193f, the derivation continues to build just fine but the interpreter is not patched.

#  Cargo and other Rust binaries are available in my PATH
$ which cargo
/run/current-system/sw/bin/cargo

# But they can't be executed
$ cargo --version
bash: /run/current-system/sw/bin/cargo: No such file or directory

# Because the interpreter isn't patched
$ readelf -l $(which cargo) | grep interpreter
      [Requesting program interpreter: /lib64/ld-linux-x86-64.so.2]

EDIT: Actually, the problem I'm running into on is different from this one. For me, install.sh is being patched just fine. When building, I'm getting the following warning instead:-

setting interpreter of /nix/store/1lmb3xdl6bj47v31j2livjyqib21ci0a-rust-1.22.0-nightly-2017-09-09-ddd123ed9/lib/libstd-85c630e4370fa944.
so
cat: /nix/store/zgzak0grvimifrxr3yww1xbyix0qyrv8-gcc-wrapper-6.4.0/nix-support/dynamic-linker: No such file or directory

This is because dynamic-linker no longer exists:-

$ ls /nix/store/zgzak0grvimifrxr3yww1xbyix0qyrv8-gcc-wrapper-6.4.0/nix-support/
add-flags.sh      cc-cflags   libc-cflags  orig-libc      propagated-native-build-inputs  utils.sh
add-hardening.sh  cc-ldflags  orig-cc      orig-libc-dev  setup-hook

@zimbatm
Copy link
Contributor

zimbatm commented Sep 12, 2017

I don't have time to look deeply into it so here are some pointers:

There is already an attempt to patch the install script at https://github.com/mozilla/nixpkgs-mozilla/blob/master/rust-overlay.nix#L173, maybe the location of the script has changed?

I would also recommend submitting the change to rust-lang to always use #!/usr/bin/env bash for the shebang so we don't have to patch it in the first place.

@sjmackenzie
Copy link
Author

sjmackenzie commented Sep 12, 2017

@rushmorem try updating your rev to 7e54fb37cd177e6d83e4e2b7d3e3b03bd6de0e0f (current master head). It worked for me. If it works for you I'll close the issue.

@rushmorem
Copy link

rushmorem commented Sep 12, 2017

@sjmackenzie I will, thanks. Also, according to NixOS/nixpkgs#29278 (comment) that should work so feel free to close.

EDIT: Just to clarify, I was already this repo's latest rev (7e54fb3). What I needed to update was my NixOS version.

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

No branches or pull requests

3 participants