-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please provide guidance whether the static linking exception applies to distributions like DkML #13177
Comments
I am not sure what is your issue with the LGPL license? As far as as I can see, DkML does not modify the source code of the compiler, does it? If this is the case, there is nothing to do for DkML to be compliant with the LGPL like all other OCaml executables or libraries. The intents of the license is that only forks of the compiler and compiler libraries are affected by the license, which requires to use the LGPL with a static linking exceptions rather than the GPL like gcc because the runtime is linked with all OCaml programs. Typically, opam distributes ocaml and is not inside INRIA. The Solo-5 version of OCaml distributed by Mirage is yet another version distributed outside of INRIA. Coq does not distribute OCaml since they are using the compiler and compiler libraries distributed by opam. |
The point of the "linking exception" part is to say that it is okay for people to license their own OCaml programs however they want, even if technically they depend on the stdlib, otherlibs/, the compiler interface, and their programs included pieces of compiled code coming from those things. To phrase this exception, the license text needs a way to define what "the OCaml compiler" is. Their definition is "the stuff distribution by INRIA, or any other distribution, fork, derivative of it". That sounds reasonable. It does not "disadvantage" other distributions or forks of the compiler, on the contrary it explicitly includes them in the definition of an "OCaml compiler distribution" so that their users benefit from the linking exception, and can use the license they prefer for their OCaml programs and libraries. |
To be clear, yes, DkML has patches to code in ocaml/ocaml and ocaml/flexdll. They are at https://github.com/diskuv/dkml-compiler/tree/main/src/p. Some of them are patches that will never be accepted (like PIC support for Android ARM32 at #10860 which will never make it into the official Inria distribution). All of them are supporting non-traditional platforms (Android and Windows). It is unclear what "OCaml Core System" means ("the OCaml compiler" is not a term in the license). But at first reading it is very difficult to say that DkML is an "unmodified OCaml Core System" (exact words), and it would have been impossible for me to get Windows working right if modifications were/are not allowed. The license sounds like DkML, since it is not "unmodified", has no static linking exception. That is, every DkML user is subject to the full LGPL while every Inria OCaml user has a static linking exception. And that is terrible. If the static linking exception still applies with the DkML cross-platform patches to OCaml, great. |
I missed those patches, sorry. Then the distribution of DkML is covered by the second part:
which means that those patches needs to be available (to any users of the DkML distribution asking for them) under the LGPL 2.1 license. Under those condition, the linking exception applies to the DkML distribution too. |
Note that the linking exception is a distraction here. If you distribute a modified version of the compiler, you must respect the licence of the compiler and the requests it makes about derivate works, so -- in the case of a LGPL compiler -- you should make the modified version available to your users under the LGPL as well (and provide the source, etc). |
I think that this issue is mixing two things:
I think that both aspects have reasonable merit (although I don't expect that the license will get changed, because it is a contentious issue, too much work, and probably not important enough), but that they should not be mixed in a single issue. I would be in favor of restricting the present issue to (1), as this is what we have discussed so far, and encouraging @jonahbeckford or someone else to open a separate issue for (2) if we really want to have that discussion. |
I've limited the scope to providing a FAQ-like guidance in this issue. |
Recap 1Let me recap where we are:
And now let me attach to each of those numbered points their apparent ambiguities and contradiction:
Summary: It sounds clear that the intent was to let distributions like DkML have the safety of the linking exception. However, the either-or clause "we mean either the unmodified OCaml Core System as distributed by INRIA, or a modified version of the OCaml Core System that is distributed under the conditions defined in clause 2 of the GNU Lesser General Public License" requires that every distribution that falls into the second part (DkML, Mirage) must use the LGPL clause 2 "conditions". And the guidance in https://www.gnu.org/licenses/gpl-faq.en.html#LGPLStaticVsDynamic states onerous conditions for applications using the DkML/Mirage distributions compared to applications using the INRIA distribution. Sources:
Is there anything incorrect in this "Recap 1"? If not, we can proceed to action items. Aside: In my opinion, the unintended consequences are worse for MirageOS (a "library" OS that is always statically linked) than DkML. |
My understanding is that we agree on the intent of the linking exception as formulated: the intend is to give more freedom to users of (1) the upstream compiler or (2) a (license-compliant) derivative version of it. You believe that you have found an "unintended consequence" of the wording, where the unintended consequence is that the intent of the text is not respected, and in fact derivative compilers do not benefit from the linking exception. I think that your reading of the thing is wrong, but before I explain why let me make a simple point: I am not a lawyer, I would trust lawyers more than myself to check that the lawyery meaning of the text matches its intent, and this linking exception has been reviewed by lawyers (INRIA lawyers, years ago) to check precisely this. They might have done a bad job, and you might have found a loophole that they missed, but it is reasonable to believe that they didn't and that you haven't. Now the details on why I don't agree with your reading. The linking exception says that it applies to users who link their work with "a publicly distributed version of the OCaml Core System". The definition of this is "either the upstream stuff from INRIA, or a modified version [..] that is distributed under the conditions defined in the clause 2 of the LGPL". This does not say: "that is distributed under precisely all the conditions of the LGPL without any exception or extra freedom". The fact that some other clauses than clause 2 have consequences that are contradictory with the linking exception is true (this is precisely why we need an exception), but it does not make the definition of the linking exception. If you go back to read clause 2 (included in the LICENSE file), you will see that it describes how the derivative work of the compiler (in your case, DKML) may be distributed -- and basically you have to distribute your fork under LGPL as well. It does not constrain the way that users of your program or authors of derivative work in turn must proceed, which is what is covered by the linking exception. |
This is making an assumption about motives, and that colors the "reading". Possible motives:
There is no "bad job" or "loophole that they missed" if number 1 is true. Quite the opposite! I would describe number 1 as being the completely competent and conventionally conservative product of corporate attorneys. I would describe number 2 as noble and quite in line with the ethos of the 2000s. (It was weird to see that reflected back as "bad job" and "loophole") So, given that the intent (number 2) is agreed by everybody but unknowable to INRIA outsiders ... back to the original request ... can we get explicit guidance for users? "The design and intent of https://github.com/ocaml/ocaml/blob/trunk/LICENSE is that users of derivative distributions like DkML and Mirage have the protection of the license's static linking exception when all of the derivative patches are licensed with https://github.com/ocaml/ocaml/blob/trunk/LICENSE." If the issue can be closed with a "yes" to the above sentence, there is nothing more to do from my perspective. |
We discussed this at today's meeting. I agree with @jonahbeckford that having upstream providing some "guidance" is a good move. @Octachron suggests to add this guidance text in HACKING.adoc, as a sort of FAQ entry. |
Thanks! Appreciate it. |
I'm not sure why it took me so long to realize this, but the 8+ years old LGPL+static-linking-exception license very much disadvantages distributions like DkML (see bold):
Of course, the only distributions I am aware of are DkML and Coq. And Coq is based out of Inria so the disadvantage is only for DkML.
Honestly, the LGPL license gives me a headache trying to understand it so I don't really know the impact of the full LGPL. But it is clearly not a good thing.
Two questions:1. Why is OCaml using LGPL at all? I'm guessing it is either because of influence from Java (every mainstream language I've looked at other than Java has a fully liberal license), or perhaps OCaml does not own a trademark to the nameOCaml
, or perhaps it is some Inria licensing policy, or perhaps some consequence of French law.2. (Depends on the answer to the first question) Could we change the LICENSE to anything liberal (if there is no reason for LGPL) or make a broader static linking exception?EDIT: In this issue, please provide guidance about how to interpret the OCaml static linking exception. Each FAQ in https://www.gnu.org/licenses/gpl-faq.en.html is an example of providing guidance.
The text was updated successfully, but these errors were encountered: