Closed Bug 1395449 Opened 7 years ago Closed 5 years ago

"Migrating" code from the BSD (2 clauses) license to MPL

Categories

(mozilla.org :: Licensing, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: glandium, Assigned: mhoye)

References

Details

We've imported jemalloc from FreeBSD close to 10 years ago. Its original license is the 2-clauses BSD license, the full text of which is the following:

 Copyright (C) 2006-2008 Jason Evans <jasone@FreeBSD.org>.
 All rights reserved.

 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:
 1. Redistributions of source code must retain the above copyright
    notice(s), this list of conditions and the following disclaimer as
    the first lines of this file unmodified other than the possible
    addition of one or more copyright notices.
 2. Redistributions in binary form must reproduce the above copyright
    notice(s), this list of conditions and the following disclaimer in
    the documentation and/or other materials provided with the
    distribution.

 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) ``AS IS'' AND ANY
 EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) BE
 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
 BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
 OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

(https://hg.mozilla.org/mozilla-central/file/04b6be50a252/memory/mozjemalloc/mozjemalloc.cpp#l4)

In the close to 10 years that followed, we've applied local changes, as well as backported upstream changes from newer versions of jemalloc, under the same license. Which means, first issue, the copyright notice in there is utterly outdated (Ironically, upstream has additional copyright notices including Mozilla: https://github.com/jemalloc/jemalloc/blob/dev/COPYING)

Anyways, we've recently decided to embrace our fork entirely (we were hoping to be able to use new upstream versions, but that didn't pan out), and started doing a lot of cleanup and have plans for changes in the future.

One of the upcoming changes is, from practical reasons, to merge other memory allocation related code we have in the Firefox tree, and that is licensed under MPL. Those MPL parts have largely been written by Mozilla employees, so they could theoretically be relicensed under the 2-clause BSD license, but it seems like a good occasion, considering the long term commitment to maintain and improve our fork (with a rename, at some point ; it's still called mozjemalloc right now), to think about the license we want to apply to the new code.

Mozilla generally doesn't release its own code under the BSD license for various reasons, and prefers MPL 2.0 or Apache 2.0, and I, personally, would rather use one of those latter two licenses, with a preference for the MPL over the AL.

Per the license itself, the BSD license text can't be removed (until most of the actual code under that license is gone).

What I'm thinking is to:
- Add the missing copyright notice for the code that has been written in mozjemalloc so far (Copyright (C) 2007-2017 Mozilla Foundation. All rights reserved.)
- Add a MPL 2.0 header at the top of the file, and a phrase under it that says something like "Large parts of this file are under the following license:", which would be followed by the copyright notice and BSD license text.

Does that sound right?
> (Ironically, upstream has additional copyright notices including Mozilla: https://github.com/jemalloc/jemalloc/blob/dev/COPYING)

Funnily enough, I actually updated license.html in bug 1363992: https://hg.mozilla.org/mozilla-central/file/04b6be50a252/toolkit/content/license.html#l3903
Yes, code under the BSD license can be "relicensed" under the MPL as long as the BSD notice is retained. If you are sure we aren't going to upset "upstream" (I realise that's a nebulous concept in this case) then I see no reason why we shouldn't do it, as we have a clear practical reason to want to (i.e. merging in other MPLed code). The correct procedure is as follows:

1) Add an MPL 2 header to the top of each file
2) Add a comment at the top of the retained BSD license header which says:

"Portions of this file were originally under the following license:"

(We say "were" rather than "are (still) under" because we intend the MPL to apply to the entire file; we are not trying to keep a few lines as BSD, which is administratively very complex and gains you almost nothing. If people want to extract code under the BSD licence, they can look in source control for the last BSD-only revision, and take code from there.)

You can add the missing copyright line(s) to the BSD section, or not, as you choose. Copyright lines of that type have near-zero legal effect, so we care very little about them indeed.

Let me know if you need more guidance.

Gerv
What about license.html?
Blocks: 1395776
No change, I'd expect. The MPL is already listed, and we can't remove the jemalloc entry for the same reason we can't take it off the source code files.

Gerv
Assignee: gerv → mhoye

Mike, do we still need to act on this?

Flags: needinfo?(mh+mozilla)

This was already acted upon in bug 1395776.

Status: NEW → RESOLVED
Closed: 5 years ago
Flags: needinfo?(mh+mozilla)
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.