Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing errors of a new project does not make it clear that non-OSI-approved license may be used #3540

Closed
nagisa opened this issue Jan 14, 2017 · 3 comments · Fixed by rust-lang/crates.io#6545

Comments

@nagisa
Copy link
Member

nagisa commented Jan 14, 2017

$ cargo new banana
     Created library `banana` project
$ cargo publish
    Updating registry `https://github.com/rust-lang/crates.io-index`
warning: manifest has no description, license, license-file, documentation, homepage or repository.
...
error: api errors: missing or empty metadata fields: description, license. Please see http://doc.crates.io/manifest.html#package-metadata for how to upload metadata
# add
# description = "this is a banana"
# license = "TBA"
$ cargo publish
    Updating registry `https://github.com/rust-lang/crates.io-index`
warning: manifest has no documentation, homepage or repository.
…
error: api errors: unknown license or other term: TBA; see http://opensource.org/licenses for options, and http://spdx.org/licenses/ for their identifiers
# From the error above assume non-OSI license cannot be used T_T

The errors should make it clear what all the alternatives/valid values are. For example nowhere it is stated (other than in documentation), that license = "custom" is a valid option.

@nagisa
Copy link
Member Author

nagisa commented Jan 14, 2017

A bit unrelatedly, the errors from the API should probably not exposed verbatim.

Please see http://doc.crates.io/manifest.html#package-metadata for how to upload metadata

for example is very irrelevant to a cargo user.

@steveklabnik
Copy link
Member

that license = "custom" is a valid option.

To be clear, it's not; you use license-file and point to a file locally instead.

@ehuss
Copy link
Contributor

ehuss commented Oct 10, 2023

I'm going to close as this is effectively solved by rust-lang/crates.io#6545.

I don't know if cargo should be validating license expressions itself so that you can get earlier feedback, and to ensure there is consistency for all kinds of dependencies. However, there are downsides to doing validation in cargo, so that seems a bit up in the air.

@ehuss ehuss closed this as completed Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants