16

Let's say I created a project containing hundreds of source files under the MIT License (most of which I wrote myself for this project). Now I want to add a GPL library to the project, that will be called from one of the source files ("File A"). A few other files call functions in "File A". The program is otherwise pretty indepedent of the library, meaning its core functions don't rely on it at all.

Since the library will be neatly packed into the executable, I'm pretty sure I have to make the whole project available under the terms of the GPL, which is fine because the MIT License is compatible with the GPL. So far so good.

What I don't quite understand is how it affects individual source files vs. the project as a whole. The GPL FAQ says about including a GPL library:

The software modules that link with the library may be under various GPL compatible licenses, but the work as a whole must be licensed under the GPL.

  • If I make the project available under GPL terms, then of course all parts of it are available under GPL terms (which they can be if they are under compatible licenses). But does that mean that all individual files "become" GPL (as in, add a GPL license header)? Is there a difference between individual code being licensed under GPL and the whole project being made available under GPL?
  • Do I have to put the file that directly communicates with the GPL library under GPL? And then put all files that are somehow connected to that one under GPL as well? Or can I keep them as MIT (as they've always been) and just make the whole project available under GPL?

To keep it simple, I would like to keep all my source code under MIT License and then put the whole project under GPL in a centralized notice. I'm just not sure if I'm approaching this correctly.

6

Firstly, IANAL/IANYL, and the question of what makes a derivative work in law is still very much an open one.

That said, you are right that the FSF explicitly permits the use of more relaxed (compatible) licences on your contributions to a GPLed codebase. You are also correct that the GPL requires that the derivative codebase be covered by the GPL in its entirety (eg, s5c GNU GPL v3).

I struggled with how this might work for a while, until I gave up and asked a barrister with a speciality in intellectual property law. His analysis, which is specific to England and Wales but might well find favour in comparable jurisdictions, was based on land law. In land law, you may purchase a number of adjacent lots, each with its own restrictive covenant, and group them into a single lot for sale, to which you apply a further restrictive covenant. Any given piece of land therein is now covered by the restrictions of both the covenant that applied to it individually and the covenant that you have applied to the whole package, so the future uses of any given piece of land therein must abide by all the applicable restrictions thereon. If a later purchaser were to split his purchase back into the original smaller lots, that would not magically remove the restrictions you had applied.

Similarly, when you convey the resulting codebase forth, later users of any part of it must abide by the conditions of both the GPL and MIT licences which covered it as they received it. But you may still continue to make your contributions available directly to them, and that conveyance may continue to be under MIT only, even though you were required to convey your modifications as part of a work under a blanket GPL. Anyone who liked your contributions and wished to use them under MIT-only could come to you for them.

Assuming that at any given time more than one licence may apply to a piece of code within a larger codebase, and that the restrictions of all relevant licences apply thereto, my feeling (and this is not qualified legal opinion) is that you should add a GPL declaration to each file so included, without disturbing the MIT declaration that was there. The presence of the former will warn later users that they can't strip this code out of the codebase and use it under MIT-only, but let them know that it is likely available from its original authors under MIT-only.

  • If a file mentions both the MIT and GPL licenses, then that looks like dual licensing to me, which means that I would be able to choose one of the two licenses. – Bart van Ingen Schenau Oct 4 '17 at 17:52
  • Personally I'd be hesitant in assuming that, particularly since it only makes any sense if you wish to choose MIT, and the GPL would clearly be the more recent of the two. But I agree it's not completely clear, so perhaps adding a line that says eg "(c) 2017 J Bloggs. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License in addition to the terms of any licences already herein identified" would clarify the issue. Again, just my opinion. – MadHatter Oct 5 '17 at 6:16
  • My concern now is what if someone creates a Pull Request. That person would have gotten the code under GPL+MIT, then created a derivative work. Can that person even offer that code back to the original project in a way that will allow others to use it under MIT, assuming they omit the GPL dependencies (for example by just using a single source file that has no direct connection with the GPL library)? – user2375667 Oct 9 '17 at 13:53
  • A pull request is a git thing, and has no particular meaning in copyright law; I'll assume that you mean "gets a copy". As I said, "If a later purchaser were to split his purchase back into the original smaller lots, that would not magically remove the restrictions you had applied". Anyone who gets the new, combined work (whether from you or not) cannot separate out the previously-MIT components to use under MIT. To do that, they would have to go back to the original authors of that part, and get a copy from them under MIT-only. Is that what you were asking about? – MadHatter Oct 9 '17 at 14:01
  • 2
    Then it's still simple. If you feel strongly that you want people to be able to work on your code under the MIT license, go to the effort of packaging it separately, so that people who want just the MIT parts can get them. Otherwise, don't, and the GPL will cover the combined package as discussed. – MadHatter Oct 12 '17 at 12:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.