openSUSE-Rust / cargo-packaging

Cargo Packaging macros
Mozilla Public License 2.0
5 stars 6 forks source link

Correct incremental build flags #10

Closed marv7000 closed 4 months ago

marv7000 commented 4 months ago

-C incremental=false does not actually disable incremental builds, it does quite the opposite: It creates incremental build information in a directory called false, since that rustc flag doesn't actually take a boolean value (see [1]).

Removing this flag alone doesn't correct the behavior, as some projects might choose to override build.incremental in their respective Cargo.toml. Therefore we also have to force cargo to disable incremental builds using the CARGO_INCREMENTAL environment variable (see [2] and [3]).

[1] https://doc.rust-lang.org/rustc/codegen-options/index.html#incremental [2] https://doc.rust-lang.org/cargo/reference/config.html#buildincremental [3] https://doc.rust-lang.org/cargo/reference/profiles.html#incremental