External Publication
Visit Post

[Pre-RFC] `cargo package` should include fewer files by default

Rust Internals [Unofficial] April 22, 2026
Source

Some quick thoughts

  • It would be good to go into specifics on prior art. If Swift includes LICENSE, what about LICENSE-MIT?
  • It would be good to enumerate the current behavior and some of the existing conversations around it in case there are opportunities for these ideas to build off of each other
  • We want a way for users to tell cargo about license files for specified licenses which could get them automatically included when packaged but there is some design work there. I'd recommend this as per-requisite work so we don't have to make assumptions about license files (which we've already shied away from with cargo new).
  • If we start with default cargo locations, what we can instead do is enumerate all build targets and use their parent directories
  • If we go by extension, this will likely miss a lot of test data that people won't notice is missing because they don't run cargo test on the package. I wonder if we should exclude test/bench build targets
  • Generally editions are supposed to have an automated migration path though we have flexed a bit on that in the past.
  • I have a preference for expressing edition changes as changing of defaults for existing settings. For example, Cargo.tomls resolver = "3" changes the default for .cargo/config.tomls resolver.incompatible-rust-version.

Discussion in the ATmosphere

Loading comments...