27

Assume there is a library that is licensed under GPL. I want to use it is closed source project. I do following:

  1. Create small wrapper application around that GPL library that listens to socket, parse messages and call GPL library. Then returns results back.
  2. Release it's sources (to comply with GPL)
  3. Create client for this wrapper in my main application and don't release sources.

I know that this adds huge overhead compared to static/dynamic linking, but I am interested in theoretical way.

Andrey
  • 1,159
  • 2
  • 10
  • 14
  • 6
    The wrapper you write would be licensed under the GPL. Therefore the program using the wrapper would still be subject to the terms of the GPL for linking, etc. – TZHX Feb 21 '11 at 13:28
  • 4
    why not contact the author first and see if you can license it under LGPL or similar instead. – jk. Feb 21 '11 at 13:30
  • 8
    @TZHX I believe he means the wrapper would be a separate application that acts as a server - his proprietary code would be in the client – jk. Feb 21 '11 at 13:32
  • also who will the closed source app be distributed too? and which version of GPL is the license – jk. Feb 21 '11 at 13:32
  • @jk I totally agree that it is much better option. But my question is based on assumption that it is not possible for some reasons. – Andrey Feb 21 '11 at 13:52
  • @jk to clients (end users) – Andrey Feb 21 '11 at 13:52
  • @jk: under GPL the client would still need to be licensed under GPL if the server runs in-process with it. – jwenting Feb 22 '11 at 08:46
  • 2
    @jwenting the question clearly says it's running out of process – jk. Feb 22 '11 at 09:34

7 Answers7

35

Legally, I'd say it would be OK (but I am not a lawyer - consult a lawyer for legal advice).

Morally, it's pretty reprehensible. If you don't like the GPL, then the "proper" solution is not to use a GPL library.

Edit: To clarify, whatever the legal standing of the GPL with respect to whether dynamic linking is allowed or not, the LGPL was specifically created with the intent of allowing dynamic linking in the case of libraries. So it seems clear to me that by choosing the GPL over the LGPL, the author of the library was doing so explicitly to disallow dynamic linking. Using a technical means to work around a legal restriction that expresses the author's explicit intent for his code is what is reprehensible, in my opinion.

For the record, I'm not personally a fan of the GPL (I prefer a more permissive license such as MIT or BSD). However, I am a huge fan of respecting the work of other developers, and if they don't want you link their library with closed-source software, then that's prerogative.

Dean Harding
  • 19,871
  • 3
  • 51
  • 70
  • 13
    I don't think there is a moral problem here - the GPL seems to explicitly allow his use-case – jk. Feb 21 '11 at 14:03
  • sometimes GPL libraries are *low hanging fruits*, they are easy to get and hard to use (in order not to violate GPL). – Andrey Feb 21 '11 at 14:04
  • @jk well, I think it is not ok from moral side, it is definitely a GPL hack. By releasing under GPL author wants that derivatives are also open source. – Andrey Feb 21 '11 at 14:06
  • 2
    @Andrey, first of all program that just uses a lib is not derivate. Secondly why should you let GPL infect all of **your** code? Shouldn't the author have right to decide under what licence he releases **his own code**? – vartec Feb 21 '11 at 14:09
  • @Andrey so that depends on whether his actual app is a derivative work or not or just something that might use the library as a plugin - note his solution could effectively provide an open interface to plug in any derived library – jk. Feb 21 '11 at 14:11
  • 2
    @vartec are you sure that you understand GPL? Using lib in our code - both statically and dynamically linked is derivative. If you want to choose license for your code then don't mess with GPL, that's it. – Andrey Feb 21 '11 at 14:21
  • 2
    @Andrey: right, that why I choose **Open Source**. I don't like anybody to tell me what license I have to use for **my code**. And that why Stallman and his followers hate **Open Source**. – vartec Feb 21 '11 at 14:33
  • 1
    @Andrey: show me legal document stating, that dynamic linking is in fact creating a derived work. And tell me how it wold work in case of something, that is dynamically linked with Motif, thus can dynamically use closed-source (Motif), open-source (OpenMotif) and LGPL (LessTif). – vartec Feb 21 '11 at 14:37
  • 3
    @vartec here is quote from official GPL FAQ: "Linking statically or dynamically with other modules is making a combined work based on. Thus, the terms and conditions of the GNU General Public License cover the whole combination." If Stallman has different vision of what Open Source is, it doesn't meant that he hates it. He is one the main ideologist of this movement. – Andrey Feb 21 '11 at 14:54
  • 1
    @vartec it is fine that people give you right to use their work with conditions. Condition is release your code also. Otherwise you don't have right to use their code. Read this article to clarify http://lwn.net/Articles/61292/ – Andrey Feb 21 '11 at 14:57
  • 2
    @Andrey: I don't care what GPL FAQ says about it. Show me **legal document** which would state, that dynamic linking is not boundary to derived work. So far there has been only one court ruling on the subject and it's basically the oposite of what's FSF is saying: *In Galoob v. Nintendo the Ninth Circuit Court of Appeals defined a derivative work as having "'form' or permanence" and noted that "the infringing work must incorporate a portion of the copyrighted work in some form"* – vartec Feb 21 '11 at 14:58
  • 8
    @vartec: I get the impression that you do not understand that, when you use SOMEONE ELSE'S code in YOUR application, YOU are required to comply with the terms that HE put on use of HIS code. Don't like it? Don't use someone else's GPL'ed code. That simple. – John R. Strohm Feb 21 '11 at 14:59
  • 1
    @vartec I don't want to continue discussion in this tone. – Andrey Feb 21 '11 at 15:02
  • 1
    @John: someone else's code? what code? it's dynamically linked on end-users' computers. And BTW, if you don't want ppl to use your code -- just don't release it. As simple as that. If you do, don't complain that ppl actually take advantage of their lawful rights. – vartec Feb 21 '11 at 15:02
  • 2
    @Andrey: by "this tone" you mean talking about actual real-life **law** not Stallman's view of it? – vartec Feb 21 '11 at 15:04
  • @vartec by "this tone" I mean being rude. Everyone are free to have their own opinion. – Andrey Feb 21 '11 at 15:05
  • 1
    @Andrey: Sure, but we're talking about legal status, not about what's Stallman's opinion. In fact Stallman's opinion is totally irrelevant here. What counts here are opinions of judges and legislators. – vartec Feb 21 '11 at 15:08
  • 1
    @vartec I read about the case you refer to. It is also completely irrelevant to this topic. (But still is interesting). GPL states that "derivatives" are subject of GPL, but question is what is "derivative" in terms of software. There is no court case that gave clear answer to this question. – Andrey Feb 21 '11 at 15:12
  • @vartec Stallman's opition is relevant here, because he is coauthor of GPL and we are discussing GPL. Again, if you disagree with him doesn't mean that his opinion is neglectful. – Andrey Feb 21 '11 at 15:13
  • 2
    @Andrey: it is relevant. It states *"the infringing work must incorporate a portion of the copyrighted work in some form"* which is not the case with dynamic linking. There are prominent members of open-source community, who do not share Stallman's view on dynamic linking. Linus Torvalds is one example. Here's his opinion on subject: http://lkml.org/lkml/2006/12/17/79 – vartec Feb 21 '11 at 15:16
  • @vartec you should really read the article above (http://lwn.net/Articles/61292/) I can invent license called "Andrey's License" that will state: "If you statically or dynamically link to this code you must release your code, otherwise you can't use my code". And it will be pretty legit, because it is my code and it is my right to let other people use it on my conditions. Similar situation is with GPL also, but it is more vague then this imaginary "Andrey's License" – Andrey Feb 21 '11 at 15:21
  • 2
    @Andrey "And it will be pretty legit..." - not necessarily, it would have to be tested in court and all contracts have to be shown to be fair or lawful. For example, I can't release a licence that says you must rob a bank to use it, under those terms the licence is not legit, so you can't just put whatever you like in a licence. Or at least, you can but it might fail under test. Just saying. – ian Feb 21 '11 at 15:26
  • @Iain it will not be legit on first place because robbing bank is not legit. But releasing source is legit process. Well, from legal side you might be right, but from moral it is not. You really should respect author's conditions. Because alternative is very simple: don't use it. Find commercial alternative or free one with looser license. – Andrey Feb 21 '11 at 15:29
  • 1
    @Andrey: the fact that you write something down in the license, doesn't mean that it actually has any meaning. As I've said before, with dynamic linking it's end-user who's doing the actual linking. And it is possible to create alternative providing same ABI (as Motif/OpenMotif/Lesstif example clearly shows). The idea of DLLs is to have interchangeable libraries. – vartec Feb 21 '11 at 15:30
  • @vartec that's where I disagree with you. Respect to the author - that is what comes at first place for me. In that Linus' post distinction is very clear: derivation is not in the terms of static/dynamic linking, it is in terms of degree of dependency. If you just use lib as dll doesn't mean that you are actually independent. – Andrey Feb 21 '11 at 15:33
  • @vartec for example if having third party dll on local PC is a requirement for your application and there are no alternatives doesn't sound *independent*. – Andrey Feb 21 '11 at 15:36
  • 3
    Here is my suggestion: derive the hell out of that GPL code you seem so *dependent* on and see how the court case turns out. GPL3 was created to plug just such a legal holes in GPL2, so maybe you will get away with it. I doubt people will throw parades in your honor because you got away with a legal maneuver and if you are effective enough, people will license their code with more terms of use just to spite you. In the end, that might improve the world by avoiding threads like this one. – Godeke Feb 21 '11 at 15:44
  • 2
    @Andrey: but due to nature of dynamic linking, such alternatives may be created. BTW. let me give you example. Let say I have contacts management app. It's Open Source, and stores contacts in a wide choice od DB engines (MySQL, SQLite...). So let say they want add support for AndreyDB, which is GPL. It's clear that app can do without it. So should it be infected with GPL in this case? – vartec Feb 21 '11 at 16:03
  • 2
    @Godeke I don't even think that existence of GPL is making world any better, and people who "license their code with more terms of use" definitely don't make it better. If ever release any significant work for free I will use permissive license with mandatory attribution. – Andrey Feb 21 '11 at 16:04
  • @vartec you gave a very clear case of independence. In that case even using embedded db (where some sort of linking is required) can't be considered derivative. – Andrey Feb 21 '11 at 16:07
  • @vartec @Andrey Guys, it may be time to take this conversation to chat. – Adam Lear Feb 21 '11 at 16:08
  • 2
    As one who's been following GPL discussions.... This does not create a derivative work, and is therefore legal. Stallman is the ideological leader of the Free Software movement, not the similar-in-many-ways Open Source movement. Stallman's opinion on dynamic linking may be relevant, since he wrote the licenses, and courts are allowed to take the intent of licenses into account; moreover, if you need the license for some other reason (say, making copies), you may have to abide by the license definition. I'm deliberately not addressing morality or the value of the GPL here. – David Thornley Feb 21 '11 at 16:47
  • 2
    @vartec: Linus' post you linked doesn't support what you have said here in comments. For example: "So [either static or dynamic] 'linking' basically has very little to do with 'derived' per se." And: "anybody who thinks that copyright law cares about 'mkisofs' [or static linking] vs 'ld' [or dynamic linking] is just obviously misguided." – Fred Nurk Feb 21 '11 at 17:14
  • don't think linking of any kind is involved here. the question states the library is in a separate process. – jk. Feb 22 '11 at 17:59
  • 3
    @jk: That's right, but it's a separate process specifically to *avoid* linking (and therefore get around license restrictions on linking). That's the problem, IMO. – Dean Harding Feb 22 '11 at 22:23
  • 3
    I *STRONGLY* disagree with the claim that it's morally reprehensible. What's morally reprehensible is to tell people they have no right to do the things the GPL allows them to do. When I put a work under the GPL, I do so because I want the GPL's rules to apply. Telling people they should not exercise the rights the GPL gives them is reprehensible. This is something the GPL allows. Those who place works under the GPL do so because they *want* to allow this. – David Schwartz Aug 22 '11 at 13:17
  • 1
    @vartec: dynamic linking can involve the use of internal data structures and functions within your program. Basically if you have the "#include" a header file to build your code, it's a sign that it's not entirely independent. This could get murky if the header implements a standard (POSIX or OpenGL) interface. However for most cases, you'd be incorporating custom objects into the linked code. The OP solution of making a server IMHO gets around this. – phkahler Aug 22 '11 at 14:54
  • 2
    @DavidSchwartz - That is a very strange argument. You are basically arguing that if the law (in this case copyright law + the literal wording of the GPL) says it is OK to do something, then it is moral. Consider this example. A little old lady is stuck on a traffic island in the middle of a busy highway. You offer to escort her to safety for $100. This is certainly legal ... but does that make it moral? – Stephen C Oct 07 '12 at 12:26
  • 2
    @DavidSchwartz - The difference between legal and moral is that a moral decision needs to consider the context. And in this case, the context includes the *intent* of the designers of the GPL, and the *wishes* of the person who has made his software available under the GPL. Certainly, if it was my code I would not be happy for you to exploit loopholes in the GPL in order to achieve selfish ends. I would name such behaviour "immoral". – Stephen C Oct 07 '12 at 12:32
  • 1
    @StephenC: Copyright law is a delicate balance and gives the author specific rights. Every right society gives the author is one less right everyone else has. We have to live with that balance when it hurts us and I think it's only fair to take advantage of that balance when it benefits us. But I find very odd the argument that copyright law doesn't give authors enough power to restrict how others can use their works. I think most people would argue the reverse. – David Schwartz Oct 07 '12 at 22:24
  • 1
    I agree that this is morally reprehensible in pretty much all cases, but I can think of one (in my opinion, anyway) exception: if the software you're writing your "wrapper" for would have benefited from the latter regardless, and a lot of other, license-compatible software ends up using it (e.g. because linking isn't convenient). Of course whether this would happen is impossible to determine in advance and I can't think of a case where it would even be *likely* to happen, but I also can't completely rule it out. – smheidrich Jul 11 '18 at 20:38
7

See the I'd like to incorporate GPL-covered software in my proprietary system. Can I do this?

The question is, is your wrapper application any use on it's own? If you made a command line version of your program that was GPL you could release the GUI under a different license. For example you could make an IDE for gcc that was closed source or a visual diff tool based on diff.

However, if you wrapped up library has no use other than being used by your program, and you'd program has no use without this library, than it's a derived work and would need to be released under the GPL.

FigBug
  • 2,369
  • 3
  • 17
  • 20
  • My understanding is that you can can license the wrapper under MIT and still be OK. – Toaster Nov 23 '14 at 10:02
  • 2
    Colin, absolutely not. The wrapper is unambiguously combined with the GPL library into a single binary. To use GPL code within one binary, you must GPL your own code to comply with the license. – Concrete Gannet Nov 01 '16 at 23:23
  • @ConcreteGannet note that MIT is considered GPL-compatible. You can declare your source code is MIT, and compile your MIT source code + GPL library code -> GPL binary. You don't really gain anything by doing so, since the binary is still GPL. Also, someone may be able to argue in court that your wrapper source code is derivative of the library (and therefore must be GPL). – user253751 Feb 28 '21 at 13:49
  • @user253751 If you distribute a "GPL binary" you have the obligation to distribute the source code that was used to create it, including the wrapper. There's a good discussion of the consequences of the fact that MIT is GPL compatible here: https://softwareengineering.stackexchange.com/questions/204410/how-are-gpl-compatible-licenses-like-mit-usable-in-gpl-programs-without-being-su . In short, compatibility is one way. As you say, MIT + GPL = GPL. – Concrete Gannet Mar 02 '21 at 01:08
  • The OPs original goal was to escape the GPL obligations by packaging client code in a separate binary. Our focus here is just the wrapper that is compiled into the same binary. I don't think there's anything to hide! Sure, somebody could obtain my code in isolation and I could specify it's MIT or another GPL compatible licence. For my code to be useful to anybody, they need to obtain the library as well, and once they build the combo they would then be subject to the GPL. So my original point is *if you are distributing the binary result*, in effect you must GPL your own code. – Concrete Gannet Mar 02 '21 at 01:26
7

IMO, legally it's OK. (IANAL) To improve on the moral side of the issue, don't call it a "FooBar wrapper that makes FooBar legaly available to MyClosedApp", call it a server. Make it a nice little open source program that "allows to do FooBar over the net". Put it on SourceForge or dedicate a website to it, with project page and instructions and stuff. Then let "MyClosedApp" just use the "FooBar server".

user281377
  • 28,352
  • 5
  • 75
  • 130
6

IANAL but I believe you are ok, the relevant section of GPL3 is at the end of section 5:

A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.

This is probably going to depend on exactly what your 'client' does, mouviciel's answer is probably good guidance on how to do it safely

If you think your app is an extension of the library rather than something aggregated with it then you are probably right (you should be in a good place to know this) in which case your best bet is to contact the author and try to get a different license

this would seem to back my position that this is explicitly allowed by the GPL, assuming done properly.

jk.
  • 10,216
  • 1
  • 33
  • 43
  • I read it, but the problem is that GPL text is written in *legal* language, not in *development*. The trick with wrapper is to make commercial app "aggregate", not "derivative". But I think it falls under "nature extensions of the covered work". – Andrey Feb 21 '11 at 14:01
  • well for help on legal language you will need a lawyer. If you think your app is an extension of the library rather than something aggregated with it then you are probably right (you should be in a good place to know this) in which case your best bet is to contact the author and try to get a different license – jk. Feb 21 '11 at 14:07
  • 2
    @Andrey: If the "nature" of your program is directly tied to the GPL code, the section quoted above would not apply. From your question it sounds like that is the case. A counter example could be a network intrusion analysis program which just happens to use GNU readline through the mechanism you propose. (Readline is an interesting test case because there's a BSD-licensed drop-in alternative.) – Fred Nurk Feb 22 '11 at 22:32
  • The "aggregate" clause is to make it clear that being on the same CD-Rom or Linux distribution is not creating a derivative. – Sean McMillan Aug 31 '11 at 17:03
2

As far as I understand, you can leave your software closed-source as long as it is able to do its work without GPL library. See the GPL library as a plugin whose absence does not make your software useless.

mouviciel
  • 15,473
  • 1
  • 37
  • 64
  • 1
    that is definitely wrong. using it as plugin (aka dynamic linking) makes resulting application "derivative" and subject of GPL. – Andrey Feb 21 '11 at 14:02
  • I'm not sure plugin is always synonymous with dynamically linked. And certainly in this case the OP is not proposing dynamically linking anything so I think mouviciel's advice stands – jk. Feb 21 '11 at 14:24
  • @jk well, if you create only one plugin and it is based on GPL license this smells as violation. – Andrey Feb 21 '11 at 14:25
  • maybe, maybe not, bear in mind they still provide the framework for anyone to create a replacement for the GPL library. and if the specific license allows that (GPL 2 and 3 would imho, AGPL wouldn't) they are fine – jk. Feb 21 '11 at 14:43
  • 4
    The AGPL wouldn't forbid this unless the socket was over a network. It's fairly specific. Also, it's not a test of usefulness, but of how closely the GPLed and proprietary software are. Static linking is definitely too close, sockets (except for the specific AGPL case) are definitely OK, dynamic linking may or may not be (I've heard legal-sounding arguments on each side, and there's no US case law yet). – David Thornley Feb 21 '11 at 16:55
  • good point about the network - its not clear from the OP but it sounds like there wouldn't be a network involved – jk. Feb 21 '11 at 19:22
  • 1
    @Andrey: your initial statement is plain wrong. For example, Photoshop does not become subject to the GPL because someone writes a GPL plugin for it. – Doc Brown Nov 06 '16 at 19:03
  • @DocBrown that's not what I said. You reversed application-plugin relationship. It is about what is being distributed and by whom. If a third party distributes just their plugins then fine. If Adobe distributes PS with mandatory GPL plugins then it is GPL violation. If they distribute plugings with extra functionality separately then it is fine. – Andrey Nov 07 '16 at 10:11
  • 2
    @Andrey: so you are now saying as long as a closed-source software like Photoshop is able to do its work without a GPL component, one can distribute it without making it GPL. That is **exactly** what this answer tells. – Doc Brown Nov 07 '16 at 12:10
  • @DocBrown I wrote that comment 5 years ago and don't remember why I thought like that back at the time. GPL says that dynamic linking is not GPL-ok. Plugin is dynamic linking. It seems now to me that if your plugin infrastructure uses dynamic linking (it usually does) then yes it is a violation of GPL and using such plugin violates GPL https://www.gnu.org/licenses/gpl-faq.en.html#GPLStaticVsDynamic – Andrey Nov 07 '16 at 12:45
1
  1. try to find Open Source alternative, if there is none, go for the GPL one;
  2. check if it's GPLv3 with Affero clause if it is, there is nothing to be done;
  3. if it's GPLv2, you can do exactly as you suggest;

There is also somewhat controversial option. Under most legislatures dynamic linking should be boundary to "derived work". The logic behind this is, that while dynamically linking you're just including header files in your program. In many legislations header files are considered API definition and explicitly excluded from being copyrighted. On the other hand, with dynamic linking, actual linking with GPL library is done on end-user's system. But as I've said, there is lot of controversy with it, Stallman is strongly FUD-ing against this.

vartec
  • 20,760
  • 1
  • 52
  • 98
  • what is that difference between GPL v2 and v3 that makes my hack impossible? What I do it not dynamic linking, I decoupling them as much as possible. – Andrey Feb 21 '11 at 14:23
  • One of the goals of GPLv3 was to prevent that method of 'circumvention'. – vartec Feb 21 '11 at 14:25
  • 4
    First, the GPL variants are official, OSI-approved, Open Source licenses (much as the BSD license without advertising clause is a Stallman-approved Free Software license). Second, no GPL version (including Affero) restricts your ability to have GPLed and proprietary software communicate with standard inter-process communication methods, like sockets. – David Thornley Feb 21 '11 at 16:51
  • IMO GPLv3 allowing for example DRM clause violates point 6. of Open Source Definition http://opensource.org/docs/osd – vartec Feb 21 '11 at 23:45
  • 1
    @vartec: DRM is not a "Field of Endeavor". See the "For example, it may not restrict the program from being used in a [commercial venture], or from being used for genetic research." OSI apparently believes the GPL3 is Open Source and meets all points of their definition, because they approved it. – Thomas Edleson Feb 22 '11 at 14:53
  • @Thomas: disallowing DRM is restricting use in commercial ventures related to content distribution. Anyway, all these new clauses in GPLv3 are directed **against** ppl who actually use and contribute to Open-Source. Like TiVo or Google. Good thing that Linus will not allow Linux to be GPLv3. – vartec Feb 22 '11 at 15:31
0

Would it be legal for Adam Brown to write a program which used a GPL library and acted as a "server", if he released all the source code to everything associated with it, but the only client code he released was pretty feeble because that's all he'd written client-side? I see no basis whatsoever for thinking it wouldn't.

If Charles Dover found Adam Brown's "server" and decided to write a closed-source program to communicate with it, would the GPL constrain his actions in any way? Not that I can see, since his only usage of GPL'ed software would be as the binaries he received from Adam Brown. If he distributed Adam's binaries he'd have to include a link to the source as well, but nothing else in the GPL would affect any of Charles' code.

With regard to one person writing a GPL-licensed server, and then using the server for his own closed-source purposes, I wouldn't think there should be any legal problem if in writing the server he made a bona fide effort to make it useful to others who might wish to use the supplied GPL code in the same way. In particular, the publicly-released documentation of the interface should be sufficient to allow a competent programmer to either write code for a server which would be accepted by the client program just as the original would be, and to write client programs that would use the server in the same fashion as the author's application.

supercat
  • 8,335
  • 22
  • 28