8000 Clarification of license for site using web assembly + static linking? · Issue #6467 · libgit2/libgit2 · GitHub
[go: up one dir, main page]

Skip to content

Clarification of license for site using web assembly + static linking? #6467

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact 8000 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

Closed
liquidaty opened this issue Feb 6, 2023 · 10 comments
Closed

Comments

@liquidaty
Copy link
liquidaty commented Feb 6, 2023

Hi,

Thank you for this awesome project. We are big fans and would like to use it more, but have a license question.

In particular, we'd like to build a website that loads web assembly into its page (compiled from closed source) and makes use of libgit2. Seems straightforward enough.

Ideally, we'd simply develop a proprietary binary that dynamically links to libgit2, and distribute them both together without the requirement of disclosing proprietary source code: a clear-cut case that would appear to squarely fall within the bounds of permissibility as described in COPYING. And to make it easier, others have already compiled libgit2 to wasm so we know that's feasible.

Alas, there is no simply way to load dynamic libraries, this due to issues such as this 4kb limit one. Maybe there is some undocumented workaround-- many have been suggested-- but by far the easiest solution would be to statically link.

So the question is, would that be permissible? I suppose the first question to answer that is: if I host a website that loads web assembly into a user's browser, is that the same as "distribution" (i.e. analogous to distributing a .exe file that is run locally on a PC)? Our understanding is that the whole purpose of the license is to allow distribution so long as the shared library can be swapped out. However, in the context of user accessing the software through a browser, the user cannot make such a swap (since the user cannot control over the execution environment), so the use case would seem to be more analogous to a user who SSHs into a server that contains a single version of a proprietary combined work, which the user can execute (e.g. "/opt/bin/combinedwork") but not modify and is not authorized to copy, which is a use case that would seem to squarely fit in the "not a distribution" category.

Just to clarify, I'm not asking this question for all licenses similar to this library's (though it very well might be applicable). Rather, I'm just asking what the intent is, by the original authors who wrote the code and chose the license, for this particular project. That said, I would still be interested to hear any feedback anyone may have.

@neithernut
Copy link
Contributor

Disclaimer: I'm not a maintainer of this project.

Libgit2 is licensed under GPLv2, not LGPLv2. However, COPYING does include a linking exception, which is of interest in your case. If I read it correctly it's rather permissive and allows you to link libgit2 statically into a binary and distribute it. (Last time I checked LGPLv2 didn't allow this, but I could be mistaken).

As I see it, sending a binary to clients (browsers) is distribution. But if I were you, I'd also look at how this is handled by existing projects. I think there are already other users of libgit2 in some web assembly application.

@liquidaty
Copy link
Author

@neithernut thank you for the clarification re LGPLv2 vs this library's license. I've updated the OP to reflect that.

I'd also look at how this is handled by existing projects. I think there are already other users of libgit2 in some web assembly application

How would that would help? Just the fact that other projects did something does not mean it was permissible. Unless you're suggesting that they asked the same question and someone from the libgit2 project answered, which would definitely help.

@neithernut
Copy link
Contributor

I'd also look at how this is handled by existing projects. I think there are already other users of libgit2 in some web assembly application

How would that would help? Just the fact that other projects did something does not mean it was permissible. Unless you're suggesting that they asked the same question and someone from the libgit2 project answered, which would definitely help.

If they considered running the application in browsers is a form of distribution, they would (hopefully) adhere to the demands the GPL makes. That is, their application should include licensing information and a link to the libgit2 source code somewhere in the user interface. That is, if their project isn't licensed under GPL itself (in that case they may "only" include a link to their own source code). And if it were me, I'd document why the information is there at least in the commit message introducing that element.

If not they should at least have discussed that amongst themselves, and documented that somewhere. And be it in some github-issue.

But maybe I'm too optimistic and people don't really care about licensing conditions in OS projects (any more).

@ethomson
Copy link
Member
ethomson commented Feb 8, 2023

IANAL, and I am not your lawyer, in particular. 😁

But:

I suppose the first question to answer that is: if I host a website that loads web assembly into a user's browser, is that the same as "distribution" (i.e. analogous to distributing a .exe file that is run locally on a PC)?

My opinion is that this is distribution, and that there's little ambiguity there.

Our understanding is that the whole purpose of the license is to allow distribution so long as the shared library can be swapped out.

The linking exception for libgit2 states:

In addition to the permissions in the GNU General Public License, the authors give you unlimited permission to link the compiled version of this library into combinations with other programs, and to distribute those combinations without any restriction coming from the use of this file.

I note that it doesn't say dynamically link or statically link. Just link.

I can only give you my opinion on this, which is: as an author, I'm happy for you to use my code that's in libgit2. My interpretation of the license is that libgit2 is covered under the GPL. So if you change libgit2 itself, I would expect you to contribute those changes back or otherwise make them available under the GPL. But your code is your code, and I don't care how you link to libgit2, your code is covered under the linking exception.

But again, IANAL. I hope that you enjoy libgit2 and keep using it. 🚢 :shipit:

@liquidaty
Copy link
Author
liquidaty commented Feb 9, 2023

@neithernut, @ethomson : thank you for your responses. In hindsight I should have read the COPYING text more closely instead of incorrectly thinking it was the same as LGPLv2 before posting this issue-- so apologies for wasting anyone's tiem on this-- but your added color is appreciated and helpful nonetheless!

8000
@liquidaty
Copy link
Author

Hi, I'm reopening this to ask for further clarification given a further question that has been brought to my attention.

The COPYING exception in this library appears to allow static linking of the unmodified library. It is not clear that it allows static linking of a modified version of this library. Further, arguably, it is not possible to compile the library to web assembly without modifying the library as is done in https://github.com/petersalomonsen/wasm-git.

So the original question of whether a site can run a version compiled to web assembly with static linking seems to remain; in particular:

  • does the COPYING exception exclude static linking of modified versions of the library?
  • if yes, would a wasm library compiled via https://github.com/petersalomonsen/wasm-git be deemed "modified" for the above question?
  • if yes, and this is unintentional, would the lib authors be willing to either accept the changes needed to compile to wasm without modification, or modify the license to allow static linking of a version that is modified for this purpose?

@liquidaty liquidaty reopened this Feb 20, 2023
@ethomson
Copy link
Member

The COPYING exception in this library appears to allow static linking of the unmodified library. It is not clear that it allows static linking of a modified version of this library.

I’m not sure that I agree. Any modifications to this library are also covered by its own license. If you make some work that modifies libgit2 (libgit3!) then it will still have this license. A modified version of libgit2 cannot remove the rights granted under the license.

Someone could make a work that combines libgit2 - modified or not - with another piece of independent code, and that independent code could be under a different license. But modifying libgit2 - for better or worse - still just gives you libgit2. 😅

Is there verbiage in the license that you interpret differently?

@liquidaty
Copy link
Author
liquidaty commented Feb 20, 2023

Thank you @ethomson, I'm very glad to hear that! The "LINKING EXCEPTION" does not appear to explicitly say that modified versions are covered, but the README says (emphasis mine):

libgit2 is licensed under a very permissive license (GPLv2 with a special Linking Exception). This basically means that you can link it (unmodified) with any kind of software without having to release its source code

One might argue that the parenthetical clarifies the linking exception to only apply to unmodified versions (or further argue that "This" is referring solely to the default GPLv2 license terms, and not to the Linking Exception). If that is not the case, and the exception is intended to include modified or unmodified version, would it be possible to update the README to reflect that e.g. "unmodified or modified" (or perhaps something more narrow such as "unmodified, or modified to the extent needed to implement the Language Bindings listed below")?

@ethomson
Copy link
Member

Typical caveats apply -- the license is the binding document, not the README -- but of course IANA and, IANYL,

@liquidaty
Copy link
Author

@ethomson thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
0