Skip to content

Latest rustup update version breaks compilation #312661

@delehef

Description

@delehef

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`

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: bugSomething is broken6.topic: rustGeneral-purpose programming language emphasizing performance, type safety, and concurrency.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions