views:

547

answers:

4

Hello. I've read existing questions about this topic on here already, but none of them seem to address my question so far.

Here is the situation:

  • We are developing a closed-source/proprietary software for a few customers.
  • Our software is written in C++ and uses Qt 4.6, thus it makes use of the LGPL licensed version of Qt.
  • The software should allow third party developers to develop plugins for our application.
  • For this, we'd like to provide a simple plugin API, and a small SDK which is licensed under the GPL, or a BSD-like license. This SDK would contain some header files which allow for implementation of the plugin's hook methods.
  • These plugins extend the main program, but no parts of the main program rely critically on any GPL plugins (additional file formats, codecs, etc.).
  • Plugins might come from any developers, the SDK is available to anyone who uses our software, so we can't control who creates plugins, or which functionality they provide.

Here is the question:

  1. Are plugins considered to be dynamically linked against the main program?
    • Since they are loaded at runtime of the main program and are usually installed by the users, we are not doing anything wrong since we don't include those plugins in the main distribution.
  2. Since plugins can make use of any GPL'ed 3rd party library, such as libpoppler, for instance, they [the plugins] will have to be released under the GPL, too. Would usage of those plugins violate the GPL?
    • If yes, who violates the GPL? We, as as the author of the main program, or the authors of the plugin?

I don't expect a bulletproof answer here (that's what lawyers are for). If someone with some experience in working with the GPL and licensing could point me to the right directions, that would be very helpful.

PS: I already mailed [email protected], but didn't get a reply yet (that was 3 days ago).


Update:

After some more searching, I found the following links in the GPL FAQ (duh!):

A: 

Here is my understanding. When you distribute a GPL'ed plugin, you (as the author of the plugin) will violate GPL. Dynamical linkage is a way of creating a derivative work. So your plugin will be a derivative work for both your proprietary core and GPL'ed libraries. Since your core is closed source, you (as the author of the plugin) can not satisfy requirement of GPL to distribute all associated source code.

Denis Krjuchkov
How does the author of the plugin violate the GPL? He's not shipping the main program dynamically linked with the plugin (and thus with the GPL'ed library). The plugin *could* possibly implement an abstract API (like browser plugins) that works with different main programs, which in turn might be GPL.So the actual user of the main program would be the one who dynamically links them together, since he decided to install and load the plugin...?
BastiBense
To be clear, are you saying that no one can legally distribute a plugin which uses GPL code because they cannot release the source the the application (which they don't own) and that releasing the source to the plugin is not enough to satisfy the GPL?Not agreeing/disagreeing, just trying to say it in different words.
Dolphin
@Dolphin: That would make so many plugins for lots of closed-source applications illegal.
BastiBense
Let me clarify. You can write GPL-licensed plugin for closed source program, because you (as the owner of copyright of your plugin) can give users a special GPL exception (i.e. extra rights) to link your plugin with a proprietary program. You can do this, when you are solely owning copyright for the plugin. In your case (plugin uses a GPL'ed library) you can not do so because the library code isn't copyrighted by you.
Denis Krjuchkov
That would imply that loading a plugin into a host application is considered to be dynamic linking. Is that so?Also that would mean that you can't execute any GPL'ed applications on any proprietary operating system, since launching an application on Windows, for instance, would require the application to call system library functions - and those are definitely not GPL.
BastiBense
You can execute GPL'ed applications on Windows. GPL contains a definition for "System Libraries", these are the libraries, that can be safely linked with GPL'ed programs. For examples, standard windows libraries fall into this category. I guess, the GPL FAQ will cover most of your questions.
Denis Krjuchkov
@Denis: my understanding is that the GPL doesn't restrict what you can do with code you use under it. It only restricts how you can redistribute that code. So I don't think anyone needs any extra rights to link my GPL plugin to proprietary code. They can do what the heck they like with it in their own home, that's the whole point of free software. They just can't distribute it, or derivative works, without satisfying the conditions.
Steve Jessop
@Denis, again: I thought the "system library" exception was to do with static linking, not dynamic linking. That is, the exception is there in order to permit GNU to distribute GIMP binaries for Windows, even though that binary contains proprietary code pulled in from the windows "system libraries", which GNU is legally unable to distribute source for.
Steve Jessop
@Steve, Surely it is all about distributing, but sometimes distributing is illegal. If plugin-that-uses-gpl-ed-library is somewhat standalone, it's ok. But when such plugin distributed with purpose of extending propritary app, I guess this is not ok.
Denis Krjuchkov
Could be. I don't claim to understand the GPL, despite having read several versions of it several times. I also don't really understand its purpose, what it's trying to allow and prevent in terms of binaries. In relation to source distribution it's much easier to understand, but sadly most users aren't quite up to accepting a source-only distribution of an application. I tried compiling LAME on cygwin once, it ran about half speed compared with the binary distribution. I'm sure with time and effort I could have manually interfered with the configuration, but who can be bothered?
Steve Jessop
I think Denis is correct. Of course you could incorporate an LGPL library and then release the plugin under any license as long as you include source code for the LGPL components and any modifications to those libraries.
Ben Voigt
After some more searching, I stumbled across this:http://www.gnu.org/licenses/gpl-faq.html#GPLAndPluginshttp://www.gnu.org/licenses/gpl-faq.html#GPLPluginsInNF
BastiBense
+2  A: 

I don't think it has been determined by a court in any jurisdiction when (if ever) dynamic linking creates a derivative work. The GNU project and FSF have their opinion, but it's not their decision. So it probably also hasn't been determined who creates that work - the author of the executable, the author of the library, or the user.

The FSF has an interest here, which is that it wants all software to be GPL, or at least GPL-compatible. It might be too optimistic in its expectation that a court will agree with its interpretations. This is natural: if everyone made the same predictions, then nobody would ever go to court.

The FSF basically says that if code links against a GPL dynamic library, then the code must have a GPL-compatible license. I don't think this explicitly addresses your point, but even so it seems a little odd to me. When you create and distribute your proprietary code, you have no way of knowing the licensing of the dynamic library it will be linked against. You know the licensing of any headers you used, and the API the library implements. Plugins generally don't even need much of a header, if any, to define the interface.

So for all you know or can control, your code could be linked against a closed source or a GPL or a public domain implementation of some specified plugin or library API. For instance when you distribute a Windows executable, you don't know whether it will be linked against Windows, or WINE (LGPL), or some hypothetical full GPL version of WINE which I'm going to write tomorrow. When you distribute an executable intended for Linux, you don't know that I won't write a proprietary "LINE" that implements the whole of GNU/Linux. Of course, you do have a strong hunch that no such LINE exists already, and that could be legally relevant.

So, if you distribute code which will be dynamically linked against GPL code, I personally don't see how you've created a derivative work of a GPL work, no matter how many function calls are made in each direction, or what data structures are shared. As long as the binary you distribute doesn't have any GPL-derived code in it, what's the derivative work you're allegedly distributing? The users might create such a derivative work, but they're entitled to, because they aren't distributing it, merely creating it transiently on their machines. What are the FSF going to do you for, contributory copyright infringement because you allowed users to bind against a GPL library, rather than a public domain one with the same API? If when you released it, it was intended to bind against a proprietary dll, but then GNU came along and wrote a free, full-GPL implementation of the same dll API, and I bind your code against that, have you suddenly started infringing the GPL? I'm confused. But one thing's for sure, I will not be the judge in that case, if it ever happens.

You could perhaps look at whether there exist GPL codecs for WMP (web search says, yes, of course there are). Their authors clearly think you can write an open-source plugin for a proprietary product. Not sure whether that's analogous, either.

Steve Jessop
I guess this is kind of a gray area. On the other hand, our software will be distributed to only a few customers, maybe a dozen, who are very unlikely to sue anyone about this. But personally I think it's very important to check all license-related things before releasing anything to people outside of your company.
BastiBense
Or even inside your company - wasn't there some situation a while back where the FSF were saying that distribution within a company is still distribution, because employees are distinct legal entities? Hence, they said, employees have a right to the source of your custom internal apps that incorporate GPL code.
Steve Jessop
I think the keyword is distributing. Your application is not linked to GPL code. Hence you distribute nothing that includes the GPL. What licenses people use for plugins with your software, that THEY distribute, is THEIR business. I can't possibly see how the courts would say otherwise... But as the OP says, that's why we have courts.
Eloff
Yes, FSF seems to me to claim 2 things. (1) that the linked program is a derivative work. Fair enough. (2) that creating such a work is forbidden under the GPL, and that the responsibility for that lies with the author of the non-GPL program, such that I'm prohibited from distributing non-GPL programs which might be linked against GPL libraries. It's (2) that I don't follow.
Steve Jessop
A: 

My only answer to this is

Ask a lawyer

gnud
Are there free and open lawyers?
Vi
A: 

just some food for thought, since this exact topic is of particular interest to me, especially in the Java realm, and I have had similar questions.... here is an excerpt from a message I recently sent to an acquaintance of mine. (The example is realistic but contrived; I've never used fast Fourier transforms for any major project I've worked on or am likely to work on.)

I hereby release this post to the public domain -- apologies for the length, but when I wrote it, I wanted to provide a fairly concrete example.

I also pledge US$250 as a contribution to the first non-profit organization (other than FSF) who can provide some useful guidance to the questions at the end, and whose mission includes promoting the use of open-source software.


Consider the Shared Scientific Toolbox in Java. ( http://hubris.ucsd.edu/shared/ ) This is a library for programming scientific applications. It is licensed under the LGPL, with a caveat about its optional use of the GPL'd FFTW library for fast Fourier transforms (excerpt from the SST manual follows):

1.5 Licensing Issues

Some of the SST’s functionality is backed by excellent, free, third party software packages. Keep in mind that FFTW3
is the default FFT [5] service provider. It is licensed under the GPL; however, a commercial, non-free version not
bound by the terms of the GPL exists.

Most of the work for the SST is original, and this author has released said parts under the LGPL. Take note
that the free version of FFTW3 is released under the GPL; any distribution of the SST that links to it, or anything
else GPL’d, is covered under the GPL by extension. For licensing disambiguity, the permissive parts of the code
base reside in directories not suffixed with an x, and they do not depend on the GPL’d parts. Long story short,
one can obtain a distribution usable under the LGPL by removing src/sharedx, src/libx, native/src/sharedx, and
native/include/sharedx.

So assuming this interpretation of licensing terms is accurate, I can obtain the SST source, cut out the parts of it that utilize FFTW, and produce an SST-LGPL.jar library which is covered by the LGPL license and not GPL. The library SST-LGPL.jar contains an interface shared.fft.FFTService, which abstracts the general features of a class that provides FFT functionality. It also includes the class shared.fft.JavaFFTService, an implementation of FFTService which is probably not as fast as FFTW. Both FFTService and JavaFFTService are covered under the LGPL license.

Now suppose I modify the SST-LGPL.jar library to add the following class:

/**
 * allow choosing an implementation of FFTService at runtime,
 * through mechanisms that are not contained within the SST library.
 * The default implementation class used is specified by the
 * property "FFTService.implementation", loaded from the classpath
 * specified by the property "ServiceFactory.classpath", with both
 * properties contained in a "SST.properties" file in the same directory
 * as this .jar file.
 */
class FFTServiceFactory
{
  public FFTServiceFactory() {}
  public FFTService createService(String className) // exception clauses elided
  {
    Class<FFTService> serviceClass = loadClass(
        className, lookupProperty("ServiceFactory.classpath", null));
    return serviceClass.newInstance();
  }
  private String lookupProperty(String propName, String defaultValue)
  {
    /* exercise for the reader:
     * look up a property with a specified name,
     * in a "SST.properties" file in the same directory as the .jar file
     * containing this class. If not found, use defaultValue.
     */
  }
  private <T> Class<T> loadClass(String className, String classPath)
  {
    /* exercise for the reader:
     * write a custom classloader that looks up a className class from
     * the given dynamically specified classPath (or if classPath is null,
     * it uses the standard Class.forName() )
     */
  }
  public FFTService createService() {
    return createService(lookupProperty("FFTService.implementation", "shared.fft.JavaFFTService"));
  }
}

Suppose I also create and distribute three other packages:

1) SST-FFTW-JNI.jar + SST-FFTW-JNI.dll This consists of those parts of the SST.jar that were cut out, including the class sharedx.fftw.FFTWService which wraps the FFTW C library (compiled into a dynamically-linked library) and accesses it "directly" through JNI.

2) SST-FFT-IPC.jar + SST-FFTW-IPC.exe + SST-FFTRI-IPC.exe + SST-FFT-IPC.pdf This consists of two programs, a library, and a specification.

  • SST-FFTW-IPC.exe: contains the FFTW C library and runs FFT algorithms, obtaining its data through some IPC mechanism (e.g. sockets or standard I/O).

  • SST-FFTRI-IPC.exe: contains a Reference Implementation of an FFT algorithm, does not contain FFTW, and obtains its data through the same protocol as SST-FFTW-IPC.exe

  • SST-FFT-IPC.jar: a .jar file that contains the class shared.fft.FFTIpcService, which implements shared.fft.FFTService, by launching either SST-FFTW-IPC.exe or SST-FFTRI-IPC.exe (which one used is configurable at runtime) and communicating with it through IPC. SST-FFT-IPC.pdf: specifies the IPC mechanism used by the above 3 programs. I choose to release this through some sort of open-source license.

3) WaveformViewer.jar This is proprietary application software. It depends on, and is distributed with, SST-LGPL.jar, for several features including fast Fourier transforms. It has documentation that talks about how to use it with the SST-FFTW-JNI and SST-FFT-IPC packages, but those packages must be obtained separately.

=====

As far as I can tell, here are the licensing/distribution requirements of the individual packages/files:

SST-LGPL.jar LGPL (all the source files used are LGPL, so my modifications are also LGPL)

SST-FFTW-JNI.dll GPL (required since it statically links to FFTW which is GPL)

SST-FFTW-JNI.jar GPL (required since it dynamically links to SST-FFTW-JNI.dll which is GPL)

SST-FFTW-IPC.exe GPL (required since it statically links to FFTW which is GPL)

SST-FFTRI-IPC.exe Licensing is up to me, since I create this program using FFT first principles.

SST-FFT-IPC.jar Licensing is up to me. This library can utilize SST-FFTW-IPC.exe, but IPC communication does not spread GPL, and anyway I can use SST-FFTRI-IPC.exe

SST-FFT-IPC.pdf Licensing is up to me. This is a document describing ideas.

WaveformViewer.jar Licensing is up to me. I choose a license that is not compatible with GPL (whether proprietary or open-source) because I feel like it. It depends on (links to) SST-LGPL.jar but that is LGPL.

There are 4 ways of running WaveformViewer.jar:

A) base method: WaveformViewer.jar + SST-LGPL.jar, uses shared.fft.JavaFFTService.

B) base + SST.properties pointing to sharedx.fftw.FFTWService through SST-FFTW-JNI.jar

C) base + SST.properties pointing to shared.fft.FFTIpcService through SST-FFT-IPC.jar + SST-FFTRI-IPC.exe

D) base + SST.properties pointing to shared.fft.FFTIpcService through SST-FFT-IPC.jar + SST-FFTW-IPC.exe

(A) and (C) do not use the FFTW library at all.

(D) uses FFTW, but it is contained within a separate executable, so I'm fairly sure it does not violate any licensing requirements.

(B) uses FFTW. Technically it links to FFTW dynamically. An external user has to configure SST.properties to make it work, and my WaveformViewer.jar neither depends upon any FFTW library, nor takes any explicit steps to use the FFTW library.

Three questions:

  1. In case (B), what, if anything, triggers the GPL here? Does this violate the terms of the GPL?

  2. In case (D), if I don't create SST-FFTRI-IPC.exe, so that SST-FFT-IPC.jar utilizes the separate GPL executable SST-FFTW-IPC.exe, does this violate the terms of the GPL? Here I have created a GPL program, and written a Java library specifically created to communicate with a separate GPL executable to avoid spreading the GPL terms to my library. Technically my library does not depend upon SST-FFTW-IPC.exe, because my library can be configured to use a different executable instead.

  3. Does the licensing of the specification SST-FFT-IPC.pdf have any relevance to software designed to implement that specification?

Jason S