# Trying to understand compatibility details among: MPL 2.0, Apache 2.0, LGPL and GPL



## sidetone (May 2, 2022)

Apache 2.0 isn't compatible with GPL2, because of patent and infringement differences. LGPL2 also has mention of these terms, so I don't expect Apache 2.0 to compatible with it either. Apache 2.0 is determined compatible with GPL3. Of note, LGPL3 doesn't have mention of infringement and patents. The clauses and justifications from these GPL licenses mentioned are reasonable, though some are incompatible with Apache 2.0 because of technical differences.

MPL 2.0 is said to be compatible for use alongside use for GPL and LGPL code. I wonder if the differences in infringement and patents that allow counterclaims makes the difference for it. Also, the FAQ states, that the code needs to be dual licensed to MPL and GPL for this to work. GPL2 and LGPL2 aren't current, so assumptions here aren't made about these, except for when dual licensed to include these.

For commonly used libraries, a BSD style license is known to up upward compatible with everything else. Apache 2.0 wouldn't be ideal, because of its incompatibility with GPL2, which many programs are of. MPL 2.0 is said to be compatible, but it's when it's under a larger work including GPL code and when a project is dual licensed. MPL 2.0 allows static and dynamic linking, so without regards to GPL, it would be good for commonly used libraries.

I'm also trying to understand how LibreOffice does around these licenses. I keep seeing that MPL 2.0 is allowed to absorb Apache 2.0 code into the product. They're compatible to be used side by side, but I'm not sure that their differences allow the code to be merged into MPL 2.0. I also have doubts that MPL 2.0 can be absorbed into Apache 2.0, despite that people imply that it can. If it's about indicating which code is outside of the terms, that's easy, shift everything to files under the licenses. I'm not sure that the patent and infringement part of MPL 2.0, the part about counter/cross-suits allows it to be absorbed into Apache license 2.0.

LibreOffice uses a combination of LGPL, GPL, Apache 2.0 and MPL 2.0. Some of these are compatible together, but some aren't when used in that combination of all of them. Maybe it depends on how they're tied together, and that those incompatible parts are directly used with each other. LibreOffice also licenses their product for MPL 2.0, but dual licenses a lot or all of it to LGPL3.

They keep saying how LibreOffice is allowed to take code that was added to Apache OpenOffice. I understand that a lot of it is the Apache Foundation adhering to terms that are more strict than its license allows. Also, that some of it was that the code was released to those foundations and it was allowed for them to set the terms as those rights were passed on to those different organizations. I believe Apache 2.0 and MPL 2.0 code can be side by side, by being two separate pieces working together. However, they say it like the MPL 2.0 code eats the Apache 2.0 code, while both license terms are preserved and honored, which I don't think the terms allow that.

For license compatibility, I'm curious if MPL is good for shared libraries, and if Apache 2.0 isn't (limited to GPL2 incompatibilities). It's often implied that GPL can eat up MPL 2.0, but I'm dubious about that. LGPL3 is good for libraries, though, MPL 2.0 is better in terms of allowing more linking, and it does the same job of keeping its code separated from other licensed code. MPL 2.0 has patent infringement protections for code, while LGPL3 doesn't mention it. MPL2.0 is more compatible with other code than LGPL is, with the exception of GPL licenses.

MPL 2.0 is relatively less popular, so there's not as much analysis on it for use with other licenses.

Edit: https://www.gnu.org/licenses/license-list.html and https://www.mozilla.org/en-US/MPL/2.0/FAQ/ have better descriptions about combinations of use of (L)GPL, MPL 2.0, and Apache License 2.0. The part about using MPL 2.0 with Apache License 2.0 is unclear, but from that, these two look compatible.


----------

