plato icon indicating copy to clipboard operation
plato copied to clipboard

Consider switching license to GPL

Open jtracey opened this issue 5 years ago • 14 comments

The license was switched from MIT to AGPL in 49ab484fc25c2ca1e4a0e9c2bba4f1491266ff82 to accommodate the AGPL license of Mupdf. However, since the project is only linking to Mupdf, and not modifying it, the GPL is also an option, since there is an explicit exception carved out in both the AGPL and GPL to allow linking projects under the other license. Given that there isn't a lot of server-side code here, which is what most AGPL code is, it might prove useful to have this under the more common GPL. Specifically, it would allow stealing code from other GPL projects, or porting GPL code to rust for the purposes of this project (GPL code in an AGPL code base is not allowed, other than the linking exception). It also just makes it a more commonly accepted license (e.g., my understanding is Google employees aren't allowed to touch AGPL projects).

Given the size and intended use of the project, this isn't a huge deal, just something I figured was worth discussing.

jtracey avatar Aug 27 '20 16:08 jtracey

However, since the project is only linking to Mupdf, and not modifying it,

I'm applying a patch thirdparty/mupdf/kobo.patch though, when building the ARM binary, is this allowed?

the GPL is also an option, since there is an explicit exception carved out in both the AGPL and GPL to allow linking projects under the other license.

I'd be glad to switch to the GPL. Can you provide some excerpts from the AGPL that support your assertion?

baskerville avatar Aug 27 '20 18:08 baskerville

I'm applying a patch thirdparty/mupdf/kobo.patch though, when building the ARM binary, is this allowed?

My guess is Makefiles aren't generally considered part of the code being protected, but worst case, that specific patch file would be AGPL.

I'd be glad to switch to the GPL. Can you provide some excerpts from the AGPL that support your assertion?

Sure, here's the relevant text from section 13 of the AGPL itself:

Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License.

And a less-legalese quote from the FSF:

Both the ordinary GNU GPL, version 3, and the GNU Affero GPL have text allowing you to link together modules under these two licenses in one program.

jtracey avatar Aug 27 '20 19:08 jtracey

@welps Any thoughts on this?

baskerville avatar Aug 27 '20 19:08 baskerville

Two points to make here:

  • The benefit asserted here is that we would be able to copy code from GPL licensed projects, but given that AGPL is more restrictive than GPL, it doesn't make sense that we wouldn't be able to do this already.

    The GNU license FAQ has a section on compatibility that explicitly covers copying code.

    A compatibility matrix is presented below the following statement:

    Each place that the matrix states GPLv3, the same statement about compatibility is true for AGPLv3 as well.

    image

    We see that the result of copying code is covered under the term "Combination" in the matrix for the newer licenses.

    If we revisit Section 13, we see that there are two cases covered when dealing with work licensed under the GPL (emphasis mine):

    Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU General Public License into a single combined work, and to convey the resulting work.

  • koreader is licensed under AGPL and there are contributors that have/might contribute similar code when dealing with kobo devices (like recently #133). It would create potential issues to adopt GPL as the copying/linking clause does not go the other way since it would allow people to circumvent the more restrictive license.

welps avatar Aug 27 '20 23:08 welps

Your first point is incorrect. The terms of the license expressly state that when combining,

The terms of this License will continue to apply to the part which is the covered work, but the work with which it is combined will remain governed by version 3 of the GNU General Public License.

I.e., you can't just reclience GPL code as AGPL, only the combined project itself. (Hence why the FSF refers to it as "text allowing you to link together modules under these two licenses in one program", not text that allows you to combine it arbitrarily.) The comment about the AGPL compatibility being the same is saying that that any license compatible with the GPL is also compatible with the AGPL, not that the GPL is compatible with the AGPL (again, other than the linking exception). You will not find any FSF statements saying you can directly copy GPL code into AGPL code bases, because legally, unless you get explicit permission to license it as such, you can't.

Your second point is understandable though; if there are specific projects that are AGPL you might likely take code from in the future, AGPL is the better choice.

jtracey avatar Aug 28 '20 00:08 jtracey

Yes, I believe you are right. If we read the license by itself in a textualist way, we reach the conclusion you've made. It's my mistake to try to reconcile it through another source. They could have certainly expanded the compatibility matrix to make this less ambiguous though!

Additionally, the Various Licenses page supports this in a more plain manner:

Please note that the GNU AGPL is not compatible with GPLv2. It is also technically not compatible with GPLv3 in a strict sense: you cannot take code released under the GNU AGPL and convey or modify it however you like under the terms of GPLv3, or vice versa. However, you are allowed to combine separate modules or source files released under both of those licenses in a single project, which will provide many programmers with all the permission they need to make the programs they want. See section 13 of both licenses for details.

However, what's pretty funky though is if you have GPL licensed code link to AGPL licensed code, the special requirements of the AGPL section 13 network clause applies to the combination which ties to your point about Google not touching AGPL (or linking!)

  1. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.

welps avatar Aug 28 '20 03:08 welps

  • koreader is licensed under AGPL and there are contributors that have/might contribute similar code when dealing with kobo devices (like recently #133). It would create potential issues to adopt GPL as the copying/linking clause does not go the other way since it would allow people to circumvent the more restrictive license.

Would it be fine if both projects switched to the GPL?

I'm going to give the opportunity to @NiLuJe, @poire-z and @Frenzie to chime in.

baskerville avatar Aug 28 '20 09:08 baskerville

Yes, I don't have any actual objection if koreader is able to switch.

If we switch, the mupdf modification should be broken out into a separate repo so it remains AGPL. Unless this is addressed directly somewhere, I think it's the safest option without having to get legal consultation. This would safeguard against accidental violations if patching extends into source code in the future.

welps avatar Aug 28 '20 10:08 welps

The GPL compatibility matrix makes my brain hurt.

But, yeah, if it turns out the MuPDF thing isn't an issue in practice, GPLv3 makes sense.

NiLuJe avatar Aug 28 '20 10:08 NiLuJe

None of us were involved in that decision, see https://github.com/koreader/koreader/issues/295 for discussion. https://github.com/koreader/koreader-base as a rendering backend is pretty server-friendly though, so the general rationale for AGPL would seem to apply.

Frenzie avatar Aug 28 '20 10:08 Frenzie

But the mentioned modification was for the frontend, where I doubt it matters in any practical or theoretical sense.

Frenzie avatar Aug 28 '20 10:08 Frenzie

Okay, thanks for digging that up, @Frenzie, I had a vague memory that we used to link to it statically, which is what colored my understanding of the need to switch at the time ;).

(Turns out it's possibly irrelevant anyway? >_<").

NiLuJe avatar Aug 28 '20 10:08 NiLuJe

That doesn't change the fact that it's one of the weird GPL metamorphosis cases where the source might be GPLv3, but the binaries (or "the combined work") will be AGPL because MuPDF ;).

NiLuJe avatar Aug 28 '20 10:08 NiLuJe

Would there be any benefit right now for switching to GPL? If not, I'd vote for sticking to AGPL. Besides, AGPL > GPL ;^)

ErikPrantare avatar Mar 15 '21 18:03 ErikPrantare