10

I check the FAQ page of GNU Licenses but cannot find the answer.

If someone is using my code (in Python) that is released under GPLv3, does s/he violate my GPLv3 rights if s/he uses my library intensively (has intimate data communication) by

  • import the library
  • and does function call multiple times,
  • but does not modify the library

but when distributing his/her software s/he does not distribute my library but give the URL to the user to download my python code separately instead. His/her program will not work if the users do not download my library. For example, s/he makes python files import my library to use with it, then convert/compile all py files to pyx files (using cython), then release pyx file but the end user has to download my .py file from the internet. Technically, all pyx files do not contain any part of my library except the name of the library.

If I use AGPLv3 instead of GPLv3, does it help to prevent someone else from releasing his/her program in a closed-source format if the program uses my library but the library is not part of the distribution and the users are required to download the AGPLv3 protected library in order to make the main program released as the closed-source software to work.

I also read the license fine print (https://www.gnu.org/licenses/gpl-3.0.txt) and it just protects against

  1. "4. Conveying Verbatim Copies."
  2. "5. Conveying Modified Source Versions."
  3. "6. Conveying Non-Source Forms."

so if the violator does not "convey" any part of my source code that is protected under GPLv3 and ask the end user to download my library, how can "GPLv3" cover my works? I think it does protect my work but cannot fine the fine print that talk about that. Can you point me to where in the fine print that talk about that, please?

The answer from stackoverflow confuses me even more https://stackoverflow.com/questions/11033418/library-dependencies-compatibility-for-non-commercial-use

It says

As long as you do not re-distribute your dependencies, it doesn't really matter what licenses they have, compared with what license you choose for your own project.

Yea, that is true ... for open source dependencies with mainstream licenses. But: It forces your users to download all of the dependencies which is a bad idea.

The relevant GNU page on this is https://www.gnu.org/licenses/gpl-faq.html#GPLPlugins It talks about whether GPLv3 part and the closed-source are two separate programs or they are linked to each other and formed a single program. Yet, it does not say about the final distribution of the software. The part that I worry is that the violator may say the violation will occur only if s/he distribute the GPLv3 part, but when the end user download it manually, it is not the violation. If this is the case, is there a way to modify GPLv3 such that even if the GPLv3 part is not "conveyed" during the final distribution, it is still violating the license?

Please help. Thank you.

5 Answers 5

9

You're rightfully confused, it should be simple (but the world is complicated): a GPL-licensed library can only be used in a programme which does give its users the same rights as the GPL provides.

Conversely this means: you must not include that library into your programme if the programme is not distributed under GPL or compatible terms. This cannot be circumvented by asking the user to install the files themselves separately. However here it gets indeed tricky with python or other interpreted languages. When I say 'include' above, it means in python to use the import statement. Yet the GPL applies to the binary provided to users, thus when distributing the work as a whole.

The above paragraph does not change, if you talk about the AGPL instead of the GPL. It would make a difference if the library uses the LGPL which is designed to uphold the obligations of the GPL limited to the library itself as long as the main programme allows the user to replace the library by another version.

In your case concerning python the "proper" way to circumvent the GPL is to call the library in a completely separate process and to NOT import the library, e.g. by subprocess.run():

import subprocess
result = subprocess.run(["python", "my_gpl_python_file.py"], capture_output=True, text=True)
print(result.stdout)

The use via import is (IMHO) a violation of the license, at least in the spirit of the license - but it has not been contested in court for an interpreted language like Python. As for Python it suffices to distribute the source code, and compilation is done by the user's python interpreter by its just-in-time compiler. And I'm not aware of any court ruling for this particular case - which might or might not uphold the GPL requirements for this case. It could be argued that the wording of the GPL was crafted with compiled languages in mind, like C. (see also this very similar or identical question coming to a similar conclusion)

In the end a license, any license, is just a few words. Any license itself does not stop anyone doing anything, including what you describe. It can only as strong as the authors are willing to uphold it and their copyright, i.e. to sue violators who are unwilling to comply even when asked nicely.

10
  • 1
    In OP's case, it seems that the one producing the derivative work is the end user, and not the developer of the closed-source part. Because the end user doesn't distribute the derivative work, there's no license violation. Am I right? Wrong?
    – Pablo H
    Commented Dec 4, 2023 at 13:38
  • 3
    Well. That's the critical question. My non-legal opinion is: it is a license violation, but the wording is poor in regard to script languages. And it has not been tested in court. The intention of the GPL definitely is to not allow this case. This is supported by the creation of the LGPL which explicitly targets the case that a GPL - licensed library is being used by a differently-licensed programmed which does not (want to) comply with the GPL. Maybe there do exist case rulings from the linux kernel which also exports GPL and non-GPL symbols. Commented Dec 4, 2023 at 14:01
  • @planetmaker I disagree. It's not the script language that's an issue here. imagine OP had C code instead of Python, released a bunch of proprietary code to an end-user, but told the user that he would need to compile it with some GPL-libraries. Would you conclusion still hold? Because imho that's what relevant here.
    – Opifex
    Commented Dec 4, 2023 at 15:40
  • 2
    @Opifex if that were the question, it would be a duplicate, as we have already summarised the arguments that linking does make a combined work, subject to the licences on all those constituent works, and the arguments that it doesn't. Sadly, they still boil down to "nobody really knows yet". But planetmaker is dead right that the intent of the authors of the GPL is very clearly that dynamic linking does make a combined work.
    – MadHatter
    Commented Dec 4, 2023 at 15:53
  • 2
    @MadHatter but the point is that, verbatim, the code does NOT include the GPL library when OP distributes it. I quote: " s/he makes python files import my library to use with it" This means that no GPL code, nor references to it, are being distributed. It is the end-user (who will possibly not distribute) who taints the non-GPL code with GPL libraries. One could argue that OP is circumventing the GPL by delivering non-functional code. But non-functional code is not something rare. All libraries are non-functional, as they need other code that calls them before they become useful.
    – Opifex
    Commented Dec 4, 2023 at 17:40
5

Any conditions GPL places on distribution are based on copyright law. It does not involve patent law or contract law, unlike some closed-source software licenses. Details of copyright law vary by jurisdiction, but are largely similar in countries that are part of the international agreements.

Consider the actions of the people involved:

  1. Developer downloads your software and writes his own code to use it.
  2. Developer publishes his own code.
  3. Developer publishes documentation that instructs downloading your code.
  4. User downloads developer's and your code and combines them to run it.

Of these, 1. and 4. clearly require licenses from you, but GPL gives very large freedom of running software and most of the requirements only kick in once you propagate it.

Publishing documentation in 3 is also fine. If they write it themselves, you don't have copyright claim over it. If they reuse your documentation, they could comply with whatever license applies to the documentation.

The only point where copyright claim can potentially occur is 2. If the software they have written builds so intimately upon your software that it can be considered a derivative work, then they need to follow your license for publication even if none of your original work is included. How courts evaluate whether software is a derivative work is a complex subject.

There is insufficient legal precedent to predict how a lawsuit would go. In particular it is unclear whether merely calling a library makes the calling code derivative. If there is significant API structure that is imparted on the calling code, that is a good basis to claim it is derivative. Most companies play it safe and avoid any linking to GPL code, but the legal boundaries are not clear and few cases end up in court. "The Penguin Paradox" by Mitchell L. Stoltz explores this in depth.

If you do have a legal basis of making a copyright claim on 2, then GPL does apply to the derivative work also. Otherwise you would require a license that forbids either 1 or 4, but I'm not aware of any open source license that would work.

13
  • 1
    I'm not sure you're correct about contracts not being involved. The software is copyrighted which prevents you from doing whatever you like with it but the licence is a contract between the author and the user defining the terms of the use of the copyrighted work Commented Dec 3, 2023 at 17:53
  • @AlanBirtles True - I may not have phrased it quite correctly, but I mean that to my interpretation, GPL doesn't even try to use any contract law based restrictions. I'm not sure if it is even valid for a software license to contain terms such as "by running this software, you contractually agree to do <X>". Some proprietary EULAs certainly try to do that :)
    – jpa
    Commented Dec 3, 2023 at 18:07
  • The claim in the next-to-last paragraph that merely calling a library is unlikely to make the calling code derivative is in contrast with several other opinions here and (probably) elsewhere. I think it'd be useful to edit to make it clear that there are differing opinions.
    – David Z
    Commented Dec 3, 2023 at 21:42
  • Yeah that's fair; I'm just suggesting that you edit the answer to make it clear that the legal case is far from clear (:-p) because right now it's saying the opposite, at least for simple cases.
    – David Z
    Commented Dec 4, 2023 at 6:29
  • Not really, no. The sentence "In simple cases it will be hard to argue/prove in court that merely calling a library makes the calling code derivative" is the crux of what I'm objecting to. It might be hard. It might be easy. We don't know - or, I think we don't know, but if there's a reference that definitively shows otherwise it would be very useful to include. Otherwise, I would find something like this better: "In simple cases, in general, it's not legally established whether merely calling a library makes the calling code derivative."
    – David Z
    Commented Dec 4, 2023 at 6:52
2

Because the GPL grants recipients of GPL programs almost carte blance to produce derivative works that won't be distributed, there's not apt to be any way to prevent the development of closed-source programs that benefit from functionality provided by open-source GPL "plug-ins" that use GPL libraries.

The best one could do would be to design one's library in such a way that it would only be usable in ways that would make direct client code a derivative work, and specify that the author of any client code must make a bona fide effort to include in the "published source code" sufficient information that would allow anyone the same ability to build and use modified versions as the author would have. The GPL wouldn't allow a library author to forbid the use of a plug-in architecture to invoke GPL libraries from within closed-source libraries, but the GPL's definition of "source code" could probably be used to compel someone using plug-ins in such fashion to make a bona fide effort to publish all of the information necessary to effectively write both plug-ins and clients.

8
  • If your wrapper needs to be GPL licensed because it is a derivative work, then the GPL stipulates that the wrapper as a whole needs to be distributed under the GPL license. That has as a consequence that anything that is a derivative work of the wrapper also needs to be licensed under the GPL. The wrapper idea only works if the wrapper can be created without it being a derivative work of GPL licensed code. Commented Dec 5, 2023 at 8:50
  • @BartvanIngenSchenau: The wrapper would be GPL, but its interface with the main code would not involve any GPL code written by anyone other than the author of the main program. If the program architecture is that the main program works with "plug-ins" that conform to a published spec, while being agnostic as how the plug-ins are generated or linked, someone who received such a program would have much more abilty to adjust its behavior to their liking than if the author simply licensed closed-source libraries.
    – supercat
    Commented Dec 8, 2023 at 5:37
  • @BartvanIngenSchenau: Consider e.g. a chess program which uses a closed-source chess engine but uses open-source plug-ins for the user interface. Under a plug-in model, any parts of the design that were controlled by GPL code could be freely modified, yielding a program much more versatile than if nobody was allowed to use any GPL libraries when writing plug-ins.
    – supercat
    Commented Dec 8, 2023 at 5:40
  • See this GPL FAQ entry: gnu.org/licenses/gpl-faq.en.html#GPLPluginsInNF. And note that the suggestion to adding an exception is probably not available when you use 3rd party GPL code without such an exception. Commented Dec 8, 2023 at 7:32
  • And I don't deny that having GPL plugins to a non-free program can be beneficial. It is just legally a difficult topic. Commented Dec 8, 2023 at 7:34
1

I certainly understand your frustration but I don't think that what you've described is a copyright violation - and I don't think any of the OSI approved licenses would restrict this type of use. Think of my bash script using the GNU toolchain - https://www.gnu.org/licenses/gpl-faq.en.html#GPLAndNonfreeOnSameMachine

One of the nice things about GPL is that the FSF had lots of resources (like the faq above) to support the use of the license including a license violation mail list. They will also even get involved in legal compliance.

So:

0

The GPL license prevents creation of a derivative work using any license other than GPL (or maybe just open source). For the purposes of dynamic/run time linking, this occurs at run-time. The problem is not whether someone distributes a GPL library alongside their proprietary code, or instructs someone to download it themselves. It is that the end user has no valid license with which to run the program. They would create this derivative work which violates the GPL by linking it to the closed source code by running the program. I'll try find a link I once read about it...

2
  • 2
    You only have obligations under GPL of you convey the code. On your own machine you can mix any code in any way you want (maybe with some restrictions from proprietary codeplacing usage restrictions on itself) Commented Dec 5, 2023 at 0:33
  • 1
    Creating a derivative work is a right under the GPL. Anyone can take a GPL product and make their own proprietary software for internal use, for example. You only have to share the source code to your derivative work if you subsequently distribute it! Commented Dec 5, 2023 at 15:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.