gleam-lang / gleam

⭐️ A friendly language for building type-safe, scalable systems!
https://gleam.run
Apache License 2.0
16.7k stars 698 forks source link

Support specifying multiple license files and other text files for the Hex tarball #3040

Open PgBiel opened 2 months ago

PgBiel commented 2 months ago

Currently, we only upload a single LICENSE to Hex, as seen in the code below.

https://github.com/gleam-lang/gleam/blob/55a4e5881923e5679dde57cf950de389d6e04be4/compiler-cli/src/publish.rs#L414-L419

However, I have projects which are dual-licensed under MIT and Apache-2.0, so it would be nice to allow uploading LICENSE-* to Hex when publishing as well (in my case LICENSE-MIT and LICENSE-APACHE, exact naming might vary).

Not sure what's Hex's policy on this, but worth considering.

lpil commented 2 months ago

SPDX defines expressions for this. Does that work?

PgBiel commented 2 months ago

That's an improvement for sure! Though I think that might not be enough (to just upload the LICENSE with the SPDX expression), as MIT requires distribution of the full license file, apparently (so I'd upload LICENSE, LICENSE-MIT and LICENSE-APACHE). I am not a lawyer, however.

lpil commented 2 months ago

You could put them both in the same file, or in the readme, or in the code. I don't believe either states the manner in which you include them.

We could also have a feature for adding additional text files to the tarball.

PgBiel commented 2 months ago

You could put them both in the same file, or in the readme, or in the code. I don't believe either states the manner in which you include them.

Fair enough.

We could also have a feature for adding additional text files to the tarball.

This sounds like a good idea in general (I guess that'd avoid this kind of issue in the future, for the most part at least).

Could probably be in the form of an array in gleam.toml with additional relative paths to include.

lpil commented 2 months ago

Sounds good to me!