Skip to content

Conversation

@mat007
Copy link
Contributor

@mat007 mat007 commented Feb 5, 2022

This makes it easier for license gathering tools to automatically find the license type and text. Moreover GitHub has API endpoints to query this: see https://docs.github.com/rest/reference/licenses#get-the-license-for-a-repository.

Closes #327

This makes it easier for license gathering tools to automatically find the license type and text. Moreover GitHub has API endpoints to query this: see https://docs.github.com/rest/reference/licenses#get-the-license-for-a-repository.

Signed-off-by: Mathieu Champlon <mathieu.champlon@docker.com>
@mat007 mat007 force-pushed the move-license-to-file branch from 7d79bfb to e4371f9 Compare February 5, 2022 08:26
@mat007 mat007 mentioned this pull request Feb 5, 2022
@thaJeztah
Copy link
Member

thaJeztah commented Feb 5, 2022

This looks to be BSD-2-Clause (actually wondering if it should've been BSD-3, but that's a separate discussion)

However, it looks to be somewhat different from the "vanilla" versions I found on opensource.org and choosealicense.com (which is what GitHub uses when "adding a license"). Some of the changes are in formatting, but also some changes in wording (could be based on an older version of the license perhaps??)

Here's some differences I noticed;

  • Some indentation / wrapping is different (guess we can fix that)
  • The BSD 2-Clause License line at the start of the file is missing (not sure if required, but it could be used to detect the license).
  • The Copyright year is missing (both opensource.org and choosealicense.com, mention <YEAR>
  • See individual source files for details. is added after copyright holders (perhaps that's ok, mostly wondering if that would be considered an extra "clause")
  • The line All rights reserved. (after the copyright line) is missing
  • Throughout the text, AUTHORS is used instead of COPYRIGHT HOLDERS. This could be either a modification that was made in this repository, or it could be that older versions of the BSD-2 license used that wording (unfortunately, no history there; license text was added in efb56d1)

If we would apply the above suggestions, and change it to use the "vanilla" text, it would look like:

BSD 2-Clause License

Copyright 2015 the authors and contributors. See individual source files for details.
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, this
   list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
   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 HOLDERS AND CONTRIBUTORS "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 OR CONTRIBUTORS 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.

Here's a diff (after I first reformatted the version in this PR (white-spacing, indentation, re-wrap some lines);

diff --git a/LICENSE-before b/LICENSE-after
index f94e9dd94..b3d04987f 100644
--- a/LICENSE-before
+++ b/LICENSE-after
@@ -1,4 +1,7 @@
-Copyright the authors and contributors. See individual source files for details.
+BSD 2-Clause License
+
+Copyright 2015 the authors and contributors. See individual source files for details.
+All rights reserved.

 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:
@@ -10,10 +13,10 @@ modification, are permitted provided that the following conditions are met:
    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 AUTHOR AND CONTRIBUTORS "AS IS"
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 AUTHOR OR CONTRIBUTORS BE LIABLE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 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

@thaJeztah
Copy link
Member

@justincormack @ijc PTAL (perhaps you know where some of the changes originate from, and/or if my suggestions are ok to make)

@ijc
Copy link
Collaborator

ijc commented Feb 5, 2022

TL;DR: I think @mat007 is ok to simply move the text without changing it.

The license text was taken from the header of multiple source files and comes from the bhyve->xhyve heritage, looks like it matches https://www.freebsd.org/copyright/freebsd-license/ (which is no surprise given bhyve is from FreeBSD).

Moving into another file is fine, but I'd be very wary of changing any license text in any way without contacting all of the copyright holders and checking they are happy -- unless you are the copyright holder you simply don't have the right to relicense.

Re the first hunk I see source files with copyrights from 2008 so saying 2015 doesn't seem right. Personally I think specifying the date only really matters in the source files themselves and the "See individual source files for details" covers that.

Re the second hunk I'd be inclined to say that the "editorial" changes to the text itself are simply not worth the risk/hassle of changing.

If you do want to change the license I'd suggest doing that in a separate and dedicated PR.

@thaJeztah
Copy link
Member

Personally I think specifying the date only really matters in the source files themselves and the "See individual source files for details" covers that.

Yes, I usually prefer keeping years out as well; as you mentioned, the year will differ for each file (so preferably should be either mentioned in each file's header, or just left out altogether, implying "copyright == first year of source publication")). I got confused a bit by the examples mentioning <YEAR> (pointy brackets), which (I think) usually is convention for "compulsory", so perhaps the license required that.

The license text was taken from the header of multiple source files and comes from the bhyve->xhyve heritage, looks like it matches https://www.freebsd.org/copyright/freebsd-license/ (which is no surprise given bhyve is from FreeBSD).

Interesting, so FreeBSD license !== 100% the same (in wording) as BSD-2 here (AUTHORS vs COPYRIGHT HOLDERS) indeed. I guess that would also mean that we can't put BSD 2-Clause License at the top?

Wondering (in that case) if there's a correct SPDX identifier for it, as (going through the list at https://spdx.org/licenses/) it looks to be a variation of both, but it's neither of these;

(I wonder if this requires a look from "legal" to determine if that makes it a "different" license, and/or if that makes it "compatible" with other licenses in use)

Re the second hunk I'd be inclined to say that the "editorial" changes to the text itself are simply not worth the risk/hassle of changing.

Do you think the whitespace changes / wrapping are ok? (to makes the diff between a straight BSD-2 license easier to see)

In that case (removing leading whitespace, the BSD 2-Clause License identifier, YEAR and the All rights reserved. line), it would look like;

Copyright the authors and contributors. See individual source files for details.

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, this
   list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
   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 AUTHOR AND CONTRIBUTORS "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 AUTHOR OR CONTRIBUTORS 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.

@thaJeztah
Copy link
Member

Actually, looking closer, I see that https://spdx.org/licenses/BSD-2-Clause-FreeBSD.html points to the URL you mentioned, and uses BSD-2-Clause-FreeBSD as SPDX identifier.

But:

Deprecated

This license has been deprecated since license list version 3.10.

and

This license was deprecated because BSD-2-Clause-Views has been added, as a more generalized version; and because FreeBSD project community members have indicated that the final sentence is not part of that project's code license.

Which points to https://spdx.org/licenses/BSD-2-Clause-Views.html, but that (again) uses THE COPYRIGHT HOLDERS AND CONTRIBUTORS ... confusing

@thaJeztah
Copy link
Member

Looks like the important bit there is the sentence after the block we have;

The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of the FreeBSD Project.

Which is not included in the license in this repository

(sorry for all the noise, just trying to figure out what license it actually is, and I guess the best answer is "some custom license")?

@ijc
Copy link
Collaborator

ijc commented Feb 5, 2022

the examples mentioning (pointy brackets), which (I think) usually is convention for "compulsory",

IIRC the year used to be required by US law or convention or something but (also IIRC) that hasn't been true for some considerable time.

(sorry for all the noise, just trying to figure out what license it actually is, and I guess the best answer is "some custom license")?

The licence is what the copyright holders have written in the source files, any "name" or SPDX tag which matches that exact wording is fine to use. If there is no tag or name which matches the precise text then just don't include one!

I don't see the problem with using an SPDX tag which says "Deprecated" if that is the license actually used on the code. The tag should reflect the reality of the license that the copyright holders chose, which has nothing to do with whether that license is deprecated today.

I think rewrapping is fine (if pointless).

@mat007
Copy link
Contributor Author

mat007 commented Feb 9, 2022

So, is there anyone to approve the PR? 😁

Copy link
Collaborator

@ijc ijc left a comment

Choose a reason for hiding this comment

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

This pure-motion change is fine by me (FWIW)

@djs55 djs55 merged commit 3cb0d54 into moby:master Feb 20, 2022
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

Successfully merging this pull request may close these issues.

LICENSE / COPYING missing

4 participants