-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
Problem
If you include both license and license-file in Cargo.toml, you get a warning:
cargo/src/cargo/util/toml/mod.rs
Lines 1311 to 1317 in aa68721
| if project.license_file.is_some() && project.license.is_some() { | |
| manifest.warnings_mut().add_warning( | |
| "only one of `license` or \ | |
| `license-file` is necessary" | |
| .to_string(), | |
| ); | |
| } |
However, crates.io doesn't know how to describe an arbitrary license-file, so it ends up being called "non-standard", which is rather poor for the user. Maybe this could be considered a crates.io issue, but I don't think they should be expected to guess what the SPDX license is from a file. When multiple files are supported (#5933), it really can't know whether that should be AND or OR.
For example, see the difference between pretty-git-prompt 0.2.0 and 0.2.1, which dropped the license field on cargo's recommendation.
Steps
- Add both
licenseandlicense-file $ cargo package
warning: only one of `license` or `license-file` is necessary- If published with just
license-file, crates.io calls the license "non-standard".
Possible Solution(s)
I think maybe it should be a warning if only license-file is present, since license is better for providing SPDX to show on crates.io.
Notes
Output of cargo version:
cargo 1.46.0-nightly (43cf77395 2020-07-13)
And that warning is still on master as of aa68721, as linked above.