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.

8
  • 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, 2011 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, 2011 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, 2011 at 13:32
  • also who will the closed source app be distributed too? and which version of GPL is the license
    – jk.
    Feb 21, 2011 at 13:32
  • 2
    @jwenting the question clearly says it's running out of process
    – jk.
    Feb 22, 2011 at 9:34

7 Answers 7

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.

41
  • 13
    I don't think there is a moral problem here - the GPL seems to explicitly allow his use-case
    – jk.
    Feb 21, 2011 at 14:03
  • 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, 2011 at 14:54
  • 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. Feb 21, 2011 at 14:59
  • 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, 2011 at 15:44
  • 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. Feb 22, 2011 at 22:23
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.

5
  • My understanding is that you can can license the wrapper under MIT and still be OK.
    – Toaster
    Nov 23, 2014 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. Nov 1, 2016 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, 2021 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: softwareengineering.stackexchange.com/questions/204410/… . In short, compatibility is one way. As you say, MIT + GPL = GPL. Mar 2, 2021 at 1: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. Mar 2, 2021 at 1: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".

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.

4
  • 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, 2011 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, 2011 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, 2011 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. Aug 31, 2011 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.

10
  • 1
    that is definitely wrong. using it as plugin (aka dynamic linking) makes resulting application "derivative" and subject of GPL.
    – Andrey
    Feb 21, 2011 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, 2011 at 14:24
  • 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). Feb 21, 2011 at 16:55
  • 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 6, 2016 at 19:03
  • 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 7, 2016 at 12:10
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.

6
  • 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, 2011 at 14:23
  • One of the goals of GPLv3 was to prevent that method of 'circumvention'.
    – vartec
    Feb 21, 2011 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. Feb 21, 2011 at 16:51
  • IMO GPLv3 allowing for example DRM clause violates point 6. of Open Source Definition opensource.org/docs/osd
    – vartec
    Feb 21, 2011 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. Feb 22, 2011 at 14:53
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.

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.