RFC: Make the authors field optional必須でない
- Feature Name:
optional_authors_field
- Start Date: 2021-01-07
- RFC PR: rust-lang/rfcs#3052
- Rust Issue: rust-lang/rust#83227
Summary
This RFC proposes to make the package.authors
field of Cargo.toml
optional.
Motivation
The crates.io registry does not allowCargo.toml
's package.authors
field.
This is especially problematic when people change their name or want to remove their name from the Internet, and the crates.io team doesn't have any way to address that at the moment except for deleting the affected crates or versions altogether. We don't do that lightly, but there were a few cases where we were forced to do so.
The contents of the field also tend to scale
Guide-level explanation
crates.io will allowpackage.authors
field, and it will stop showing the contents of the field in its UI (the current owners will still be shown). docs.rs will also replace that data with the crate owners.
cargo init
will stop pre-populating the field when running the command, and it will not include the field at all in the default Cargo.toml
. Crate authors will still be able to manually include the field before publishing if they so choose.
Crates that currently rely on the field being presentCARGO_PKG_AUTHORS
environmentenv!
macro to option_env!
).
Reference-level explanation
The implementation
Cargo
Cargo will stop fetching the current user's name and email address when running cargo init
, and it will not include the field in the default template for Cargo.toml
.
crates.io
crates.io will allow
The API will continue returning the authors
field in every endpoint which currently includes it, but the field will always be empty
docs.rs
docs.rs will replace the authors with the current owners in its UI.
Drawbacks
Cargo currently providesCARGO_PKG_AUTHORS
, and some crates (such as clap
) use this information. Making the authors field optional
This RFC will make it harder for third-party tools to query the author information of crates published to crates.io.
By design,
Rationale and alternatives代わりのもの、選択肢
This RFC reduces the problems related to changing the names in the authors field significantly,
We could do nothing, but that would increase the support load of the crates.io team and would result
Prior art
- JavaScript:
package.json
has an optional必須でないauthors
field, but it's not required and the interactivenpm init
command does not prepopulate the field, leaving it empty空のby default. The npm Web UI does not show the contents of the field. - Python:
setup.py
does not require theauthors
field. The PyPI Web UI shows its contents when present.ある - Ruby:
*.gemspec
requires theauthors
field, and the RubyGems Web UI shows its contents. - PHP:
composer.json
has an optional必須でないauthors
field. While it's not required, the interactivecomposer init
command allows許可する、可能にするyou to choose whether to pre-populate it based基となる、基底(の)on the current environment環境or skip it. The Packagist Web UI does not show the contents of the field.
Unresolved questions
- What should we do about the metadata in already published crates?
Future possibilities
The package.authors
field could be deprecated and removed in a future edition.
A future RFC could propose separatingCargo.toml
and the crate tarball, allowing