3
0
Fork 0
forked from mirrors/nixpkgs

build-rust-crate: disable incremental builds

According to rustc implementation[1], `-C incremental=no` enables
incremental builds with directory name `no`. This patch removes the
`-C incremental` argument to disable incremental builds.

[1]: ee86f96ba1/compiler/rustc_session/src/options.rs (L918-L919)
This commit is contained in:
pandaman64 2021-07-09 22:54:03 +09:00
parent 89d0555568
commit c39040195f
2 changed files with 1 additions and 2 deletions

View file

@ -12,7 +12,6 @@
[
(if release then "-C opt-level=3" else "-C debuginfo=2")
"-C codegen-units=$NIX_BUILD_CORES"
"-C incremental=no"
"--remap-path-prefix=$NIX_BUILD_TOP=/"
(mkRustcDepArgs dependencies crateRenames)
(mkRustcFeatureArgs crateFeatures)

View file

@ -24,7 +24,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=$NIX_BUILD_CORES -C incremental=no"] ++ extraRustcOpts);
(["-C codegen-units=$NIX_BUILD_CORES"] ++ extraRustcOpts);
buildDeps = mkRustcDepArgs buildDependencies crateRenames;
authors = lib.concatStringsSep ":" crateAuthors;
optLevel = if release then 3 else 0;