TrueLayer / reqwest-middleware

Wrapper around reqwest to allow for client middleware chains.
Apache License 2.0
257 stars 78 forks source link

Fix missing LICENSE-* files in released crates #147

Closed musicinmybrain closed 5 months ago

musicinmybrain commented 5 months ago

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.

tl-eirik-albrigtsen commented 5 months ago

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 commented 5 months ago

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 https://github.com/rust-lang/cargo/issues/5933 seem to say that this is not currently supported.

tl-eirik-albrigtsen commented 5 months ago

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 commented 5 months ago

CI test unrelated, merging this.

musicinmybrain commented 5 months ago

Great! Thanks for reviewing this PR.