mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
rustPlatform.rust: undeprecate
These attributes were deprecated in #230951 because they confused things with splicing, e.g. passing `rustPlatform.rust.rustc` to `nativeBuildInputs` would get the wrong derivation when cross-compiling. This was a consequence of the fact that they come from the buildPackages set. But we still want to expose these packages as otherwise Rust packages have no way to reference the rustc and cargo that build them, which means they can't e.g. use `disallowedReferences` to ensure they don't end up in the runtime closure. Just as `stdenv.cc` itself isn't spliced, we can solve this problem by unsplicing the packages.
This commit is contained in:
parent
e749b0a6c7
commit
8eb3c82575
1 changed files with 7 additions and 5 deletions
|
|
@ -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";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue