NEEDS REVIEW: enable sysroot differently
This commit is contained in:
parent
2bccf2e554
commit
d884b2d877
@ -109,7 +109,9 @@ in
|
|||||||
# See https://os.phil-opp.com/testing/ for more information.
|
# See https://os.phil-opp.com/testing/ for more information.
|
||||||
assert useSysroot -> !(args.doCheck or true);
|
assert useSysroot -> !(args.doCheck or true);
|
||||||
|
|
||||||
stdenv.mkDerivation ((removeAttrs args ["depsExtraArgs"]) // {
|
stdenv.mkDerivation ((removeAttrs args ["depsExtraArgs"]) // stdenv.lib.optionalAttrs useSysroot {
|
||||||
|
RUSTFLAGS = "--sysroot ${sysroot} " + (args.RUSTFLAGS or "");
|
||||||
|
} // {
|
||||||
inherit cargoDeps;
|
inherit cargoDeps;
|
||||||
|
|
||||||
patchRegistryDeps = ./patch-registry-deps;
|
patchRegistryDeps = ./patch-registry-deps;
|
||||||
@ -207,9 +209,7 @@ stdenv.mkDerivation ((removeAttrs args ["depsExtraArgs"]) // {
|
|||||||
"CXX_${rust.toRustTarget stdenv.buildPlatform}"="${cxxForBuild}" \
|
"CXX_${rust.toRustTarget stdenv.buildPlatform}"="${cxxForBuild}" \
|
||||||
"CC_${rust.toRustTarget stdenv.hostPlatform}"="${ccForHost}" \
|
"CC_${rust.toRustTarget stdenv.hostPlatform}"="${ccForHost}" \
|
||||||
"CXX_${rust.toRustTarget stdenv.hostPlatform}"="${cxxForHost}" \
|
"CXX_${rust.toRustTarget stdenv.hostPlatform}"="${cxxForHost}" \
|
||||||
${stdenv.lib.optionalString useSysroot
|
cargo build -j $NIX_BUILD_CORES \
|
||||||
"RUSTFLAGS=\"--sysroot ${sysroot} $RUSTFLAGS\" "
|
|
||||||
}cargo build -j $NIX_BUILD_CORES \
|
|
||||||
${stdenv.lib.optionalString (buildType == "release") "--release"} \
|
${stdenv.lib.optionalString (buildType == "release") "--release"} \
|
||||||
--target ${target} \
|
--target ${target} \
|
||||||
--frozen ${concatStringsSep " " cargoBuildFlags}
|
--frozen ${concatStringsSep " " cargoBuildFlags}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user