Include the LICENSE in every crate#842
Conversation
The MIT license states: > The above copyright notice and this permission notice > shall be included in all copies or substantial portions > of the Software. Therefore the LICENSE files should be present in each crate directory, so they are included with `cargo publish`.
|
Currently, the LICENSE is only present in the workspace root and in Another option is to symlink the same file from the root to each directory, which does get dereferenced when publishing from |
hawkw
left a comment
There was a problem hiding this comment.
This looks good to me --- thanks for noticing and fixing this!
Another option is to symlink the same file from the root to each directory, which does get dereferenced when publishing from
unixhosts, but I think this has problems from Windows.
I think just duplicating it is fine — I don't think any tracing crate has been published from a Windows machine yet, but I'd rather not have to worry about it later if someone does end up publishing from Windows.
Do you happen to know if using the Cargo.toml license-file field with a relative path like
license-file = "../LICENSE"would result in the actual license file being included into every published crate? If so, that might be a slightly nicer option, but I'm not sure how Cargo handles this.
Ah, it looks like that is a feature since Cargo 1.43:
You get a warning if you have both fields: But crates.io calls it "non-standard" if you only have the file, like here on pretty-git-prompt. I'm not sure what it displays if you have both... edit: looks like "non-standard" only comes up when there's no |
|
Okay, thanks for looking into that. For now, I think just duplicating the license text is the best approach. I'm going to go ahead and merge this. |
Motivation
The MIT license states:
Solution
Therefore the LICENSE files should be present in each crate directory,
so they are included with
cargo publish.