Skip to content
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

Dune license #11603

Open
jamesjer opened this issue Apr 3, 2025 · 2 comments
Open

Dune license #11603

jamesjer opened this issue Apr 3, 2025 · 2 comments
Labels
question This issue is a question about something

Comments

@jamesjer
Copy link
Contributor

jamesjer commented Apr 3, 2025

The toplevel LICENSE.md file says that dune is distributed under the MIT license. But I see two copies of the LGPL 2.1 license, in src/dune_pkg/COPYING and src/sat/COPYING. What is the significance of those license files? They are not referred to anywhere. None of the source files in src/dune_pkg or src/sat say under which license they are distributed. Should I deduce that all of the source files in src/dune_pkg and src/sat are distributed under the LGPL? If so, is one of these meant?

  • LGPL-2.1-only
  • LGPL-2.1-or-later
  • LGPL-2.1-only WITH OCaml-LGPL-linking-exception
  • LGPL-2.1-or-later WITH OCaml-LGPL-linking-exception

In any of these cases, due to the copyleft nature of the LGPL, doesn't that mean that the dune project as a whole is distributed under the LGPL, not the MIT license?

@Alizter
Copy link
Collaborator

Alizter commented Apr 3, 2025

Let me first give a disclaimer that I am not a lawyer.

I believe that license was included due to the vendored copy of 0install. I believe as long as only these sources are kept under LGPL and the rest is MIT, we can distribute the sources of dune as MIT. My reason is because we are simply linking against the existing 0install library, by vendoring it ourselves with some minor modifications.

Let me quote from LGPL 2.1:

  1. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License.

However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables.

When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law.

If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.)

Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself.

Presumably somebody could replace the 0install code we have in dune with another implementation or empty stubs and the dune binary (barring package management) would function normally. Therefore I believe dune is permitted to be distributed under MIT.

@Alizter Alizter added the question This issue is a question about something label Apr 3, 2025
@maiste
Copy link
Collaborator

maiste commented Apr 8, 2025

Since this issue was opened, I was a bit concerned about it, which result in making some researches. Same disclaimer that I'm not a lawyer.

We indeed included the files because 0install was vendored. This PR then split the work between two dune libraries. As @Alizter mentioned, the section 5 mentioned that we can link the library with a program under another license (this is the goal of the LGPL), even if we modified it as long as it is a library. This is the case here, and we distribute the rest of the code under the MIT.

However, digging a bit further, I have found that we must explicitly specify the files that we modified:

  1. You may modify your copy or copies of the Library or any portion
    of it, thus forming a work based on the Library, and copy and
    distribute such modifications or work under the terms of Section 1
    above, provided that you also meet all of these conditions:
    a) The modified work must itself be a software library.
    b) You must cause the files modified to carry prominent notices
    stating that you changed the files and the date of any change.
    c) You must cause the whole of the work to be licensed at no
    charge to all third parties under the terms of this License.

We comply with a, but not we b and c as we do not specify explicitly which files neither the modifications made.
Should we update the code with a header reflecting this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question This issue is a question about something
Projects
None yet
Development

No branches or pull requests

3 participants