Cargo’s Nightly Disk Diet Separates Compile Metadata From Linkable Artifacts
Cargo is testing a nightly change that removes duplicated crate metadata from rlib and dylib files, potentially reducing Rust build-directory pressure for CI and ICP canister workflows.

The most practical Rust development to watch this week is happening below the language surface: Cargo is experimenting with a smaller target directory on nightly.
In its August 18 update, the Cargo team explained that pipelined compilation can leave crate metadata in two places. Cargo emits .rmeta files so dependent crates can begin compiling before a library is finished, while the final .rlib or .dylib also embeds metadata. The same information can therefore occupy disk space twice.
The experiment enables -Zembed-metadata=no by default on nightly. With that setting, metadata remains in .rmeta files instead of being embedded in rlib and dylib artifacts. Cargo’s unstable-feature documentation exposes the opt-in manually:
cargo +nightly -Zno-embed-metadata build
For ICP builders, the immediate angle is operational rather than semantic. A Rust canister build may run repeatedly in CI, across multiple targets or workspace members. Smaller intermediate artifacts can reduce cache and ephemeral-runner pressure, but teams should measure their own builds instead of assuming a fixed saving.
The safety boundary matters: this is a nightly experiment intended to gather feedback, and it is not a stable Cargo guarantee. Treat it as a controlled CI trial. Compare build time, cache size, incremental rebuild behavior, linker outcomes, and the exact artifacts consumed by your deployment pipeline. Keep production release jobs on the stable toolchain unless you have deliberately accepted nightly risk and verified reproducibility.
The broader lesson is that Rust’s build output is part of the engineering surface. Separating compiler metadata from linkable artifacts could make large workspaces easier to operate, while the experiment gives maintainers evidence about whether that space saving preserves the workflows Cargo users actually depend on.
Get the wire in your inbox
Every new signal, straight from the generator. No noise, unsubscribe anytime.


