mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
cargo: remove runtime references to cargo-bootstrap (#510169)
This commit is contained in:
commit
f23e8ad032
3 changed files with 23 additions and 8 deletions
|
|
@ -80,9 +80,9 @@ rustPlatform.buildRustPackage.override
|
|||
if stdenv.buildPlatform.canExecute stdenv.hostPlatform then
|
||||
''
|
||||
installShellCompletion --cmd cargo \
|
||||
--bash <(CARGO_COMPLETE=bash cargo) \
|
||||
--fish <(CARGO_COMPLETE=fish cargo) \
|
||||
--zsh <(CARGO_COMPLETE=zsh cargo)
|
||||
--bash <(CARGO_COMPLETE=bash $out/bin/cargo) \
|
||||
--fish <(CARGO_COMPLETE=fish $out/bin/cargo) \
|
||||
--zsh <(CARGO_COMPLETE=zsh $out/bin/cargo)
|
||||
''
|
||||
else
|
||||
''
|
||||
|
|
@ -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";
|
||||
|
|
|
|||
|
|
@ -72,14 +72,16 @@
|
|||
maturinBuildHook
|
||||
bindgenHook
|
||||
;
|
||||
|
||||
# Let packages reference the build derivations, e.g. for disallowedReferences.
|
||||
# Get rid of the splicing though, so `nativeBuildInputs = [ rustPlatform.rust.rustc ]` works.
|
||||
rust = {
|
||||
rustc = rustc.__spliced.hostTarget or rustc;
|
||||
cargo = cargo.__spliced.hostTarget or cargo;
|
||||
};
|
||||
};
|
||||
})
|
||||
// lib.optionalAttrs config.allowAliases {
|
||||
rust = {
|
||||
rustc = lib.warn "rustPlatform.rust.rustc is deprecated. Use rustc instead." rustc;
|
||||
cargo = lib.warn "rustPlatform.rust.cargo is deprecated. Use cargo instead." cargo;
|
||||
};
|
||||
|
||||
# Added in 25.05.
|
||||
fetchCargoTarball = throw "`rustPlatform.fetchCargoTarball` has been removed in 25.05, use `rustPlatform.fetchCargoVendor` instead";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -448,6 +448,12 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
|
||||
requiredSystemFeatures = [ "big-parallel" ];
|
||||
|
||||
# Make sure our bootstrap packages don't end up in our runtime closure
|
||||
disallowedReferences = [
|
||||
cargo
|
||||
rustc
|
||||
];
|
||||
|
||||
passthru = {
|
||||
llvm = llvmShared;
|
||||
inherit llvmPackages;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue