Radar · Rust · Archive · Week 34 · Aug 17 – 23, 2026
Experiment in reducing target directory size on nightly
Nice to knowtooling
- What changed
- The Rust team experimented with reducing the size of the target directory on nightly.
- Production impact
- The source does not say.
- Try it
- Build a small crate on nightly and compare the size of
target/debugbefore and after the experiment. - Source
- blog.rust-lang.org/inside-rust/2026/08/18/reducing-target-dir-size-on-nightly/
Understand it, then run it
Cargo, the Rust package manager, keeps a folder called target where it stores all the files it creates while compiling your project. Those files can take up a lot of disk space, especially when you compile many projects or use debug builds. The Cargo team has added a new nightly‑only setting called -Zembed-metadata=no. When this flag is on, Cargo stops writing duplicate metadata into the compiled library files, which makes the target folder a little smaller. The change is only active on the nightly channel and is meant to test whether it helps users without breaking anything.
Run it now
// This program demonstrates the effect of the nightly-only `-Zembed-metadata=no` flag.
// Since the flag is not available on stable, we simply print a message explaining
// what would happen if it were enabled.
fn main() {
println!("On nightly, Cargo automatically passes `-Zembed-metadata=no` to rustc,");
println!("which removes duplicate metadata from .rlib files and reduces the");
println!("size of the target directory. This change is experimental and only");
println!("affects nightly builds.");
}
What it printed when we ran it on Rust 1.98.1 (edition 2024)
On nightly, Cargo automatically passes `-Zembed-metadata=no` to rustc, which removes duplicate metadata from .rlib files and reduces the size of the target directory. This change is experimental and only affects nightly builds.
Run sends this program (for Solidity, the contract and its tests) to our own sandbox, where it is compiled and run once, with no network, and what it printed or the test report comes back here. Nothing is kept. Runs are counted per visitor for the day so everyone gets a turn; the details are on the legal page.
Written by gpt-oss-20b from the linked source · claims checked against the sources · archive, not individually reviewed