-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
cargo vendor
does not include license-file if not in package list
#9575
Comments
Can you maybe clarify with an example? The license-file should be packaged: [package]
name = "foo"
version = "0.1.0"
edition = "2018"
license-file = "../../LICENSE-MIT"
|
@dminor should be able to! |
Yes, sorry, you're quite right, packaging is working just fine, I'm just not seeing the license file after running I'm testing with the Do we need to do something different with the package configuration for |
Nah, it's just an issue with It may be tricky to fix, since |
cargo vendor
does not include license-file if not in package list
Could it be solved with |
If you mean, could |
Ah, so maybe I don't understand how |
Yea. It starts with the packaged zip file, but then uses the |
Perhaps we can explicitly include the LICENSE key? It seems pretty important to not drop that. |
Yea, that would probably be the best fix. As mentioned above, there are some links there if someone is interested into digging into it. I'm a little uncomfortable duplicating that logic in multiple places, but it can't be put directly into |
@ehuss isn't it a local path once it's in the package? |
Sort of. Packages published prior to 1.43 won't have rewritten paths or included license-files, so it would need to handle that.
So, some options I can think of:
None of these options sound good, but the last seems possibly better now that I've written them out. |
Personally I was assuming that #3 is already what happens before learning about the implementation from this thread 😄 |
Based on Fuchsia requirements (see gfx-rs/wgpu#2561), It would help if cargo vendor was including a license file in the package even if |
Describe the problem you are trying to solve
Mono-repos usually have a single
LICENSE
file in the top directory and they reference it from all crates via somelicense-file = "../../LICENSE"
.At the moment, cargo will not package file from such path.
Since the license file needs to be packaged into the crate for it to be able to be vendored in into other projects.
We encountered that problem when trying to vendor in ICU4X (rust mono repo) into Firefox.
In order to comply with the vendor policy of Mozilla, we need to duplicate the
LICENSE
file to each component of the mono repo and introduce a maintenance script to ensure the licenses stay in sync.See the issue, and the PR.
Describe the solution you'd like
It would help such projects if files referenced in
Cargo.toml
were packaged even if they live in the parent directory to the crate root.The file could be copied to the root directory of the package.
Notes
If that's impossible, I'd at least suggest displaying a warning that cargo skips packaging of the file.
The text was updated successfully, but these errors were encountered: