-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
When working with multiple Rust projects, some private and some public, it can be frustrating to remember where each package needs to be published. Currently, cargo publish defaults to crates.io. This is a great default for public packages that will be used across the community. However, many companies want to use private Rust packages for writing internal tools/libraries.
Currently, Cargo.toml supports the lib.publish field to limit publishing to one or more registries. This prevents cargo from publishing private packages to crates.io, which is a great feature. I propose a slight augmentation to cargo publish's default behavior. If Cargo.toml's lib.publish field contains a single registry, then cargo publish should default to publishing to this registry. This makes the default publish command cargo publish for every package, no matter where it's being published to.
The "single value" limitation could also be lifted, and cargo publish could publish to every registry defined in the lib.publish field, but that seems like more of a surprise than this.