Fix determinism by defaulting codegenUnits to 1, not NIX_BUILD_CORES
This commit is contained in:
parent
f6897d23f4
commit
13a9006ec3
@ -12,7 +12,7 @@
|
||||
baseRustcOpts =
|
||||
[
|
||||
(if release then "-C opt-level=3" else "-C debuginfo=2")
|
||||
"-C codegen-units=${codegenUnits}"
|
||||
"-C codegen-units=${toString codegenUnits}"
|
||||
"--remap-path-prefix=$NIX_BUILD_TOP=/"
|
||||
(mkRustcDepArgs dependencies crateRenames)
|
||||
(mkRustcFeatureArgs crateFeatures)
|
||||
|
@ -25,7 +25,7 @@ let version_ = lib.splitString "-" crateVersion;
|
||||
version = lib.splitVersion (lib.head version_);
|
||||
rustcOpts = lib.foldl' (opts: opt: opts + " " + opt)
|
||||
(if release then "-C opt-level=3" else "-C debuginfo=2")
|
||||
(["-C codegen-units=${codegenUnits}"] ++ extraRustcOptsForBuildRs);
|
||||
(["-C codegen-units=${toString codegenUnits}"] ++ extraRustcOptsForBuildRs);
|
||||
buildDeps = mkRustcDepArgs buildDependencies crateRenames;
|
||||
authors = lib.concatStringsSep ":" crateAuthors;
|
||||
optLevel = if release then 3 else 0;
|
||||
|
@ -316,7 +316,7 @@ crate_: lib.makeOverridable
|
||||
colors = lib.attrByPath [ "colors" ] "always" crate;
|
||||
extraLinkFlags = lib.concatStringsSep " " (crate.extraLinkFlags or [ ]);
|
||||
edition = crate.edition or null;
|
||||
codegenUnits = if crate ? codegenUnits then crate.codegenUnits else "$NIX_BUILD_CORES";
|
||||
codegenUnits = if crate ? codegenUnits then crate.codegenUnits else 1;
|
||||
extraRustcOpts =
|
||||
lib.optionals (crate ? extraRustcOpts) crate.extraRustcOpts
|
||||
++ extraRustcOpts_
|
||||
|
Loading…
Reference in New Issue
Block a user