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

Add document describing the goals and plan of p4c software license tracking #5110

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add separate article specifically on Apache 2.0 and GPL v2 compatibil…
…ity question

Signed-off-by: Andy Fingerhut <andy.fingerhut@gmail.com>
  • Loading branch information
jafingerhut committed Jan 24, 2025
commit 486428e482609b46c01ff14b159e6446c67aff81
6 changes: 5 additions & 1 deletion license-details/README.md
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add reference to this file into the LINCENSE file, below the actual license.

Original file line number Diff line number Diff line change
@@ -62,7 +62,11 @@ https://github.com/p4lang projects, unless this is not legally
allowed.


# Source files that cannot be released under the Apache 2.0 license
# Source files that should not be released under the Apache 2.0 license

See [this article](apache-and-gpl-v2-licenses.md) for background on
questions of compatibility of the Apache 2.0 and GPL v2 licenses.


## Python source files that import the Scapy package

110 changes: 110 additions & 0 deletions license-details/apache-and-gpl-v2-licenses.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# Compatibility of GPL v2.0 and Apache 2.0 licenses

The claims of incompatibility in this section could use some good
references to back them up. Please suggest references if you know of
them.

| Python program A | ... imports Python | |
| with license | package B with license | Allowed? |
| ----------------- | ----------------------- | -------- |
| Apache-2.0 | Apache-2.0 | yes, same licenses |
| GPL-2.0-only | GPL-2.0-only | yes, same licenses |
| Apache-2.0 | GPL-2.0-only | very questionable |
| GPL-2.0-only | Apache-2.0 | very questionable |


There is no publicly available advice on the last two rows of the
table above that makes the answer obviously "compatible or obviously
"incompatible", hence the "very questionable" statement on whether it
is allowed. See later sections for examples arguing both ways.

Given that lack of clarity on whether it is allowed, it seems prudent
that the P4 Consortium should not risk its limited funds and available
volunteer time by using questionable combinations of software
licenses. We have a way to avoid that risk: use combinations of
licenses that are well known to be compatible.

If someone proposes using other approaches, it seems wise that they
should be able to provide advice backed by an organization with at
least one intellectual property lawyer, and willing to defend the
approach in court.


# Article published in a law journal

See [5].

Here is the text of the abstract of this 29-page article:

License “incompatibility” in free and open source software
licensing means that, when two differently licensed pieces of software
are combined, one cannot comply with both licenses at the same time.
It is commonly accepted that the GNU General Public License version
2 is incompatible with the Apache License, version 2 because certain
provisions of the Apache License would be considered “further
restrictions” not permitted by the GPLv2. However, this article will
explain why there is no legally cognizable claim for combining the two,
either under a copyright infringement theory or a breach of contract
theory.

I have not read this article in full. I have no idea whether this
author's ideas would hold up in a court case.


# Open Source Automation Development Lab (OSADL)

The OSADL [1] publishes a license compatibility matrix [2]. The
details in this section are for the version of this matrix downloaded
on 2025-Jan-23.

The matrix entry for the leading license being GPL-2.0-only and the
subordinate license being Apache-2.0 says:
```
{ "name": "Apache-2.0", "compatibility": "No", "explanation": "Incompatibility of the Apache-2.0 license with the GPL-2.0-only license is explicitly stated in the GPL-2.0-only license checklist."},
```

The matrix entry for the leading license being Apache-2.0 and the
subordinate license being GPL-2.0-only says:
```
{ "name": "GPL-2.0-only", "compatibility": "No", "explanation": "Software under a copyleft license such as the GPL-2.0-only license normally cannot be redistributed under a non-copyleft license such as the Apache-2.0 license, except if it were explicitly permitted in the licenses."},
```


# Free Software Foundation (FSF)

"By the same token, lax licenses are usually compatible with any
copyleft license. In the combined program, the parts that came in
under lax licenses still carry them, and the combined program as a
whole carries the copyleft license. One lax license, Apache 2.0, has
patent clauses which are incompatible with GPL version 2; since I
think those patent clauses are good, I made GPL version 3 compatible
with them." [4]

The above was written by Richard Stallman, who often speaks for the
FSF, but I do not know whether the FSF specifically endorses the legal
interpretations in the quoted paragraph above. It is published on the
gnu.org site quite prominently, though.


# Randomly found StackExchange discussion

See [3]. I don't claim anything in there as authoritative, but it
might have useful links that lead to more authoritiatve information.


# References

[1] https://osadl.org

[2] "OASDL license compatibility matrix with explanations",
https://www.osadl.org/html/CompatMatrix.html


[3] https://opensource.stackexchange.com/questions/1357/can-i-link-a-apache-2-0-library-into-software-under-gplv2

[4] https://www.gnu.org/licenses/license-compatibility.html

[5] Pamela S. Chestek, "A promise without a remedy: The supposed
incompatibility of the GPL v2 and Apache v2 licenses", Santa Clara
High Technology Law Journal, Vol 40, Issue 3, Article 2,
https://digitalcommons.law.scu.edu/cgi/viewcontent.cgi?article=1701&context=chtlj#:~:text=It%20is%20commonly%20accepted%20that,not%20permitted%20by%20the%20GPLv2.
34 changes: 15 additions & 19 deletions license-details/ptf-and-scapy.md
Original file line number Diff line number Diff line change
@@ -14,17 +14,7 @@ The ptf package is released under the Apache 2.0 license:

# Compatibility of GPL v2.0 and Apache 2.0 licenses

The claims of incompatibility in this section could use some good
references to back them up. Please suggest references if you know of
them.

| Python program A | ... imports Python | |
| with license | package B with license | Allowed? |
| ----------------- | ----------------------- | -------- |
| Apache-2.0 | Apache-2.0 | yes, same licenses |
| GPL-2.0-only | GPL-2.0-only | yes, same licenses |
| Apache-2.0 | GPL-2.0-only | no, incompatible licenses |
| GPL-2.0-only | Apache-2.0 | no, incompatible licenses |
See [this article](apache-and-gpl-v2-licenses.md).


# Consequences
@@ -33,17 +23,19 @@ Assuming everything above is correct, consider a Python program that
imports both the scapy and ptf packages _directly_, i.e. it imports
ptf directly, and it also imports scapy directly.

Can anyone publish such a program, and if so, under what license can
it be released?
Should P4.org publish such a program, and if so, under what license
should it be released?

It seems that the answer is "no", because there is no license that it
can be released under.
It seems that the answer is "no", because the argument for whether
this is allowed is too unclear.

It cannot be released under Apache-2.0, because it imports scapy,
which is GPL-2.0-only.
Should P4.org publish such a program under Apache-2.0? It seems
that the answer is "no", because the program imports scapy, which is
GPL-2.0-only. It is too unclear whether this is allowed.

It cannot be released under GPL-2.0-only, because it imports ptf,
which is Apache-2.0.
SHould P4.org publish such a program under GPL-2.0-only? It seems
that the answer is "no", because the program imports ptf, which is
Apache-2.0. Again, it is too unclear whether this is allowed.

There are at least a few Python programs in p4lang repositories that
currently import both the scapy and ptf packages, including these:
@@ -72,3 +64,7 @@ user.
Then in the cases where they write a program A that imports both scapy
and ptf in in A, they choose to use ptf under the GPL v2 license, and
also release program A under the GPL v2 license.

In cases where they write a program A that imports ptf, but not scapy,
then they have a choice whether to publish program A under the GPL v2
license, or the Apache-2.0 license.
Loading