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

Fix missing LICENSE-* files in released crates #147

Merged

Conversation

musicinmybrain
Copy link
Contributor

This PR adds symbolic links to the top-level LICENSE-MIT/LICENSE-APACHE files in all three crates (reqwest-middleware, reqwest-retry, and reqwest-tracing), which ensures that these license files appear in the published crates as required by the chosen license terms.

Before this PR, using reqwest-retry as an example:

gh repo clone TrueLayer/reqwest-middleware
cd reqwest-middleware/reqwest-retry
cargo publish --dry-run
tar -tzvf ../target/package/reqwest-retry-0.5.0.crate

(no license file appears in the output)

After this PR:

[…]
-rw-r--r-- 0/0            9723 2006-07-23 21:21 reqwest-retry-0.5.0/LICENSE-APACHE
-rw-r--r-- 0/0            1066 2006-07-23 21:21 reqwest-retry-0.5.0/LICENSE-MIT
[…]

Note that the symbolic links are resolved by cargo publish, and regular files appear in the crates.

A follow-up commit in this PR adds a changelog entry.

@musicinmybrain musicinmybrain requested a review from a team as a code owner April 24, 2024 15:34
@tl-eirik-albrigtsen
Copy link
Contributor

I think this is a good change, but I think we can avoid creating the symlinks using cargo package properties: https://doc.rust-lang.org/cargo/reference/workspaces.html#the-package-table

@musicinmybrain
Copy link
Contributor Author

I think this is a good change, but I think we can avoid creating the symlinks using cargo package properties: https://doc.rust-lang.org/cargo/reference/workspaces.html#the-package-table

Do you know a way to configure multiple license files? The linked documentation and rust-lang/cargo#5933 seem to say that this is not currently supported.

@tl-eirik-albrigtsen
Copy link
Contributor

Oh, apologies, I was under the impression we had a license file specified, and wanted to make that work in multiple workspace crates, but we actually have a license field specifying license = "MIT OR Apache-2.0". In this case I guess my idea will not work 🙃

Your solution is good. Thank you!

@tl-eirik-albrigtsen
Copy link
Contributor

CI test unrelated, merging this.

@tl-eirik-albrigtsen tl-eirik-albrigtsen merged commit 1954b5c into TrueLayer:main Apr 26, 2024
12 of 13 checks passed
@musicinmybrain
Copy link
Contributor Author

Great! Thanks for reviewing this PR.

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

Successfully merging this pull request may close these issues.

2 participants