Skip to content

Include license and notice files in published crates - #266

Merged
Kriskras99 merged 2 commits into
apache:mainfrom
ankane:license-files
Aug 13, 2025
Merged

Kriskras99 merged 2 commits into
apache:mainfrom
ankane:license-files

Conversation

@ankane

@ankane ankane commented Aug 13, 2025

Copy link
Copy Markdown
Contributor

Hi, this PR symlinks LICENSE and NOTICE.txt so they're included in published crates.

@martin-g

Copy link
Copy Markdown
Member

Please do the same for the test helper crate too. Thank you!

@Kriskras99

Copy link
Copy Markdown
Contributor

Instead of doing symlinks, can't we just set it on the workspace Cargo.toml and do license.workspace = true?
I think that's better than a bunch of symlinks

@ankane

ankane commented Aug 13, 2025

Copy link
Copy Markdown
Contributor Author

@martin-g My bad, didn't realize that was a published crate.

@Kriskras99 I'm not sure that'll include it with cargo publish (but feel free to try it).

@Kriskras99

Copy link
Copy Markdown
Contributor

Just tested it, it does include the license file. But clippy doesn't like the fact there's both a license and license-file field:

warning: /home/kriskras99/Source/avro-rs/avro/Cargo.toml: only one of `license` or `license-file` is necessary
`license` should be used if the package license can be expressed with a standard SPDX expression.
`license-file` should be used if the package uses a non-standard license.
See https://doc.rust-lang.org/cargo/reference/manifest.html#the-license-and-license-file-fields for more information.

So is it even necessary to include the LICENSE file? The license is specified in the Cargo.toml.

@martin-g

Copy link
Copy Markdown
Member

So is it even necessary to include the LICENSE file? The license is specified in the Cargo.toml.

Yes. Apache Software Foundation rules mandate both LICENSE and NOTICE files to be part of the distribution.
This is valid for the source distributions and Rust crates are sources.

@Kriskras99

Kriskras99 commented Aug 13, 2025 •

Copy link
Copy Markdown
Contributor

Check, then I think this PR is the right way to do it. (We could only symlink NOTICE.txt and use license-file for LICENSE, but because it's a normal license it's better to use the license field.)

@ankane sorry for all the confusion.
@martin-g looking at https://infra.apache.org/licensing-howto.html it seems it's preferred if we rename NOTICE.txt to NOTICE, should we also do that? And there's a small grammar mistake in the NOTICE.txt file: donated to Apache Avro project at 2020. should be donated to the Apache Avro project in 2020.

@martin-g

Copy link
Copy Markdown
Member

I also think it would be better to use the licence field + LICENSE file!

Please rename NOTICE.txt to NOTICE and improve the grammar!

Thanks!

@Kriskras99
Kriskras99 merged commit b280351 into apache:main Aug 13, 2025
@Kriskras99

Copy link
Copy Markdown
Contributor

Thank you for the contribution, @ankane!

@ankane

ankane commented Aug 13, 2025

Copy link
Copy Markdown
Contributor Author

Thank you both!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants