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

Latest rustup update version breaks compilation #312661

Closed
delehef opened this issue May 18, 2024 · 3 comments · Fixed by #314268
Closed

Latest rustup update version breaks compilation #312661

delehef opened this issue May 18, 2024 · 3 comments · Fixed by #314268
Labels
0.kind: bug Something is broken 6.topic: rust

Comments

@delehef
Copy link
Contributor

delehef commented May 18, 2024

Describe the bug

Running a fresh rustup install nightly && cargo build fails, the core message being:

note: Could not start dynamically linked executable: /home/[xxx]/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/bin/gcc-ld/ld.lld
          NixOS cannot run dynamically linked executables intended for generic
          linux environments out of the box. For more information, see:
          https://nix.dev/permalink/stub-ld
          collect2: error: ld returned 127 exit status

Steps To Reproduce

Steps to reproduce the behavior:

  1. have a rust project
  2. rustup install nightly (or rustup update if you already have one)
  3. cargo build

Expected behavior

Either the rustup gcc/ld to be patched for NixOS use, or rust to use the system gcc/ld.

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.90, NixOS, 24.05 (Uakari), 24.05pre625274.205781405197`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.2`
 - channels(root): `"nixos-23.11, nixpkgs-23.11"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
@delehef delehef added 0.kind: bug Something is broken 6.topic: rust labels May 18, 2024
@delehef
Copy link
Contributor Author

delehef commented May 18, 2024

Actually, it looks like this is an issue specifically appearing with nightly-2024-05-18-x86_64-unknown-linux-gnu; so I'll try to pass the message upstream.

@delehef
Copy link
Contributor Author

delehef commented May 18, 2024

Very specifically, this is the commit introducing the issue, when it has been decided to switch from the system linker to ldd.

I suppose the new [toolchain]/lib/rustlib/x86_64-unknown-linux-gnu/bin/gcc-ld/ binaries should also be elf-patched?

@Nemo157
Copy link

Nemo157 commented May 20, 2024

Patching those binaries will make them execute, but they also need the ld-wrapper applied so that the binaries they build will also get patched automatically.

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
2 participants