views:

281

answers:

6
+3  Q: 

Question on GPL

I'm starting to build a commercial application that uses an open-source library. I've been poring over various documents and postings, but I'm still having trouble. From what I understand I need to "isolate" the open source part. One way to do this is to provide a class which communicates with the open source through "vanilla" links.

The proposed solution is to modify the open-source (a command line utility) to give it some kind of API. Then develop an wrapper or proxy program that uses the API to communicate with the open-source program. Release the modified source and the wrapper as open source, but keep the rest of the source closed. Note that the open-source piece would be delivered with the code and executed either as a statically or dynamically linked library.

Does this work under GPL?

+4  A: 

No, if it's GPL and you link with it, your code becomes GPL too. If it's LGPL, things are different (you can build commercial apps linked against LGPL licensed libraries), but that appears not to be the case here.

anon
I was afraid of that (:
Jack BeNimble
The "No" is correct, but the rest is wrong. You can put any license you want on your own code. However, if you want to distrubte the result to someone else, it has to be a GPL-compatabile license.
T.E.D.
Did I suggest otherwise? And what do you mean by "GPL-compatible"? An example of such a license, please?
anon
IIRC (and don't assume this is right without checking), the BSD, MIT, and WTFPL licenses are all GPL-compatible.
rmeador
@ted.dennison, you have a point, but the OP likely intends to distribute the application. @Niel, I believe Affero GPL is GPL compatible but yes there are few of them.
jhs
@rmeador - no those licenses are certainly NOT GPL compatible (because nothing but the GPL is) - they are "Open Source" compatible.
anon
@jhs - interesting - I hadn;t come across it before - for others, it's a verbatim copy of the GPL with the addition of a strange (pointless as far as I can see) proviso regarding network use - the web page doesn't clearly explai.n why they think it's necessary
anon
"GPL compatible" means that a GPL program can use them (i.e. they have no restrictions beyond those of the GPL, although they can fewer, like BSD/MIT). You are right that anything that uses GPL code and is distributed must be distributed under the GPL.
ShreevatsaR
The GPL is viral.
X-Istence
The GNU project has a (non-exhaustive) list of GPL-compatable licenses at http://www.gnu.org/licenses/license-list.html#GPLCompatibleLicenses . If you don't know what this means, perhaps you should learn before writing on the subject?
T.E.D.
I'd suggest starting with http://www.gnu.org/licenses/gpl-faq.html, which has this link: http://www.gnu.org/licenses/gpl-faq.html#WhatDoesCompatMean
T.E.D.
@ted: I know what GPL-compatible is, as does Neil. Do you? Tip: http://www.gnu.org/licenses/gpl-faq.html#WhatDoesCompatMean Pay particular attention to paragraph 2.
R. Bemrose
Yes Bemrose, I see that part. You may want to reread what I wrote. I suspect you think I'm saying something which I'm not saying.
T.E.D.
As a general note, the length of this little argument over the minutia of the GPL is a good illustration of the kind of mess you step into if you try to find a way around it. Do not tread here without good legal advice.
T.E.D.
A: 

Before I start, I should say that I am not a lawyer, and this should not be considered as legal advice. If you need legal advice, you should hire an attorney.

As long as you are linking your program to the GPL'd software, your software is considered a derivative work of the GPL'd software.

If you wish to use a piece of GPL'd software, you should release your software under the GPL or a GPL-compatible license. Otherwise, you should find another piece of software that does what you need, or write it yourself. The point of the GPL is that the price of licensing it is that you also release your source code for your derivative work under a free software licence. If you would not consider using proprietary software without paying the appropriate licence fees, you should not use GPL

The only way in which you could isolate it would be by having an entirely separate executable, which communicated over a general-purpose interface (socket, pipe, or something), such that your software or the GPL'd software could be replaced easily. The interface that it communicates over needs to be very general-purpose; it cannot depend on implementation details of the GPL'd software, such as internal data layout or anything of the sort. Basically, if it communicates over a protocol that could be used as a general-purpose standard, then your software can talk to the GPL'd software without being considered a derivative work.

Anyhow, while it is possible to communicate with a piece of GPL'd software from proprietary software, you should not go out of your way to do so. You will be violating the spirit of the GPL, and would have to be very careful to make the interface general-purpose enough to not count as infringing. Instead, you should either find a piece of software with a different license that does what you need, write it yourself, or release your software under a GPL-compatible license.

edit: There is an interesting article posted on Linux Weekly News on this very topic. According the analysis in the article, even if you separate out an interface by which you can communicate with GPL'd software on the command line, you should do that as a clean room implementation with one group that works with the GPL'd code, one group that implements the other software, and all specs passing between them being filtered by lawyers. So, really, more trouble than it's worth.

Brian Campbell
I'm not sure I agree with you that this violates the spirit of the GPL. In fact, the FSF explicitly says in it's FAQ that if you wish to use GPL'd code from a non-GPL'd application, you should do so via a command line wrapper or similar. Of course they'd rather you not write closed source, but...
Mystere Man
+1  A: 

If you don't link against it, you are in the clear. So instead of developing an API for this open-source command line tool, just write a little wrapper that interacts with the program directly on the command line.

Since you are not linking, and now are just executing a binary your code will not have to be released under the GPL.

You may use fork, pipe, exec and friends to do this! It is a simple solution and depending on how the application expects its input on the command line it can work very well (curses based stuff is harder ... need a terminal of some sort)

Edit:

From the comments it sounds like even this is not valid, and could still cause issues. I suggest contacting a lawyer to make sure you are in the clear, he will be able to interpret the GPL and tell you what you may and may not do with GPL'ed code.

I would think that just executing an GPL'ed program and then sending it data (a.l.a. piping data into it) should not cause your program to also be GPL'ed.

the GPL is too complex, if I use a command line tool by executing it and piping data to it my program can still become GPL. That is just weird. Give me BSD, and or MIT anytime of day, way simpler to understand.

X-Istence
This does not guarantee that you are in the clear. If you need to be piping internal data structures to and from the separate application, then simply having it in a separate process does not mean that you have avoided creating a derivative work.
Brian Campbell
@Brian thank you for bring clarity to this. @jack, you are being given bad advice either by me or by my detractors :). I suggest you ask a lawyer, or the FSF or maybe SFLC. They probably still have a program where $100 gets you an email response from an actual FSF lawyer.
jhs
This is not true, see e.g. the story of clisp and readline.
ShreevatsaR
A: 

With GPL I think the only way out is to wrap it in something like a COM object (which would also need to be GPL or compatabile), and connect to the object at runtime. Since this keeps you from (staticly) linking with GPL code, you'd be off the hook.

That trick will work with GPL v2 code, but may not work with GPL v3.

T.E.D.
Dynamic linking is still linking. The heuristic I use is "sharing an execution context"... IANAL, YMMV, etc ad. nauseum
dmckee
It's not a settled question: http://gnuwin32.sourceforge.net/license.html
Matt Kane
True. I think I was trying to get at something else with the COM object though. That's actually one full step removed from what we even think of as "dynamic linking". What you are really doing there is invoking a separate program and communicating with it.
T.E.D.
+1  A: 

Do not believe people who talk about remote procedure call (COM) or standard IO. If there is anything to it at all, the standard IO thing comes from legacy situations like piping your output to grep and piping that into some other application.

Instead, think about it this way: Is your application a derived work from the GPL component? Could you explain, to a reasonably smart lay person, why your application is not a derivative of the open source library. You can explain stdio wrappers and COM interfaces until you're blue in the face but your lawyer, judge, customer, or whoever will not buy it. Instead you must show that removing that GPL library would not significantly modify the operation of your application. If you can't do that, well, sorry, but you're on thin ice.

jhs
GNU believes that standard IO is OK. See http://stackoverflow.com/questions/392395/a-gui-wrapper-around-a-gpl-cli-application-is-it-a-derivative/392452#392452
dmckee
That argument seems naive. For example, applications that call syscalls of the Linux OS are not considered derived works, but if you remove the OS, the application isn't going to work.
Mystere Man
Oh I'm sorry, I forgot judges know all about static vs. dynamic linking vs. standard IO. It's all about derivative works. A POSIX app can syscall into the Linux kernel all it wants and it's still not derived because the OS doesn't define the character of the program.
jhs
@dmckee Thanks for the pointer. That question's accepted answer agrees with me: a thin wrapper that puts a GUI over GPL code and does little else seems likely to be violating the GPL since it is clearly derivative.
jhs
@Mystere Man: Take it up with RMS. And/or look to the GLPv3, where they're put some thought into these kinds of issues (which I need to do, myself). Safest is to just not use Free parts if you want to distribute your stuff with a closed license, of course.
dmckee
@dmckee yes the good thing about free software is that even if you can't use it, at least it's easy to know where you stand! Avoiding it completely is an option but one can always get quick legal advice WRT these relatively short and well-known licenses.
jhs
@jhs: Agree to disagree, I guess. I don't think that the point has been tested in any jurisdiction, to date.
dmckee
Half-serious generalization question here: http://stackoverflow.com/questions/687053/should-i-ask-online-programming-communities-like-stack-overflow-for-licensing-adv
jhs
A: 

Be aware, there are as many different interpretations of the GPL as there are people, just about.

I am not a lawyer, but I have spoken with lawyers about this subject. This is not legal advice.

Some lawyers believe that dynamically linking against the GPL is ok, and does not constitute a derived work. Others, such as RMS and his lawyers believe that dynamic linking is not OK and does constitute a derived work. Most believe that static linking is a derived work.

There is a lot of argument on the subject, and there is no definitive case law that defines what is and isn't a derived work in this regard.

See, for example This Article

Mystere Man