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.

EKP
  • 101
  • 1
  • 4

5 Answers5

8

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.

planetmaker
  • 11,042
  • 1
  • 28
  • 47
  • 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 Dec 04 '23 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. – planetmaker Dec 04 '23 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 Dec 04 '23 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 Dec 04 '23 at 15:53
  • @MadHatter I scrolled through your link diagonally, but as far as I can see it does not answer the question at all. It's just the basic "When do I need to release my work as GPL?" question. Unless I'm missing something very obvious here, it's not relevant at all. OP is asking what would happen if he releases NON-GPL code, but instructs the end-user to finish it off by adding the GPL code himself. – Opifex Dec 04 '23 at 16:36
  • @Opifex and as planetmaker has said clearly, "you must not include that library into your programme if the programme is not distributed under GPL or compatible terms". That the OP sends the end-user off to get a library instead of supplying it him/herself makes no difference to the GPL obligations, because GPL obligations are not a function of shipping arrangements. – MadHatter Dec 04 '23 at 17:23
  • 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 Dec 04 '23 at 17:40
  • @Opifex: Many GPL programs are designed to be used with with closed-source code on users' machines, and would be useless if e.g. they could only be used by people whose display hardware had open-source drivers. If someone who receives the program can edit the source for any GPL portions and have their changes take effect, and the recipient would rather use the GPL code with some closed-source code than be unable to do so, forbidding such usage would remove rights from the recipients of GPL code, not protect them. – supercat Dec 04 '23 at 19:01
  • @supercat his argument is not about binary code, but about code which supplied in source code form. For that it's hard to argue. The only thing clear in that case is, that the resulting binary cannot be distributed. But I may still compile and use it myself. – planetmaker Dec 04 '23 at 20:20
  • @supercat Exactly! And because of that I think the only correct answer is the one that is being downvoted to oblivion... – Opifex Dec 05 '23 at 09:50
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.

jpa
  • 667
  • 4
  • 9
  • 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 – Alan Birtles Dec 03 '23 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 ". Some proprietary EULAs certainly try to do that :) – jpa Dec 03 '23 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 Dec 03 '23 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 Dec 04 '23 at 06: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 Dec 04 '23 at 06:52
  • @DavidZ Ok, I concede. After digging up more references there are indeed precedents that suggest that even mere linking may be a derivative work, even though it appears to have changed more in the permissive direction in later rulings. I modified the wording again and added a reference. – jpa Dec 04 '23 at 07:18
  • Much credit to you for going out and researching it :-) I do like this version better, thanks! – David Z Dec 04 '23 at 20:07
  • @jpa: Even if the symbol names in a header file were copyrightable, if Fred Jones produced a program that combine a header file from a GPL library, a header file using entirely original symbol names which was written completely by Fred Jones and released under the GPL, and a .C file to act as an interface between them released under the same terms, I see nothing that would justify treating any program that linked with Fred Jones' header file as being a derivative work of any of the libraries with which Fred Jones' interfacing library would act as a bridge. – supercat Dec 08 '23 at 05:49
  • @supercat The argument is that Fred Jones' interface is a derivative work of the GPL library, and that any program that linked with that is derivative of Fred Jones' - and thus transitively of the GPL library. I didn't find any legal cases in past 20 years supporting that view, but there are older cases that have considered use of any interface as creating a derivative work. – jpa Dec 08 '23 at 06:19
  • @jpa: Fred Jones' closed-source program wouldn't be linked with the interface code except possibly at run-time (some approaches to handling plug-ins don't simply load a plug-in as a blob and have an entry point at a known displacement relative to the start of it). The only portion of the interface which would be involved in the build of the closed-source program would be the header file that contains nothing of anyone else's work, making it impossible for Fred Jone's closed-source program to be a "derivative work" of programs that did were not used in any way in its build process. – supercat Dec 08 '23 at 07:41
  • @supercat I totally agree with your interpretation and that is how I originally wrote the answer. However, like discussed in "The Penguin Paradox" there are some old legal precedents that can be interpreted in the opposite way. That is why I rephrased the answer to highlight the legal ambiguity. – jpa Dec 08 '23 at 08:09
  • @jpa: If the design of the wrapper were based upon "secret" information related to the client code, there could be an argument that proper source code for the wrapper would include secret information beyond the minimum required to build it. For example, if the client code required that a blob be digitally signed, a distribution which contained the bit pattern necessary to sign the output of a particular GPL version given the source code wouldn't be "real" source code, since modification would be impossible without the digital signing key. If, however, the author makes a bona fide... – supercat Dec 08 '23 at 16:00
  • ...effort to ensure that everything necessary to make plug-ins or programs that interact with them is fully published in the distribution with the wrapper source, especially if the distribution included an open-source program that fully exercises the wrapper (e.g. an open-source chess engine that simply pushes an arbitrarily-selected pawn, or offers a draw if no pawns can move, and resigns if the draw is rejected). – supercat Dec 08 '23 at 16:04
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.

supercat
  • 167
  • 4
  • 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. – Bart van Ingen Schenau Dec 05 '23 at 08: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 Dec 08 '23 at 05: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 Dec 08 '23 at 05:40
  • See this GPL FAQ entry: https://www.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. – Bart van Ingen Schenau Dec 08 '23 at 07: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. – Bart van Ingen Schenau Dec 08 '23 at 07:34
  • The question asks "What can a GPL library creator do against proprietary linker". This answer is for "What can proprietary linker do to circumvent GPL library license". – jpa Dec 08 '23 at 08:12
  • @jpa: The fact that the recipient of a GPL program is legally free to produce derivative works, subject only to the condition that any derivative works that don't satisfy certain conditions are not distributed, is fundamental to the GPL. Anyone wishing to release under the GPL needs to recognize that recipients of the software would thus be legally entitled to do things the author might not like. That doesn't mean that one can't state very clearly in the documentation that one does not wish that one's software be used in certain ways, and that people not cooperate with others in... – supercat Dec 08 '23 at 16:16
  • @jpa: I rewrote the answer, though, to reflect the polarity of the question. My main point is that library authors might be able to insist that GPL code not be used in hybrid projects in ways that do not allow recipients to use modified versions of the GPL portions. Note that if a product contains a microcontroller that's only available in mask-ROM form, someone with source code for everything that goes into the microcontroller may have less ability to do anything useful with it than someone with an aggregation containing a mix of open-source and closed-source plug-ins. – supercat Dec 08 '23 at 16:45
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:

  • No I don't think so, but I'm not an attorney.
  • Match up this use with other scenarios at https://www.fsf.org/licensing
  • If you find a violation or if you're still unclear get answers from FSF via license-violation@gnu.org
Tom
  • 119
  • 1
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
    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) – planetmaker Dec 05 '23 at 00: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! – David Jones Dec 05 '23 at 15:49