Skip to content

Conversation

@emilk
Copy link
Member

@emilk emilk commented Dec 15, 2025

Incremental compilation blows up the size of the target folder,
but it is also buggy, causing spurious "link failures" that requires a complete clean of the target folder.

Note that the incremental part is for each individual crate. Even with CARGO_INCREMENTAL we only recompile the crates that we need to recompile (but we will recompile them in their entirety).

https://doc.rust-lang.org/cargo/reference/profiles.html#incremental

@emilk emilk added 🧑‍💻 dev experience developer experience (excluding CI) 📉 performance Optimization, memory use, etc exclude from changelog PRs with this won't show up in CHANGELOG.md labels Dec 15, 2025
@github-actions
Copy link

github-actions bot commented Dec 15, 2025

Web viewer failed to build.

| Result | Commit | Link | Manifest |
| ------ | ------- | ----- |
| ❌ | | https://rerun.io/viewer/pr/12207 | +nightly +main |

View image diff on kitdiff.

Note: This comment is updated whenever you push a commit.

@teh-cmc
Copy link
Member

teh-cmc commented Dec 15, 2025

FYI: There's a less hacky way than an environment variable that I use in my ~/.cargo:

[build]
rustc-wrapper = "/home/cmc/.cargo/bin/sccache"
incremental = false

[target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = [
  "-Clink-arg=-fuse-ld=/usr/bin/mold",
  "-Csplit-debuginfo=unpacked",
  "-Ctarget-cpu=native",
  "-Cforce-unwind-tables=yes",
  "--cfg", "tokio_unstable",
]

@emilk emilk changed the title Set CARGO_INCREMENTAL = "0" Turn of incremental Rust compilation Dec 15, 2025
@emilk emilk changed the title Turn of incremental Rust compilation Turn off incremental Rust compilation Dec 15, 2025
@emilk emilk merged commit c663f5d into main Dec 15, 2025
32 of 34 checks passed
@emilk emilk deleted the emilk/no-incremental-compilation branch December 15, 2025 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🧑‍💻 dev experience developer experience (excluding CI) exclude from changelog PRs with this won't show up in CHANGELOG.md 📉 performance Optimization, memory use, etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants