External Publication
Visit Post

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

Rust Internals [Unofficial] April 23, 2026
Source

SwishSwushPow:

epage:

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

Sorry does that mean the current behavior of cargo or of the other package managers?

Referring to Cargo

SwishSwushPow:

epage:

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).

I think as seen for the pip example, it would be ok to go with a glob import pattern as well if license-file is not set? This way we could handle the license = "MIT OR Apache-2.0" situation as both license files would be included?

I would recommend not being so quick to dismiss when someone from the owning team says "we had a similar conversation and we didn't want to bake this in for that". We have no reason for README globs for includes because we already know the README. We already want similar for LICENSE files. To me, a strong reason would be needed to bypass this and have a glob for LICENSE files.

SwishSwushPow:

epage:

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.

I am not sure if the include field in .cargo/config.toml might work for that purpose or if we even want to utilize it in that way. Something I would need to have a look into. Otherwise I a missing the experience of past edition changes here, so suggestions are welcome.

The important part of my example was the idea of having editions control defaults, not where those defaults live.

Discussion in the ATmosphere

Loading comments...