-
Notifications
You must be signed in to change notification settings - Fork 611
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
Show licenses of crates on a per version basis #736
Comments
This seems like a good change to make. We don't wnat people to be mislead about what the licensing is if they're considering using an outdated version of a crate. |
Technically you can stop publishing old versions of the code under the old license. Anyone that already has the code under the old license (crates.io in this case) can continue to use the code (and re-publish if allowed by the license) under the old license. So, since the code has already been provided to crates.io under license terms that allow crates.io to re-publish the code under the given license we're fine, but in general you can change the license under which you publish existing code. This actually makes me wonder if crates.io should have some sort of "by publishing your code here you're giving us a perpetual license to re-publish your code" TOS, as far as I can see there's nothing stopping someone publishing a crate that lacks a license allowing crates.io to re-publish it. (I took a brief look at the crates.io footer, "Publishing on crates.io", "FAQ" and "Policies" docs pages and found nothing related to this.) |
@Nemo157 afaik you need to provide an open source license when uploading to crates.io. |
That was my assumption as well, but where is this enforced/mentioned at all? I just checked the source and it definitely allows non-open source licenses to be uploaded. As I mentioned above I could not find anything mentioned in the docs on crates.io itself. To make sure I just searched the source of both |
It should; it's been on my plate for a while but I have not gotten to it. |
I've added to the description a bunch of tasks that I think need to happen to complete this, and I've marked this issue medium because of all these tasks. I think each individual task should be fairly straightforward and E-easy though, and I'm happy to merge PRs that take care of one or a few of these tasks-- we can have the frontend keep using crate.license until the backend changes are complete. As always, please let me know if you are thinking about working on this and have questions! I will make sure PRs get linked to this and try to keep the checkboxes in the description up-to-date. |
Remove `license` column on `crates` table Seemingly the last step in the checklist on #736, this PR removes the `license` column on the `crates` table, and all references thereto. (In fact, I think #736 can be closed once this PR is merged.) As of #803, the front-end no longer really used this field, and the front-end was also changed to render the license of the _current_ version, instead of the value coming from this now-obsolete `license` column on the crate. Thus, this column likely contains stale data and, to my knowledge, isn't changed at all when a new version is uploaded. I wasn't sure what requirements are enforced for backwards-compatibility, or whether my changes here would actually affect behavior of e.g. if there are old versions of `cargo` that will upload with these values. I am happy for these changes to be scrutinized until this is verified to be safe.
Was this finished by #1815? (I didn't set it up to auto-close in case there were more things to get done, but that PR did remove the table.) |
Yep, I think this is done! Thank you everyone!!! 🎉 |
Follow up of #227.
Currently, crates.io maintains license information on a per crate basis. I'd propose to base it on the (crate, version) tuple instead.
The issue is that it might mislead people to believe that the license of a crate is something different from what it actually is.
Like for example, take someone creating a crate with portions of code from someone else, licensed under the MPL. Now assume this was the reason to license the remainder of the crate under the MPL as well, and version 0.1 is published as MPL. Now the author finds out that the functionality of that external code is already implemented by someone else on crates.io and removes it, adding a dependency instead. This allows the author to relicense under the more custom Apache2/MIT duo, which what the author then does, releasing version 0.2 of the crate under Apache2/MIT.
Now, take some user who for some reason thinks that version 0.1 is better than version 0.2 and wants to use it instead. The user looks at the crates.io page of the version of the crate, and sees its licensed under Apache2/MIT which is okay, while the MPL would be not okay for them. They then mistakenly use the 0.1 version without knowing its in fact MPL licensed!
Or take another case (inspired by the winehq story): Some person happily releases version after version of their crate under the Apache2/MIT license, until they discover that someone else took their crate, improved it and now sells the library in exchange for money. The author doesn't like that and decides to relicense the crate under the LGPL license, in order to be able to compete with the proprietary library (so that not every improvement can automatically be imported to the proprietary library). Now the future versions of the crate are LGPL licensed. Does that change the license of the old versions though? No it doesn't! Once you license some code under an open source license, it can be continued to be used under that license, even if you reconsider. Only changes you make to that code can be put under a new license. So crates.io saying that the older versions are LGPL as well might scare away users who would use that crate if it were Apache2/MIT licensed and can live with older versions.
Tasks
Ok so I (@carols10cents) think what needs to be done here is:
license
column to theversions
tablesrc/bin
that, for all currentcrates
. will copy the value ofcrate.license
to each of that crate'sversion.license
values to backfill that column for existing cratesNewCrate
andNewCrate.create_or_update
(here), pass license and license file toNewVersion::new
(here)NewCrate.validate
and callingvalidate_license
fromNewCrate.validate
, move thevalidate_license
method to be a private method onNewVersion
instead (in here), and callvalidate_license
fromNewVersion::new
. If the license/license file isn't valid, this should makeNewVersion::new
fail, which should make the crate publish fail.EncodableCrate
, return it as part ofEncodableVersion
crate.license
to, I think,currentVersion.license
(it might berequestedVersion
? I forget)I will happily accept PRs that complete parts of this, since we can just have the frontend continue to display the crate.license while this work is partially complete.
The text was updated successfully, but these errors were encountered: