buildRustCrate: prevent pulling in two rustc variants (#526469)
This commit is contained in:
@@ -155,8 +155,6 @@ crate_:
|
||||
lib.makeOverridable
|
||||
(
|
||||
# The rust compiler to use.
|
||||
#
|
||||
# Default: pkgs.rustc
|
||||
{
|
||||
rust ? rustc,
|
||||
# The cargo package to use for getting some metadata.
|
||||
|
||||
@@ -4270,11 +4270,20 @@ with pkgs;
|
||||
);
|
||||
in
|
||||
callPackage ../build-support/rust/build-rust-crate (
|
||||
{ }
|
||||
// lib.optionalAttrs (stdenv.hostPlatform.libc == null) {
|
||||
lib.optionalAttrs (stdenv.hostPlatform.libc == null) {
|
||||
stdenv = stdenvNoCC; # Some build targets without libc will fail to evaluate with a normal stdenv.
|
||||
}
|
||||
// lib.optionalAttrs targetAlreadyIncluded { inherit (pkgsBuildBuild) rustc cargo; } # Optimization.
|
||||
// (
|
||||
if targetAlreadyIncluded then
|
||||
# Optimization
|
||||
{
|
||||
inherit (pkgsBuildBuild) rustc cargo;
|
||||
}
|
||||
else
|
||||
{
|
||||
inherit (pkgsBuildHost) rustc cargo;
|
||||
}
|
||||
)
|
||||
);
|
||||
buildRustCrateHelpers = callPackage ../build-support/rust/build-rust-crate/helpers.nix { };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user