Cargo support for multiple license files?

Cargo supports the license-file key in Cargo.toml. However, it only supports one license file. Might it be worth allowing that key to accept an array of files as well? I’m working on a project right now where different parts of the code are covered by different licenses.

2 Likes

Cargo follows SPDX 2.1, which allows specifying multiple licenses.

https://spdx.org/spdx-specification-21-web-version

Ctrl-F “Representing Multiple Licenses”

Nevermind. You’re referring to license-file, not license.

For now, I’d suggest combining them into one license file, describing which parts of the code use which license.

It doesn’t seem unreasonable to allow an array, but I would suggest renaming it to license-files and making it mutually-exclusive with license-file, to avoid parsing incompatibilities with existing code that expects license-file to contain one file.

OK, sounds good. Posted an issue here.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.