From 126bd3b578fdeedd9af7887e028dfdfbf4a223dd Mon Sep 17 00:00:00 2001 From: Lily Ballard Date: Tue, 14 Apr 2026 21:39:14 -0700 Subject: [PATCH] cargo: disallow references to bootstrap cargo, rustc cargo recently accidentally gained a runtime dependency on cargo-bootstrap, we don't want to let that happen again. --- pkgs/development/compilers/rust/cargo.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/development/compilers/rust/cargo.nix b/pkgs/development/compilers/rust/cargo.nix index 87903ed443d5..3fb4f948a223 100644 --- a/pkgs/development/compilers/rust/cargo.nix +++ b/pkgs/development/compilers/rust/cargo.nix @@ -109,6 +109,13 @@ rustPlatform.buildRustPackage.override runHook postInstallCheck ''; + # Make sure our build rustc/cargo never make it into our runtime closure + disallowedReferences = [ + rustPlatform.rust.cargo + rustPlatform.rust.rustc + rustPlatform.rust.rustc.unwrapped + ]; + meta = { homepage = "https://crates.io"; description = "Downloads your Rust project's dependencies and builds your project";