sstadick / cargo-bundle-licenses

Generate a THIRDPARTY file with all licenses in a cargo project.
Apache License 2.0
90 stars 6 forks source link

Include licenses for Rust standard library #24

Open jwodder opened 1 year ago

jwodder commented 1 year ago

Third-party crates aren't a Rust program's only dependencies; compiled Rust binaries also link with the std or core crate, both of which are dual-licensed under MIT and Apache 2.0, and thus their licenses need to be bundled as well. See https://github.com/rust-lang/rust/issues/67014 for more information.

sstadick commented 1 year ago

Great point that I wouldn't have considered. That's not too hard to always add a core license I suppose, but we'd need to detect if something is no-std, which seems trickier? Leaving this as an open enhancement for now.

BatmanAoD commented 1 week ago

As a stop-gap, could the tool just manually copy over any top-level entries in the --previous file that it doesn't recognize (i.e. anything other than root_name and third_party_libraries)? This would allow users to manually add something like:

rust:
- package_name: std
  package_version: 1.82.0
  repository: https://github.com/rust-lang/rust
  license: MIT OR Apache-2.0
...