buildRustCrate: make codegen-units configurable#132721
buildRustCrate: make codegen-units configurable#132721Fuuzetsu wants to merge 1 commit intoNixOS:masterfrom
Conversation
|
Ah, I made a mistake in the PR and broke eval, I will fix it. |
5e65c3b to
91f0392
Compare
|
Ping? |
91f0392 to
84fd1f5
Compare
This parameter is being set to `$NIX_BUILD_CORES` by default. This is a standard practice but there's a suspicion that this can produce broken builds. For some details see cargo2nix/cargo2nix#184 . As a work-around/test, it'd be good if codegen-units can be set to something constant, such as `1`. This PR allows it. Note that the default of `$NIX_BUILD_CORES` is preserved so this MR causes no change in default behaviour and no rebuilds.
84fd1f5 to
1d5bca0
Compare
|
I've rebased on master... Adding extra reviewer based on file edit history... |
|
FWIW I determined that codegen-units=1 doesn't solve the build reproducibility issue which is sad. It'd still be nice to have this change included though as setting this value is useful anyway. |
|
Could use make it instead use I don't super like the default of this being |
|
I marked this as stale due to inactivity. → More info |
|
Setting codegen-units=1 does fix a serious nondeterminism in Rust builds - #130309. I was about to make a PR for that, but it would be better to just change this one to default to 1 instead of $NIX_BUILD_CORES. (Probably any fixed setting is deterministic, but I think 1 produces the most efficient binaries according to the Rust docs.) |
|
Closing this as |
This parameter is being set to
$NIX_BUILD_CORESby default. This is astandard practice but there's a suspicion that this can produce broken
builds. For some details see
cargo2nix/cargo2nix#184 . As a
work-around/test, it'd be good if codegen-units can be set to something
constant, such as
1. This PR allows it.Note that the default of
$NIX_BUILD_CORESis preserved so this MRcauses no change in default behaviour and no rebuilds.
Things done
sandboxinnix.confon non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)