GPL and virality

StefanKarpinski
Tue, 12 Dec 2017 18:22:22 +0000
Community

It’s often stated that the GPL is “viral” – i.e. that using GPL code “infects” other code. There is a viral effect for code that is not licensed under a GPL-compatible license, but not for code that is licensed under a GPL-compatible license like MIT or BSD.

First, a bit on how software licenses work: a software license is a legal document in which the copyright holder – typically the author of the code – gives someone the right to use or redistribute the software under certain conditions. If you violate those conditions, you don’t have a right to use or redistribute the code anymore and are therefore breaking the law if you do so.

The reason the GPL is “viral” for proprietary code is because one of the conditions of the GPL is that the source code of the entire “derived work” – i.e. the combination of GPL code and proprietary code – must be made available under the terms of the GPL. Otherwise, you lose the right to use the GPL code at all. Since you can’t, by definition, make proprietary code available as required by the GPL, you can’t comply with the terms of the GPL, so you don’t have a legal right to use the GPL part of the code (you still have as much right to use the proprietary part). You’re stuck: you can’t make the source of proprietary code public, but you’re not allowed to use the GPL code unless you do exactly that.

If we try to apply the same logic to a combination of MIT-licensed code and GPL code, the “viral” behavior vanishes: the license of the GPL requires that all the source of the combination be made available under the terms of the GPL – which is fine for the MIT part since it’s already open source under terms that are completely satisfactory according to the GPL. So there’s no problem: you can use and distribute the combined product under the terms of both the GPL and the MIT licenses – which is effectively the same as just the terms of the GPL.

In short, the GPL is only viral for code that is not already licensed in a GPL-compatible manner. There’s no problem with combining MIT (or BSD) code with GPL code and the license of that code does not need to change. Using or redistributing the combined product requires you to comply with both the GPL and the MIT licenses, but the MIT part of the code can remain MIT-licensed. Only if you start actually copying GPL code into an MIT project does is the license required to change since you’re actually deriving that source from GPL code.

Disclaimer: I am not a lawyer and this is not legal advice, just a hopefully helpful explanation of how software licenses work since many questions seem to come up around this.

40 posts - 12 participants