public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH 0/2] Drop suggestions of alternative acceptable licenses
@ 2020-07-02 11:24 Leif Lindholm
  2020-07-02 11:24 ` [PATCH 1/2] Revert "BaseTools/PatchCheck.py: Add LicenseCheck" Leif Lindholm
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Leif Lindholm @ 2020-07-02 11:24 UTC (permalink / raw)
  To: devel
  Cc: Andrew Fish, Laszlo Ersek, Michael D Kinney, Shenglei Zhang,
	Yuwei Chen, Liming Gao

(Echoing https://bugzilla.tianocore.org/show_bug.cgi?id=2834:)
In the past, the TianoCore Contribution Agreement provided equal to what
the (+patent) gives us, but also for all the alternative licenses listed
under "Code Contributions". When the contribution agreement was dropped,
no conversation was had about this aspect.

Until this issue is resolved, only code licensed under edk2+patent should
be accepted into the project.

It is not obvious whether modifications to non-bsd+patent code that *was*
contributed under the TCA can still be accepted.

This set deletes the current version of license checking in PatchCheck.py
that was added in a4cfb842fca9. It also deletes all references to other
acceptable licenses (and public domain).

This gives us a clean slate to make informed decisions on what is and is
not acceptable for this project.

The statement that "Contributions using other licenses might be accepted,
but further review will be required." is intentionally retained.

Leif Lindholm (2):
  Revert "BaseTools/PatchCheck.py: Add LicenseCheck"
  ReadMe.rst: delete statements about other accepted licenses

Cc: Shenglei Zhang <shenglei.zhang@intel.com>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Cc: Liming Gao <liming.gao@intel.com>

 BaseTools/Scripts/PatchCheck.py | 50 ---------------------------------
 ReadMe.rst                      | 13 ++-------
 2 files changed, 2 insertions(+), 61 deletions(-)

-- 
2.20.1

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/2] Revert "BaseTools/PatchCheck.py: Add LicenseCheck"
  2020-07-02 11:24 [PATCH 0/2] Drop suggestions of alternative acceptable licenses Leif Lindholm
@ 2020-07-02 11:24 ` Leif Lindholm
  2020-07-03 16:20   ` Laszlo Ersek
  2020-07-02 11:24 ` [PATCH 2/2] ReadMe.rst: delete statements about other accepted licenses Leif Lindholm
  2020-07-03 16:10 ` [PATCH 0/2] Drop suggestions of alternative acceptable licenses Laszlo Ersek
  2 siblings, 1 reply; 11+ messages in thread
From: Leif Lindholm @ 2020-07-02 11:24 UTC (permalink / raw)
  To: devel
  Cc: Andrew Fish, Laszlo Ersek, Michael D Kinney, Shenglei Zhang,
	Yuwei Chen, Liming Gao

This reverts commit a4cfb842fca9693a330cb5435284c1ee8bfbbace.
This commit suggests inclusion of non-edk2+license content without
a contribution agreement is something the community has made a
decision on, which is incorrect.

Cc: Shenglei Zhang <shenglei.zhang@intel.com>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Leif Lindholm <leif@nuviainc.com>
---
 BaseTools/Scripts/PatchCheck.py | 50 ---------------------------------
 1 file changed, 50 deletions(-)

diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py
index e38cf61f93da..6372f71592d3 100755
--- a/BaseTools/Scripts/PatchCheck.py
+++ b/BaseTools/Scripts/PatchCheck.py
@@ -305,49 +305,12 @@ class GitDiffCheck:
         self.line_num = 0
         self.state = START
         self.new_bin = []
-        self.LicenseCheck(self.lines, self.count)
         while self.line_num < self.count and self.format_ok:
             line_num = self.line_num
             self.run()
             assert(self.line_num > line_num)
         self.report_message_result()
 
-    def LicenseCheck(self, lines, count):
-        self.ok = True
-        self.startcheck = False
-        self.license = True
-        line_index = 0
-        for line in lines:
-            if line.startswith('--- /dev/null'):
-                nextline = lines[line_index + 1]
-                added_file = self.Readdedfileformat.search(nextline).group(1)
-                added_file_extension = os.path.splitext(added_file)[1]
-                if added_file_extension in self.file_extension_list:
-                    self.startcheck = True
-                    self.license = False
-            if self.startcheck and self.license_format_preflix in line:
-                if self.bsd2_patent in line or self.bsd3_patent in line:
-                    self.license = True
-                else:
-                    for optional_license in self.license_optional_list:
-                        if optional_license in line:
-                            self.license = True
-                            self.warning(added_file)
-            if line_index + 1 == count or lines[line_index + 1].startswith('diff --') and self.startcheck:
-                if not self.license:
-                    error_message = "Invalid License in: " + added_file
-                    self.error(error_message)
-                self.startcheck = False
-                self.license = True
-            line_index = line_index + 1
-
-    def warning(self, *err):
-        count = 0
-        for line in err:
-            warning_format = 'Warning: License accepted but not BSD plus patent license in'
-            print(warning_format, line)
-            count += 1
-
     def report_message_result(self):
         if Verbose.level < Verbose.NORMAL:
             return
@@ -534,19 +497,6 @@ class GitDiffCheck:
             print(prefix, line)
             count += 1
 
-    license_format_preflix = 'SPDX-License-Identifier'
-
-    bsd2_patent = 'BSD-2-Clause-Patent'
-
-    bsd3_patent = 'BSD-3-Clause-Patent'
-
-    license_optional_list = ['BSD-2-Clause', 'BSD-3-Clause', 'MIT', 'Python-2.0', 'Zlib']
-
-    Readdedfileformat = re.compile(r'\+\+\+ b\/(.*)\n')
-
-    file_extension_list = [".c", ".h", ".inf", ".dsc", ".dec", ".py", ".bat", ".sh", ".uni", ".yaml", ".fdf", ".inc", "yml", ".asm", \
-                          ".asm16", ".asl", ".vfr", ".s", ".S", ".aslc", ".nasm", ".nasmb", ".idf", ".Vfr", ".H"]
-
 class CheckOnePatch:
     """Checks the contents of a git email formatted patch.
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/2] ReadMe.rst: delete statements about other accepted licenses
  2020-07-02 11:24 [PATCH 0/2] Drop suggestions of alternative acceptable licenses Leif Lindholm
  2020-07-02 11:24 ` [PATCH 1/2] Revert "BaseTools/PatchCheck.py: Add LicenseCheck" Leif Lindholm
@ 2020-07-02 11:24 ` Leif Lindholm
  2020-07-03 16:24   ` Laszlo Ersek
  2020-07-03 16:10 ` [PATCH 0/2] Drop suggestions of alternative acceptable licenses Laszlo Ersek
  2 siblings, 1 reply; 11+ messages in thread
From: Leif Lindholm @ 2020-07-02 11:24 UTC (permalink / raw)
  To: devel; +Cc: Andrew Fish, Laszlo Ersek, Michael D Kinney

In the past, the TianoCore Contribution Agreement provided equal to what
the (+patent) gives us, but also for all the alternative licenses listed
under "Code Contributions". When the contribution agreement was dropped,
no conversation was had about this aspect.

Until this issue is resolved, only code licensed under edk2+patent should
be accepted into the project.

This addresses, but does not resolve,
https://bugzilla.tianocore.org/show_bug.cgi?id=2834

Cc: Andrew Fish <afish@apple.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Leif Lindholm <leif@nuviainc.com>
---
 ReadMe.rst | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/ReadMe.rst b/ReadMe.rst
index d597e34efc22..79f07240039e 100644
--- a/ReadMe.rst
+++ b/ReadMe.rst
@@ -111,23 +111,14 @@ To make a contribution to a TianoCore project, follow these steps.
     that the project documents on its web page. If the process is
     not documented, then submit the code on development email list
     for the project.
-#. It is preferred that contributions are submitted using the same
-    copyright license as the base project. When that is not possible,
-    then contributions using the following licenses can be accepted:
-
--  BSD (2-clause): http://opensource.org/licenses/BSD-2-Clause
--  BSD (3-clause): http://opensource.org/licenses/BSD-3-Clause
--  MIT: http://opensource.org/licenses/MIT
--  Python-2.0: http://opensource.org/licenses/Python-2.0
--  Zlib: http://opensource.org/licenses/Zlib
+#. Contributions must be submitted using the same copyright license
+    as the base project.
 
 For documentation:
 
 -  FreeBSD Documentation License
     https://www.freebsd.org/copyright/freebsd-doc-license.html
 
-Contributions of code put into the public domain can also be accepted.
-
 Contributions using other licenses might be accepted, but further
 review will be required.
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 0/2] Drop suggestions of alternative acceptable licenses
  2020-07-02 11:24 [PATCH 0/2] Drop suggestions of alternative acceptable licenses Leif Lindholm
  2020-07-02 11:24 ` [PATCH 1/2] Revert "BaseTools/PatchCheck.py: Add LicenseCheck" Leif Lindholm
  2020-07-02 11:24 ` [PATCH 2/2] ReadMe.rst: delete statements about other accepted licenses Leif Lindholm
@ 2020-07-03 16:10 ` Laszlo Ersek
  2 siblings, 0 replies; 11+ messages in thread
From: Laszlo Ersek @ 2020-07-03 16:10 UTC (permalink / raw)
  To: Leif Lindholm, devel
  Cc: Andrew Fish, Michael D Kinney, Shenglei Zhang, Yuwei Chen,
	Liming Gao

On 07/02/20 13:24, Leif Lindholm wrote:
> (Echoing https://bugzilla.tianocore.org/show_bug.cgi?id=2834:)
> In the past, the TianoCore Contribution Agreement provided equal to what
> the (+patent) gives us, but also for all the alternative licenses listed
> under "Code Contributions". When the contribution agreement was dropped,
> no conversation was had about this aspect.

Some crucial words seem to be missing from the above paragraph:

- "the TianoCore Contribution Agreement provided [???] equal to" -- do
you mean "rights"?

- "what the [???] (+patent) gives us" -- do you mean "2-clause BSDL"?

Thanks
Laszlo

> 
> Until this issue is resolved, only code licensed under edk2+patent should
> be accepted into the project.
> 
> It is not obvious whether modifications to non-bsd+patent code that *was*
> contributed under the TCA can still be accepted.
> 
> This set deletes the current version of license checking in PatchCheck.py
> that was added in a4cfb842fca9. It also deletes all references to other
> acceptable licenses (and public domain).
> 
> This gives us a clean slate to make informed decisions on what is and is
> not acceptable for this project.
> 
> The statement that "Contributions using other licenses might be accepted,
> but further review will be required." is intentionally retained.
> 
> Leif Lindholm (2):
>   Revert "BaseTools/PatchCheck.py: Add LicenseCheck"
>   ReadMe.rst: delete statements about other accepted licenses
> 
> Cc: Shenglei Zhang <shenglei.zhang@intel.com>
> Cc: Yuwei Chen <yuwei.chen@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> 
>  BaseTools/Scripts/PatchCheck.py | 50 ---------------------------------
>  ReadMe.rst                      | 13 ++-------
>  2 files changed, 2 insertions(+), 61 deletions(-)
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/2] Revert "BaseTools/PatchCheck.py: Add LicenseCheck"
  2020-07-02 11:24 ` [PATCH 1/2] Revert "BaseTools/PatchCheck.py: Add LicenseCheck" Leif Lindholm
@ 2020-07-03 16:20   ` Laszlo Ersek
  2020-07-07 15:57     ` [edk2-devel] " Leif Lindholm
  0 siblings, 1 reply; 11+ messages in thread
From: Laszlo Ersek @ 2020-07-03 16:20 UTC (permalink / raw)
  To: Leif Lindholm, devel
  Cc: Andrew Fish, Michael D Kinney, Shenglei Zhang, Yuwei Chen,
	Liming Gao

On 07/02/20 13:24, Leif Lindholm wrote:
> This reverts commit a4cfb842fca9693a330cb5435284c1ee8bfbbace.
> This commit suggests inclusion of non-edk2+license content without

The expression "non-edk2+license" is a typo.

I think you meant "non-BSD-2-Clause-Patent".

> a contribution agreement is something the community has made a
> decision on, which is incorrect.

I'm OK with commit a4cfb842fca9 being reverted, as this solves the
practical problem of adding generated files.

Acked-by: Laszlo Ersek <lersek@redhat.com>

That said, I *still* don't grasp the more general problem you refer to.

Can we express it as follows (using commits 6b621f958123 and
6f21d772aa6b as reference):

(1) Content under OvmfPkg/Include/IndustryStandard/Xen was introduced
under the MIT license in commit 6b621f958123. That commit was marked with:

> License: This patch adds many files under the MIT licence.
> Contributed-under: TianoCore Contribution Agreement 1.0

and the header files also contained open-coded instances of the MIT
license. (These would later be replaced with SPDX identifiers in commit
6f21d772aa6b.)

As a result, these files effectively granted use and distribution rights
under the MIT license, *plus* a patent grant (per TCA).

(2) If we did the same today (that is, add new MIT-licensed files, but
no "Contributed-under: TCA" line on the commit message), then that would
grant use and distribution rights under the "MIT license", and *no*
patent grant.

Is this the issue you're thinking of?


So are we basically looking to replace (for example):

  SPDX-License-Identifier: MIT

with *something* like:

  SPDX-License-Identifier: MIT-Patent

? (Assuming the latter exists -- which it doesn't, at the moment?)

Thanks
Laszlo

> 
> Cc: Shenglei Zhang <shenglei.zhang@intel.com>
> Cc: Yuwei Chen <yuwei.chen@intel.com>
> Cc: Liming Gao <liming.gao@intel.com>
> Signed-off-by: Leif Lindholm <leif@nuviainc.com>
> ---
>  BaseTools/Scripts/PatchCheck.py | 50 ---------------------------------
>  1 file changed, 50 deletions(-)
> 
> diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py
> index e38cf61f93da..6372f71592d3 100755
> --- a/BaseTools/Scripts/PatchCheck.py
> +++ b/BaseTools/Scripts/PatchCheck.py
> @@ -305,49 +305,12 @@ class GitDiffCheck:
>          self.line_num = 0
>          self.state = START
>          self.new_bin = []
> -        self.LicenseCheck(self.lines, self.count)
>          while self.line_num < self.count and self.format_ok:
>              line_num = self.line_num
>              self.run()
>              assert(self.line_num > line_num)
>          self.report_message_result()
>  
> -    def LicenseCheck(self, lines, count):
> -        self.ok = True
> -        self.startcheck = False
> -        self.license = True
> -        line_index = 0
> -        for line in lines:
> -            if line.startswith('--- /dev/null'):
> -                nextline = lines[line_index + 1]
> -                added_file = self.Readdedfileformat.search(nextline).group(1)
> -                added_file_extension = os.path.splitext(added_file)[1]
> -                if added_file_extension in self.file_extension_list:
> -                    self.startcheck = True
> -                    self.license = False
> -            if self.startcheck and self.license_format_preflix in line:
> -                if self.bsd2_patent in line or self.bsd3_patent in line:
> -                    self.license = True
> -                else:
> -                    for optional_license in self.license_optional_list:
> -                        if optional_license in line:
> -                            self.license = True
> -                            self.warning(added_file)
> -            if line_index + 1 == count or lines[line_index + 1].startswith('diff --') and self.startcheck:
> -                if not self.license:
> -                    error_message = "Invalid License in: " + added_file
> -                    self.error(error_message)
> -                self.startcheck = False
> -                self.license = True
> -            line_index = line_index + 1
> -
> -    def warning(self, *err):
> -        count = 0
> -        for line in err:
> -            warning_format = 'Warning: License accepted but not BSD plus patent license in'
> -            print(warning_format, line)
> -            count += 1
> -
>      def report_message_result(self):
>          if Verbose.level < Verbose.NORMAL:
>              return
> @@ -534,19 +497,6 @@ class GitDiffCheck:
>              print(prefix, line)
>              count += 1
>  
> -    license_format_preflix = 'SPDX-License-Identifier'
> -
> -    bsd2_patent = 'BSD-2-Clause-Patent'
> -
> -    bsd3_patent = 'BSD-3-Clause-Patent'
> -
> -    license_optional_list = ['BSD-2-Clause', 'BSD-3-Clause', 'MIT', 'Python-2.0', 'Zlib']
> -
> -    Readdedfileformat = re.compile(r'\+\+\+ b\/(.*)\n')
> -
> -    file_extension_list = [".c", ".h", ".inf", ".dsc", ".dec", ".py", ".bat", ".sh", ".uni", ".yaml", ".fdf", ".inc", "yml", ".asm", \
> -                          ".asm16", ".asl", ".vfr", ".s", ".S", ".aslc", ".nasm", ".nasmb", ".idf", ".Vfr", ".H"]
> -
>  class CheckOnePatch:
>      """Checks the contents of a git email formatted patch.
>  
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] ReadMe.rst: delete statements about other accepted licenses
  2020-07-02 11:24 ` [PATCH 2/2] ReadMe.rst: delete statements about other accepted licenses Leif Lindholm
@ 2020-07-03 16:24   ` Laszlo Ersek
  0 siblings, 0 replies; 11+ messages in thread
From: Laszlo Ersek @ 2020-07-03 16:24 UTC (permalink / raw)
  To: Leif Lindholm, devel; +Cc: Andrew Fish, Michael D Kinney

On 07/02/20 13:24, Leif Lindholm wrote:
> In the past, the TianoCore Contribution Agreement provided equal to what
> the (+patent) gives us, but also for all the alternative licenses listed
> under "Code Contributions". When the contribution agreement was dropped,
> no conversation was had about this aspect.

Please see my wording questions under the blurb.

> 
> Until this issue is resolved, only code licensed under edk2+patent should
> be accepted into the project.
> 
> This addresses, but does not resolve,
> https://bugzilla.tianocore.org/show_bug.cgi?id=2834
> 
> Cc: Andrew Fish <afish@apple.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Signed-off-by: Leif Lindholm <leif@nuviainc.com>
> ---
>  ReadMe.rst | 13 ++-----------
>  1 file changed, 2 insertions(+), 11 deletions(-)
> 
> diff --git a/ReadMe.rst b/ReadMe.rst
> index d597e34efc22..79f07240039e 100644
> --- a/ReadMe.rst
> +++ b/ReadMe.rst
> @@ -111,23 +111,14 @@ To make a contribution to a TianoCore project, follow these steps.
>      that the project documents on its web page. If the process is
>      not documented, then submit the code on development email list
>      for the project.
> -#. It is preferred that contributions are submitted using the same
> -    copyright license as the base project. When that is not possible,
> -    then contributions using the following licenses can be accepted:
> -
> --  BSD (2-clause): http://opensource.org/licenses/BSD-2-Clause
> --  BSD (3-clause): http://opensource.org/licenses/BSD-3-Clause
> --  MIT: http://opensource.org/licenses/MIT
> --  Python-2.0: http://opensource.org/licenses/Python-2.0
> --  Zlib: http://opensource.org/licenses/Zlib
> +#. Contributions must be submitted using the same copyright license
> +    as the base project.
>  
>  For documentation:
>  
>  -  FreeBSD Documentation License
>      https://www.freebsd.org/copyright/freebsd-doc-license.html
>  
> -Contributions of code put into the public domain can also be accepted.
> -
>  Contributions using other licenses might be accepted, but further
>  review will be required.
>  
> 

*IF* the problem you describe is real (honestly I've never *understood*
the problem statement before), then I think this change reflects that.
So here's a conditional:

Acked-by: Laszlo Ersek <lersek@redhat.com>

I defer to Mike on this though, as Mike drove
<https://bugzilla.tianocore.org/show_bug.cgi?id=1373>.

Thanks,
Laszlo


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [edk2-devel] [PATCH 1/2] Revert "BaseTools/PatchCheck.py: Add LicenseCheck"
  2020-07-03 16:20   ` Laszlo Ersek
@ 2020-07-07 15:57     ` Leif Lindholm
  2020-07-14  2:28       ` Liming Gao
  0 siblings, 1 reply; 11+ messages in thread
From: Leif Lindholm @ 2020-07-07 15:57 UTC (permalink / raw)
  To: devel, lersek
  Cc: Andrew Fish, Michael D Kinney, Shenglei Zhang, Yuwei Chen,
	Liming Gao

On Fri, Jul 03, 2020 at 18:20:26 +0200, Laszlo Ersek wrote:
> On 07/02/20 13:24, Leif Lindholm wrote:
> > This reverts commit a4cfb842fca9693a330cb5435284c1ee8bfbbace.
> > This commit suggests inclusion of non-edk2+license content without
> 
> The expression "non-edk2+license" is a typo.
> 
> I think you meant "non-BSD-2-Clause-Patent".

Err, yes. Sorry.

> > a contribution agreement is something the community has made a
> > decision on, which is incorrect.
> 
> I'm OK with commit a4cfb842fca9 being reverted, as this solves the
> practical problem of adding generated files.
> 
> Acked-by: Laszlo Ersek <lersek@redhat.com>
> 
> That said, I *still* don't grasp the more general problem you refer to.
> 
> Can we express it as follows (using commits 6b621f958123 and
> 6f21d772aa6b as reference):
> 
> (1) Content under OvmfPkg/Include/IndustryStandard/Xen was introduced
> under the MIT license in commit 6b621f958123. That commit was marked with:
> 
> > License: This patch adds many files under the MIT licence.
> > Contributed-under: TianoCore Contribution Agreement 1.0
> 
> and the header files also contained open-coded instances of the MIT
> license. (These would later be replaced with SPDX identifiers in commit
> 6f21d772aa6b.)
> 
> As a result, these files effectively granted use and distribution rights
> under the MIT license, *plus* a patent grant (per TCA).

Correct.

> (2) If we did the same today (that is, add new MIT-licensed files, but
> no "Contributed-under: TCA" line on the commit message), then that would
> grant use and distribution rights under the "MIT license", and *no*
> patent grant.
> 
> Is this the issue you're thinking of?

Yes.

> So are we basically looking to replace (for example):
> 
>   SPDX-License-Identifier: MIT
> 
> with *something* like:
> 
>   SPDX-License-Identifier: MIT-Patent
> 
> ? (Assuming the latter exists -- which it doesn't, at the moment?)

It doesn't.

For BSD3/BSD4, we can do what the BSD distros do and use (for example)
SPDX-License-Identifier: BSD-3-Clause AND BSD-2-Clause-Patent

It is not clear to me if (for example) "MIT AND BSD-2-Clause-Patent"
is a valid expression. But what about "public domain"? Do we figure
out a jurisdiction in which public domain content can clearly have
arbitrary licenses applied to it and ask someone there to relicense it
to something we can accept?

If we decide the explicit patent grant isn't important, why did we add
it in the first place? If we decide it is important, we need to
actively make a decision on whether we can ever sidestep it, and if so
under what circumstances. (e.g.: "we permit it for tools" - but then
the code generation aspect also needs to be covered)

Regards,

Leif

> Thanks
> Laszlo
> 
> > 
> > Cc: Shenglei Zhang <shenglei.zhang@intel.com>
> > Cc: Yuwei Chen <yuwei.chen@intel.com>
> > Cc: Liming Gao <liming.gao@intel.com>
> > Signed-off-by: Leif Lindholm <leif@nuviainc.com>
> > ---
> >  BaseTools/Scripts/PatchCheck.py | 50 ---------------------------------
> >  1 file changed, 50 deletions(-)
> > 
> > diff --git a/BaseTools/Scripts/PatchCheck.py b/BaseTools/Scripts/PatchCheck.py
> > index e38cf61f93da..6372f71592d3 100755
> > --- a/BaseTools/Scripts/PatchCheck.py
> > +++ b/BaseTools/Scripts/PatchCheck.py
> > @@ -305,49 +305,12 @@ class GitDiffCheck:
> >          self.line_num = 0
> >          self.state = START
> >          self.new_bin = []
> > -        self.LicenseCheck(self.lines, self.count)
> >          while self.line_num < self.count and self.format_ok:
> >              line_num = self.line_num
> >              self.run()
> >              assert(self.line_num > line_num)
> >          self.report_message_result()
> >  
> > -    def LicenseCheck(self, lines, count):
> > -        self.ok = True
> > -        self.startcheck = False
> > -        self.license = True
> > -        line_index = 0
> > -        for line in lines:
> > -            if line.startswith('--- /dev/null'):
> > -                nextline = lines[line_index + 1]
> > -                added_file = self.Readdedfileformat.search(nextline).group(1)
> > -                added_file_extension = os.path.splitext(added_file)[1]
> > -                if added_file_extension in self.file_extension_list:
> > -                    self.startcheck = True
> > -                    self.license = False
> > -            if self.startcheck and self.license_format_preflix in line:
> > -                if self.bsd2_patent in line or self.bsd3_patent in line:
> > -                    self.license = True
> > -                else:
> > -                    for optional_license in self.license_optional_list:
> > -                        if optional_license in line:
> > -                            self.license = True
> > -                            self.warning(added_file)
> > -            if line_index + 1 == count or lines[line_index + 1].startswith('diff --') and self.startcheck:
> > -                if not self.license:
> > -                    error_message = "Invalid License in: " + added_file
> > -                    self.error(error_message)
> > -                self.startcheck = False
> > -                self.license = True
> > -            line_index = line_index + 1
> > -
> > -    def warning(self, *err):
> > -        count = 0
> > -        for line in err:
> > -            warning_format = 'Warning: License accepted but not BSD plus patent license in'
> > -            print(warning_format, line)
> > -            count += 1
> > -
> >      def report_message_result(self):
> >          if Verbose.level < Verbose.NORMAL:
> >              return
> > @@ -534,19 +497,6 @@ class GitDiffCheck:
> >              print(prefix, line)
> >              count += 1
> >  
> > -    license_format_preflix = 'SPDX-License-Identifier'
> > -
> > -    bsd2_patent = 'BSD-2-Clause-Patent'
> > -
> > -    bsd3_patent = 'BSD-3-Clause-Patent'
> > -
> > -    license_optional_list = ['BSD-2-Clause', 'BSD-3-Clause', 'MIT', 'Python-2.0', 'Zlib']
> > -
> > -    Readdedfileformat = re.compile(r'\+\+\+ b\/(.*)\n')
> > -
> > -    file_extension_list = [".c", ".h", ".inf", ".dsc", ".dec", ".py", ".bat", ".sh", ".uni", ".yaml", ".fdf", ".inc", "yml", ".asm", \
> > -                          ".asm16", ".asl", ".vfr", ".s", ".S", ".aslc", ".nasm", ".nasmb", ".idf", ".Vfr", ".H"]
> > -
> >  class CheckOnePatch:
> >      """Checks the contents of a git email formatted patch.
> >  
> > 
> 
> 
> 
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [edk2-devel] [PATCH 1/2] Revert "BaseTools/PatchCheck.py: Add LicenseCheck"
  2020-07-07 15:57     ` [edk2-devel] " Leif Lindholm
@ 2020-07-14  2:28       ` Liming Gao
  2020-07-14 11:24         ` Leif Lindholm
  0 siblings, 1 reply; 11+ messages in thread
From: Liming Gao @ 2020-07-14  2:28 UTC (permalink / raw)
  To: Leif Lindholm, devel@edk2.groups.io, lersek@redhat.com
  Cc: Andrew Fish, Kinney, Michael D, Zhang, Shenglei, Chen, Yuwei

Leif:
  Shenglei is working on new patch to add license checker as open CI plug-in (BZ 2833). This way allows to add the exception. So, the autogen file can be handled. Based on current statement, only BSD-2-Clause-Patent license will be allowed. Other license can be added as the exception case if necessary. With new license checker in open CI, I agree to revert this checker in BaseTools/PatchCheck.py.

Thanks
Liming
-----Original Message-----
From: Leif Lindholm <leif@nuviainc.com> 
Sent: 2020年7月7日 23:57
To: devel@edk2.groups.io; lersek@redhat.com
Cc: Andrew Fish <afish@apple.com>; Kinney, Michael D <michael.d.kinney@intel.com>; Zhang, Shenglei <shenglei.zhang@intel.com>; Chen, Yuwei <yuwei.chen@intel.com>; Gao, Liming <liming.gao@intel.com>
Subject: Re: [edk2-devel] [PATCH 1/2] Revert "BaseTools/PatchCheck.py: Add LicenseCheck"

On Fri, Jul 03, 2020 at 18:20:26 +0200, Laszlo Ersek wrote:
> On 07/02/20 13:24, Leif Lindholm wrote:
> > This reverts commit a4cfb842fca9693a330cb5435284c1ee8bfbbace.
> > This commit suggests inclusion of non-edk2+license content without
> 
> The expression "non-edk2+license" is a typo.
> 
> I think you meant "non-BSD-2-Clause-Patent".

Err, yes. Sorry.

> > a contribution agreement is something the community has made a 
> > decision on, which is incorrect.
> 
> I'm OK with commit a4cfb842fca9 being reverted, as this solves the 
> practical problem of adding generated files.
> 
> Acked-by: Laszlo Ersek <lersek@redhat.com>
> 
> That said, I *still* don't grasp the more general problem you refer to.
> 
> Can we express it as follows (using commits 6b621f958123 and 
> 6f21d772aa6b as reference):
> 
> (1) Content under OvmfPkg/Include/IndustryStandard/Xen was introduced 
> under the MIT license in commit 6b621f958123. That commit was marked with:
> 
> > License: This patch adds many files under the MIT licence.
> > Contributed-under: TianoCore Contribution Agreement 1.0
> 
> and the header files also contained open-coded instances of the MIT 
> license. (These would later be replaced with SPDX identifiers in 
> commit
> 6f21d772aa6b.)
> 
> As a result, these files effectively granted use and distribution 
> rights under the MIT license, *plus* a patent grant (per TCA).

Correct.

> (2) If we did the same today (that is, add new MIT-licensed files, but 
> no "Contributed-under: TCA" line on the commit message), then that 
> would grant use and distribution rights under the "MIT license", and 
> *no* patent grant.
> 
> Is this the issue you're thinking of?

Yes.

> So are we basically looking to replace (for example):
> 
>   SPDX-License-Identifier: MIT
> 
> with *something* like:
> 
>   SPDX-License-Identifier: MIT-Patent
> 
> ? (Assuming the latter exists -- which it doesn't, at the moment?)

It doesn't.

For BSD3/BSD4, we can do what the BSD distros do and use (for example)
SPDX-License-Identifier: BSD-3-Clause AND BSD-2-Clause-Patent

It is not clear to me if (for example) "MIT AND BSD-2-Clause-Patent"
is a valid expression. But what about "public domain"? Do we figure out a jurisdiction in which public domain content can clearly have arbitrary licenses applied to it and ask someone there to relicense it to something we can accept?

If we decide the explicit patent grant isn't important, why did we add it in the first place? If we decide it is important, we need to actively make a decision on whether we can ever sidestep it, and if so under what circumstances. (e.g.: "we permit it for tools" - but then the code generation aspect also needs to be covered)

Regards,

Leif

> Thanks
> Laszlo
> 
> > 
> > Cc: Shenglei Zhang <shenglei.zhang@intel.com>
> > Cc: Yuwei Chen <yuwei.chen@intel.com>
> > Cc: Liming Gao <liming.gao@intel.com>
> > Signed-off-by: Leif Lindholm <leif@nuviainc.com>
> > ---
> >  BaseTools/Scripts/PatchCheck.py | 50 
> > ---------------------------------
> >  1 file changed, 50 deletions(-)
> > 
> > diff --git a/BaseTools/Scripts/PatchCheck.py 
> > b/BaseTools/Scripts/PatchCheck.py index e38cf61f93da..6372f71592d3 
> > 100755
> > --- a/BaseTools/Scripts/PatchCheck.py
> > +++ b/BaseTools/Scripts/PatchCheck.py
> > @@ -305,49 +305,12 @@ class GitDiffCheck:
> >          self.line_num = 0
> >          self.state = START
> >          self.new_bin = []
> > -        self.LicenseCheck(self.lines, self.count)
> >          while self.line_num < self.count and self.format_ok:
> >              line_num = self.line_num
> >              self.run()
> >              assert(self.line_num > line_num)
> >          self.report_message_result()
> >
> > -    def LicenseCheck(self, lines, count):
> > -        self.ok = True
> > -        self.startcheck = False
> > -        self.license = True
> > -        line_index = 0
> > -        for line in lines:
> > -            if line.startswith('--- /dev/null'):
> > -                nextline = lines[line_index + 1]
> > -                added_file = self.Readdedfileformat.search(nextline).group(1)
> > -                added_file_extension = os.path.splitext(added_file)[1]
> > -                if added_file_extension in self.file_extension_list:
> > -                    self.startcheck = True
> > -                    self.license = False
> > -            if self.startcheck and self.license_format_preflix in line:
> > -                if self.bsd2_patent in line or self.bsd3_patent in line:
> > -                    self.license = True
> > -                else:
> > -                    for optional_license in self.license_optional_list:
> > -                        if optional_license in line:
> > -                            self.license = True
> > -                            self.warning(added_file)
> > -            if line_index + 1 == count or lines[line_index + 1].startswith('diff --') and self.startcheck:
> > -                if not self.license:
> > -                    error_message = "Invalid License in: " + added_file
> > -                    self.error(error_message)
> > -                self.startcheck = False
> > -                self.license = True
> > -            line_index = line_index + 1
> > -
> > -    def warning(self, *err):
> > -        count = 0
> > -        for line in err:
> > -            warning_format = 'Warning: License accepted but not BSD plus patent license in'
> > -            print(warning_format, line)
> > -            count += 1
> > -
> >      def report_message_result(self):
> >          if Verbose.level < Verbose.NORMAL:
> >              return
> > @@ -534,19 +497,6 @@ class GitDiffCheck:
> >              print(prefix, line)
> >              count += 1
> >
> > -    license_format_preflix = 'SPDX-License-Identifier'
> > -
> > -    bsd2_patent = 'BSD-2-Clause-Patent'
> > -
> > -    bsd3_patent = 'BSD-3-Clause-Patent'
> > -
> > -    license_optional_list = ['BSD-2-Clause', 'BSD-3-Clause', 'MIT', 'Python-2.0', 'Zlib']
> > -
> > -    Readdedfileformat = re.compile(r'\+\+\+ b\/(.*)\n')
> > -
> > -    file_extension_list = [".c", ".h", ".inf", ".dsc", ".dec", ".py", ".bat", ".sh", ".uni", ".yaml", ".fdf", ".inc", "yml", ".asm", \
> > -                          ".asm16", ".asl", ".vfr", ".s", ".S", ".aslc", ".nasm", ".nasmb", ".idf", ".Vfr", ".H"]
> > -
> >  class CheckOnePatch:
> >      """Checks the contents of a git email formatted patch.
> >
> > 
> 
> 
> 
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [edk2-devel] [PATCH 1/2] Revert "BaseTools/PatchCheck.py: Add LicenseCheck"
  2020-07-14  2:28       ` Liming Gao
@ 2020-07-14 11:24         ` Leif Lindholm
  2020-07-31  3:13           ` Liming Gao
       [not found]           ` <1626B7D0592AAD67.4967@groups.io>
  0 siblings, 2 replies; 11+ messages in thread
From: Leif Lindholm @ 2020-07-14 11:24 UTC (permalink / raw)
  To: Gao, Liming
  Cc: devel@edk2.groups.io, lersek@redhat.com, Andrew Fish,
	Kinney, Michael D, Zhang, Shenglei, Chen, Yuwei

Hi Liming,

Thanks, this solves my concern.

/
    Leif

On Tue, Jul 14, 2020 at 02:28:59 +0000, Gao, Liming wrote:
> Leif:
>   Shenglei is working on new patch to add license checker as open CI
>   plug-in (BZ 2833). This way allows to add the exception. So, the
>   autogen file can be handled. Based on current statement, only
>   BSD-2-Clause-Patent license will be allowed. Other license can be
>   added as the exception case if necessary. With new license checker
>   in open CI, I agree to revert this checker in
>   BaseTools/PatchCheck.py.
> 
> Thanks
> Liming
> -----Original Message-----
> From: Leif Lindholm <leif@nuviainc.com> 
> Sent: 2020年7月7日 23:57
> To: devel@edk2.groups.io; lersek@redhat.com
> Cc: Andrew Fish <afish@apple.com>; Kinney, Michael D <michael.d.kinney@intel.com>; Zhang, Shenglei <shenglei.zhang@intel.com>; Chen, Yuwei <yuwei.chen@intel.com>; Gao, Liming <liming.gao@intel.com>
> Subject: Re: [edk2-devel] [PATCH 1/2] Revert "BaseTools/PatchCheck.py: Add LicenseCheck"
> 
> On Fri, Jul 03, 2020 at 18:20:26 +0200, Laszlo Ersek wrote:
> > On 07/02/20 13:24, Leif Lindholm wrote:
> > > This reverts commit a4cfb842fca9693a330cb5435284c1ee8bfbbace.
> > > This commit suggests inclusion of non-edk2+license content without
> > 
> > The expression "non-edk2+license" is a typo.
> > 
> > I think you meant "non-BSD-2-Clause-Patent".
> 
> Err, yes. Sorry.
> 
> > > a contribution agreement is something the community has made a 
> > > decision on, which is incorrect.
> > 
> > I'm OK with commit a4cfb842fca9 being reverted, as this solves the 
> > practical problem of adding generated files.
> > 
> > Acked-by: Laszlo Ersek <lersek@redhat.com>
> > 
> > That said, I *still* don't grasp the more general problem you refer to.
> > 
> > Can we express it as follows (using commits 6b621f958123 and 
> > 6f21d772aa6b as reference):
> > 
> > (1) Content under OvmfPkg/Include/IndustryStandard/Xen was introduced 
> > under the MIT license in commit 6b621f958123. That commit was marked with:
> > 
> > > License: This patch adds many files under the MIT licence.
> > > Contributed-under: TianoCore Contribution Agreement 1.0
> > 
> > and the header files also contained open-coded instances of the MIT 
> > license. (These would later be replaced with SPDX identifiers in 
> > commit
> > 6f21d772aa6b.)
> > 
> > As a result, these files effectively granted use and distribution 
> > rights under the MIT license, *plus* a patent grant (per TCA).
> 
> Correct.
> 
> > (2) If we did the same today (that is, add new MIT-licensed files, but 
> > no "Contributed-under: TCA" line on the commit message), then that 
> > would grant use and distribution rights under the "MIT license", and 
> > *no* patent grant.
> > 
> > Is this the issue you're thinking of?
> 
> Yes.
> 
> > So are we basically looking to replace (for example):
> > 
> >   SPDX-License-Identifier: MIT
> > 
> > with *something* like:
> > 
> >   SPDX-License-Identifier: MIT-Patent
> > 
> > ? (Assuming the latter exists -- which it doesn't, at the moment?)
> 
> It doesn't.
> 
> For BSD3/BSD4, we can do what the BSD distros do and use (for example)
> SPDX-License-Identifier: BSD-3-Clause AND BSD-2-Clause-Patent
> 
> It is not clear to me if (for example) "MIT AND BSD-2-Clause-Patent"
> is a valid expression. But what about "public domain"? Do we figure out a jurisdiction in which public domain content can clearly have arbitrary licenses applied to it and ask someone there to relicense it to something we can accept?
> 
> If we decide the explicit patent grant isn't important, why did we add it in the first place? If we decide it is important, we need to actively make a decision on whether we can ever sidestep it, and if so under what circumstances. (e.g.: "we permit it for tools" - but then the code generation aspect also needs to be covered)
> 
> Regards,
> 
> Leif
> 
> > Thanks
> > Laszlo
> > 
> > > 
> > > Cc: Shenglei Zhang <shenglei.zhang@intel.com>
> > > Cc: Yuwei Chen <yuwei.chen@intel.com>
> > > Cc: Liming Gao <liming.gao@intel.com>
> > > Signed-off-by: Leif Lindholm <leif@nuviainc.com>
> > > ---
> > >  BaseTools/Scripts/PatchCheck.py | 50 
> > > ---------------------------------
> > >  1 file changed, 50 deletions(-)
> > > 
> > > diff --git a/BaseTools/Scripts/PatchCheck.py 
> > > b/BaseTools/Scripts/PatchCheck.py index e38cf61f93da..6372f71592d3 
> > > 100755
> > > --- a/BaseTools/Scripts/PatchCheck.py
> > > +++ b/BaseTools/Scripts/PatchCheck.py
> > > @@ -305,49 +305,12 @@ class GitDiffCheck:
> > >          self.line_num = 0
> > >          self.state = START
> > >          self.new_bin = []
> > > -        self.LicenseCheck(self.lines, self.count)
> > >          while self.line_num < self.count and self.format_ok:
> > >              line_num = self.line_num
> > >              self.run()
> > >              assert(self.line_num > line_num)
> > >          self.report_message_result()
> > >  
> > > -    def LicenseCheck(self, lines, count):
> > > -        self.ok = True
> > > -        self.startcheck = False
> > > -        self.license = True
> > > -        line_index = 0
> > > -        for line in lines:
> > > -            if line.startswith('--- /dev/null'):
> > > -                nextline = lines[line_index + 1]
> > > -                added_file = self.Readdedfileformat.search(nextline).group(1)
> > > -                added_file_extension = os.path.splitext(added_file)[1]
> > > -                if added_file_extension in self.file_extension_list:
> > > -                    self.startcheck = True
> > > -                    self.license = False
> > > -            if self.startcheck and self.license_format_preflix in line:
> > > -                if self.bsd2_patent in line or self.bsd3_patent in line:
> > > -                    self.license = True
> > > -                else:
> > > -                    for optional_license in self.license_optional_list:
> > > -                        if optional_license in line:
> > > -                            self.license = True
> > > -                            self.warning(added_file)
> > > -            if line_index + 1 == count or lines[line_index + 1].startswith('diff --') and self.startcheck:
> > > -                if not self.license:
> > > -                    error_message = "Invalid License in: " + added_file
> > > -                    self.error(error_message)
> > > -                self.startcheck = False
> > > -                self.license = True
> > > -            line_index = line_index + 1
> > > -
> > > -    def warning(self, *err):
> > > -        count = 0
> > > -        for line in err:
> > > -            warning_format = 'Warning: License accepted but not BSD plus patent license in'
> > > -            print(warning_format, line)
> > > -            count += 1
> > > -
> > >      def report_message_result(self):
> > >          if Verbose.level < Verbose.NORMAL:
> > >              return
> > > @@ -534,19 +497,6 @@ class GitDiffCheck:
> > >              print(prefix, line)
> > >              count += 1
> > >  
> > > -    license_format_preflix = 'SPDX-License-Identifier'
> > > -
> > > -    bsd2_patent = 'BSD-2-Clause-Patent'
> > > -
> > > -    bsd3_patent = 'BSD-3-Clause-Patent'
> > > -
> > > -    license_optional_list = ['BSD-2-Clause', 'BSD-3-Clause', 'MIT', 'Python-2.0', 'Zlib']
> > > -
> > > -    Readdedfileformat = re.compile(r'\+\+\+ b\/(.*)\n')
> > > -
> > > -    file_extension_list = [".c", ".h", ".inf", ".dsc", ".dec", ".py", ".bat", ".sh", ".uni", ".yaml", ".fdf", ".inc", "yml", ".asm", \
> > > -                          ".asm16", ".asl", ".vfr", ".s", ".S", ".aslc", ".nasm", ".nasmb", ".idf", ".Vfr", ".H"]
> > > -
> > >  class CheckOnePatch:
> > >      """Checks the contents of a git email formatted patch.
> > >  
> > > 
> > 
> > 
> > 
> > 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [edk2-devel] [PATCH 1/2] Revert "BaseTools/PatchCheck.py: Add LicenseCheck"
  2020-07-14 11:24         ` Leif Lindholm
@ 2020-07-31  3:13           ` Liming Gao
       [not found]           ` <1626B7D0592AAD67.4967@groups.io>
  1 sibling, 0 replies; 11+ messages in thread
From: Liming Gao @ 2020-07-31  3:13 UTC (permalink / raw)
  To: Leif Lindholm
  Cc: devel@edk2.groups.io, lersek@redhat.com, Andrew Fish,
	Kinney, Michael D, Zhang, Shenglei, Chen, Christine

Reviewed-by: Liming Gao <liming.gao@intel.com>

-----Original Message-----
From: Leif Lindholm <leif@nuviainc.com> 
Sent: 2020年7月14日 19:25
To: Gao, Liming <liming.gao@intel.com>
Cc: devel@edk2.groups.io; lersek@redhat.com; Andrew Fish <afish@apple.com>; Kinney, Michael D <michael.d.kinney@intel.com>; Zhang, Shenglei <shenglei.zhang@intel.com>; Chen, Yuwei <yuwei.chen@intel.com>
Subject: Re: [edk2-devel] [PATCH 1/2] Revert "BaseTools/PatchCheck.py: Add LicenseCheck"

Hi Liming,

Thanks, this solves my concern.

/
    Leif

On Tue, Jul 14, 2020 at 02:28:59 +0000, Gao, Liming wrote:
> Leif:
>   Shenglei is working on new patch to add license checker as open CI
>   plug-in (BZ 2833). This way allows to add the exception. So, the
>   autogen file can be handled. Based on current statement, only
>   BSD-2-Clause-Patent license will be allowed. Other license can be
>   added as the exception case if necessary. With new license checker
>   in open CI, I agree to revert this checker in
>   BaseTools/PatchCheck.py.
> 
> Thanks
> Liming
> -----Original Message-----
> From: Leif Lindholm <leif@nuviainc.com>
> Sent: 2020年7月7日 23:57
> To: devel@edk2.groups.io; lersek@redhat.com
> Cc: Andrew Fish <afish@apple.com>; Kinney, Michael D 
> <michael.d.kinney@intel.com>; Zhang, Shenglei 
> <shenglei.zhang@intel.com>; Chen, Yuwei <yuwei.chen@intel.com>; Gao, 
> Liming <liming.gao@intel.com>
> Subject: Re: [edk2-devel] [PATCH 1/2] Revert "BaseTools/PatchCheck.py: Add LicenseCheck"
> 
> On Fri, Jul 03, 2020 at 18:20:26 +0200, Laszlo Ersek wrote:
> > On 07/02/20 13:24, Leif Lindholm wrote:
> > > This reverts commit a4cfb842fca9693a330cb5435284c1ee8bfbbace.
> > > This commit suggests inclusion of non-edk2+license content without
> > 
> > The expression "non-edk2+license" is a typo.
> > 
> > I think you meant "non-BSD-2-Clause-Patent".
> 
> Err, yes. Sorry.
> 
> > > a contribution agreement is something the community has made a 
> > > decision on, which is incorrect.
> > 
> > I'm OK with commit a4cfb842fca9 being reverted, as this solves the 
> > practical problem of adding generated files.
> > 
> > Acked-by: Laszlo Ersek <lersek@redhat.com>
> > 
> > That said, I *still* don't grasp the more general problem you refer to.
> > 
> > Can we express it as follows (using commits 6b621f958123 and 
> > 6f21d772aa6b as reference):
> > 
> > (1) Content under OvmfPkg/Include/IndustryStandard/Xen was 
> > introduced under the MIT license in commit 6b621f958123. That commit was marked with:
> > 
> > > License: This patch adds many files under the MIT licence.
> > > Contributed-under: TianoCore Contribution Agreement 1.0
> > 
> > and the header files also contained open-coded instances of the MIT 
> > license. (These would later be replaced with SPDX identifiers in 
> > commit
> > 6f21d772aa6b.)
> > 
> > As a result, these files effectively granted use and distribution 
> > rights under the MIT license, *plus* a patent grant (per TCA).
> 
> Correct.
> 
> > (2) If we did the same today (that is, add new MIT-licensed files, 
> > but no "Contributed-under: TCA" line on the commit message), then 
> > that would grant use and distribution rights under the "MIT 
> > license", and
> > *no* patent grant.
> > 
> > Is this the issue you're thinking of?
> 
> Yes.
> 
> > So are we basically looking to replace (for example):
> > 
> >   SPDX-License-Identifier: MIT
> > 
> > with *something* like:
> > 
> >   SPDX-License-Identifier: MIT-Patent
> > 
> > ? (Assuming the latter exists -- which it doesn't, at the moment?)
> 
> It doesn't.
> 
> For BSD3/BSD4, we can do what the BSD distros do and use (for example)
> SPDX-License-Identifier: BSD-3-Clause AND BSD-2-Clause-Patent
> 
> It is not clear to me if (for example) "MIT AND BSD-2-Clause-Patent"
> is a valid expression. But what about "public domain"? Do we figure out a jurisdiction in which public domain content can clearly have arbitrary licenses applied to it and ask someone there to relicense it to something we can accept?
> 
> If we decide the explicit patent grant isn't important, why did we add 
> it in the first place? If we decide it is important, we need to 
> actively make a decision on whether we can ever sidestep it, and if so 
> under what circumstances. (e.g.: "we permit it for tools" - but then 
> the code generation aspect also needs to be covered)
> 
> Regards,
> 
> Leif
> 
> > Thanks
> > Laszlo
> > 
> > > 
> > > Cc: Shenglei Zhang <shenglei.zhang@intel.com>
> > > Cc: Yuwei Chen <yuwei.chen@intel.com>
> > > Cc: Liming Gao <liming.gao@intel.com>
> > > Signed-off-by: Leif Lindholm <leif@nuviainc.com>
> > > ---
> > >  BaseTools/Scripts/PatchCheck.py | 50
> > > ---------------------------------
> > >  1 file changed, 50 deletions(-)
> > > 
> > > diff --git a/BaseTools/Scripts/PatchCheck.py 
> > > b/BaseTools/Scripts/PatchCheck.py index e38cf61f93da..6372f71592d3
> > > 100755
> > > --- a/BaseTools/Scripts/PatchCheck.py
> > > +++ b/BaseTools/Scripts/PatchCheck.py
> > > @@ -305,49 +305,12 @@ class GitDiffCheck:
> > >          self.line_num = 0
> > >          self.state = START
> > >          self.new_bin = []
> > > -        self.LicenseCheck(self.lines, self.count)
> > >          while self.line_num < self.count and self.format_ok:
> > >              line_num = self.line_num
> > >              self.run()
> > >              assert(self.line_num > line_num)
> > >          self.report_message_result()
> > >  
> > > -    def LicenseCheck(self, lines, count):
> > > -        self.ok = True
> > > -        self.startcheck = False
> > > -        self.license = True
> > > -        line_index = 0
> > > -        for line in lines:
> > > -            if line.startswith('--- /dev/null'):
> > > -                nextline = lines[line_index + 1]
> > > -                added_file = self.Readdedfileformat.search(nextline).group(1)
> > > -                added_file_extension = os.path.splitext(added_file)[1]
> > > -                if added_file_extension in self.file_extension_list:
> > > -                    self.startcheck = True
> > > -                    self.license = False
> > > -            if self.startcheck and self.license_format_preflix in line:
> > > -                if self.bsd2_patent in line or self.bsd3_patent in line:
> > > -                    self.license = True
> > > -                else:
> > > -                    for optional_license in self.license_optional_list:
> > > -                        if optional_license in line:
> > > -                            self.license = True
> > > -                            self.warning(added_file)
> > > -            if line_index + 1 == count or lines[line_index + 1].startswith('diff --') and self.startcheck:
> > > -                if not self.license:
> > > -                    error_message = "Invalid License in: " + added_file
> > > -                    self.error(error_message)
> > > -                self.startcheck = False
> > > -                self.license = True
> > > -            line_index = line_index + 1
> > > -
> > > -    def warning(self, *err):
> > > -        count = 0
> > > -        for line in err:
> > > -            warning_format = 'Warning: License accepted but not BSD plus patent license in'
> > > -            print(warning_format, line)
> > > -            count += 1
> > > -
> > >      def report_message_result(self):
> > >          if Verbose.level < Verbose.NORMAL:
> > >              return
> > > @@ -534,19 +497,6 @@ class GitDiffCheck:
> > >              print(prefix, line)
> > >              count += 1
> > >  
> > > -    license_format_preflix = 'SPDX-License-Identifier'
> > > -
> > > -    bsd2_patent = 'BSD-2-Clause-Patent'
> > > -
> > > -    bsd3_patent = 'BSD-3-Clause-Patent'
> > > -
> > > -    license_optional_list = ['BSD-2-Clause', 'BSD-3-Clause', 'MIT', 'Python-2.0', 'Zlib']
> > > -
> > > -    Readdedfileformat = re.compile(r'\+\+\+ b\/(.*)\n')
> > > -
> > > -    file_extension_list = [".c", ".h", ".inf", ".dsc", ".dec", ".py", ".bat", ".sh", ".uni", ".yaml", ".fdf", ".inc", "yml", ".asm", \
> > > -                          ".asm16", ".asl", ".vfr", ".s", ".S", ".aslc", ".nasm", ".nasmb", ".idf", ".Vfr", ".H"]
> > > -
> > >  class CheckOnePatch:
> > >      """Checks the contents of a git email formatted patch.
> > >  
> > > 
> > 
> > 
> > 
> > 

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [edk2-devel] [PATCH 1/2] Revert "BaseTools/PatchCheck.py: Add LicenseCheck"
       [not found]           ` <1626B7D0592AAD67.4967@groups.io>
@ 2020-07-31  3:48             ` Liming Gao
  0 siblings, 0 replies; 11+ messages in thread
From: Liming Gao @ 2020-07-31  3:48 UTC (permalink / raw)
  To: devel@edk2.groups.io, Gao, Liming, Leif Lindholm
  Cc: lersek@redhat.com, Andrew Fish, Kinney, Michael D,
	Zhang, Shenglei, Chen, Christine

Merged at 137c2c6eff67f4750d77e8e40af6683c412d3ed0

-----Original Message-----
From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Liming Gao
Sent: 2020年7月31日 11:14
To: Leif Lindholm <leif@nuviainc.com>
Cc: devel@edk2.groups.io; lersek@redhat.com; Andrew Fish <afish@apple.com>; Kinney, Michael D <michael.d.kinney@intel.com>; Zhang, Shenglei <shenglei.zhang@intel.com>; Chen, Christine <yuwei.chen@intel.com>
Subject: Re: [edk2-devel] [PATCH 1/2] Revert "BaseTools/PatchCheck.py: Add LicenseCheck"

Reviewed-by: Liming Gao <liming.gao@intel.com>

-----Original Message-----
From: Leif Lindholm <leif@nuviainc.com>
Sent: 2020年7月14日 19:25
To: Gao, Liming <liming.gao@intel.com>
Cc: devel@edk2.groups.io; lersek@redhat.com; Andrew Fish <afish@apple.com>; Kinney, Michael D <michael.d.kinney@intel.com>; Zhang, Shenglei <shenglei.zhang@intel.com>; Chen, Yuwei <yuwei.chen@intel.com>
Subject: Re: [edk2-devel] [PATCH 1/2] Revert "BaseTools/PatchCheck.py: Add LicenseCheck"

Hi Liming,

Thanks, this solves my concern.

/
    Leif

On Tue, Jul 14, 2020 at 02:28:59 +0000, Gao, Liming wrote:
> Leif:
>   Shenglei is working on new patch to add license checker as open CI
>   plug-in (BZ 2833). This way allows to add the exception. So, the
>   autogen file can be handled. Based on current statement, only
>   BSD-2-Clause-Patent license will be allowed. Other license can be
>   added as the exception case if necessary. With new license checker
>   in open CI, I agree to revert this checker in
>   BaseTools/PatchCheck.py.
> 
> Thanks
> Liming
> -----Original Message-----
> From: Leif Lindholm <leif@nuviainc.com>
> Sent: 2020年7月7日 23:57
> To: devel@edk2.groups.io; lersek@redhat.com
> Cc: Andrew Fish <afish@apple.com>; Kinney, Michael D 
> <michael.d.kinney@intel.com>; Zhang, Shenglei 
> <shenglei.zhang@intel.com>; Chen, Yuwei <yuwei.chen@intel.com>; Gao, 
> Liming <liming.gao@intel.com>
> Subject: Re: [edk2-devel] [PATCH 1/2] Revert "BaseTools/PatchCheck.py: Add LicenseCheck"
> 
> On Fri, Jul 03, 2020 at 18:20:26 +0200, Laszlo Ersek wrote:
> > On 07/02/20 13:24, Leif Lindholm wrote:
> > > This reverts commit a4cfb842fca9693a330cb5435284c1ee8bfbbace.
> > > This commit suggests inclusion of non-edk2+license content without
> > 
> > The expression "non-edk2+license" is a typo.
> > 
> > I think you meant "non-BSD-2-Clause-Patent".
> 
> Err, yes. Sorry.
> 
> > > a contribution agreement is something the community has made a 
> > > decision on, which is incorrect.
> > 
> > I'm OK with commit a4cfb842fca9 being reverted, as this solves the 
> > practical problem of adding generated files.
> > 
> > Acked-by: Laszlo Ersek <lersek@redhat.com>
> > 
> > That said, I *still* don't grasp the more general problem you refer to.
> > 
> > Can we express it as follows (using commits 6b621f958123 and 
> > 6f21d772aa6b as reference):
> > 
> > (1) Content under OvmfPkg/Include/IndustryStandard/Xen was 
> > introduced under the MIT license in commit 6b621f958123. That commit was marked with:
> > 
> > > License: This patch adds many files under the MIT licence.
> > > Contributed-under: TianoCore Contribution Agreement 1.0
> > 
> > and the header files also contained open-coded instances of the MIT 
> > license. (These would later be replaced with SPDX identifiers in 
> > commit
> > 6f21d772aa6b.)
> > 
> > As a result, these files effectively granted use and distribution 
> > rights under the MIT license, *plus* a patent grant (per TCA).
> 
> Correct.
> 
> > (2) If we did the same today (that is, add new MIT-licensed files, 
> > but no "Contributed-under: TCA" line on the commit message), then 
> > that would grant use and distribution rights under the "MIT 
> > license", and
> > *no* patent grant.
> > 
> > Is this the issue you're thinking of?
> 
> Yes.
> 
> > So are we basically looking to replace (for example):
> > 
> >   SPDX-License-Identifier: MIT
> > 
> > with *something* like:
> > 
> >   SPDX-License-Identifier: MIT-Patent
> > 
> > ? (Assuming the latter exists -- which it doesn't, at the moment?)
> 
> It doesn't.
> 
> For BSD3/BSD4, we can do what the BSD distros do and use (for example)
> SPDX-License-Identifier: BSD-3-Clause AND BSD-2-Clause-Patent
> 
> It is not clear to me if (for example) "MIT AND BSD-2-Clause-Patent"
> is a valid expression. But what about "public domain"? Do we figure out a jurisdiction in which public domain content can clearly have arbitrary licenses applied to it and ask someone there to relicense it to something we can accept?
> 
> If we decide the explicit patent grant isn't important, why did we add 
> it in the first place? If we decide it is important, we need to 
> actively make a decision on whether we can ever sidestep it, and if so 
> under what circumstances. (e.g.: "we permit it for tools" - but then 
> the code generation aspect also needs to be covered)
> 
> Regards,
> 
> Leif
> 
> > Thanks
> > Laszlo
> > 
> > > 
> > > Cc: Shenglei Zhang <shenglei.zhang@intel.com>
> > > Cc: Yuwei Chen <yuwei.chen@intel.com>
> > > Cc: Liming Gao <liming.gao@intel.com>
> > > Signed-off-by: Leif Lindholm <leif@nuviainc.com>
> > > ---
> > >  BaseTools/Scripts/PatchCheck.py | 50
> > > ---------------------------------
> > >  1 file changed, 50 deletions(-)
> > > 
> > > diff --git a/BaseTools/Scripts/PatchCheck.py 
> > > b/BaseTools/Scripts/PatchCheck.py index e38cf61f93da..6372f71592d3
> > > 100755
> > > --- a/BaseTools/Scripts/PatchCheck.py
> > > +++ b/BaseTools/Scripts/PatchCheck.py
> > > @@ -305,49 +305,12 @@ class GitDiffCheck:
> > >          self.line_num = 0
> > >          self.state = START
> > >          self.new_bin = []
> > > -        self.LicenseCheck(self.lines, self.count)
> > >          while self.line_num < self.count and self.format_ok:
> > >              line_num = self.line_num
> > >              self.run()
> > >              assert(self.line_num > line_num)
> > >          self.report_message_result()
> > >  
> > > -    def LicenseCheck(self, lines, count):
> > > -        self.ok = True
> > > -        self.startcheck = False
> > > -        self.license = True
> > > -        line_index = 0
> > > -        for line in lines:
> > > -            if line.startswith('--- /dev/null'):
> > > -                nextline = lines[line_index + 1]
> > > -                added_file = self.Readdedfileformat.search(nextline).group(1)
> > > -                added_file_extension = os.path.splitext(added_file)[1]
> > > -                if added_file_extension in self.file_extension_list:
> > > -                    self.startcheck = True
> > > -                    self.license = False
> > > -            if self.startcheck and self.license_format_preflix in line:
> > > -                if self.bsd2_patent in line or self.bsd3_patent in line:
> > > -                    self.license = True
> > > -                else:
> > > -                    for optional_license in self.license_optional_list:
> > > -                        if optional_license in line:
> > > -                            self.license = True
> > > -                            self.warning(added_file)
> > > -            if line_index + 1 == count or lines[line_index + 1].startswith('diff --') and self.startcheck:
> > > -                if not self.license:
> > > -                    error_message = "Invalid License in: " + added_file
> > > -                    self.error(error_message)
> > > -                self.startcheck = False
> > > -                self.license = True
> > > -            line_index = line_index + 1
> > > -
> > > -    def warning(self, *err):
> > > -        count = 0
> > > -        for line in err:
> > > -            warning_format = 'Warning: License accepted but not BSD plus patent license in'
> > > -            print(warning_format, line)
> > > -            count += 1
> > > -
> > >      def report_message_result(self):
> > >          if Verbose.level < Verbose.NORMAL:
> > >              return
> > > @@ -534,19 +497,6 @@ class GitDiffCheck:
> > >              print(prefix, line)
> > >              count += 1
> > >  
> > > -    license_format_preflix = 'SPDX-License-Identifier'
> > > -
> > > -    bsd2_patent = 'BSD-2-Clause-Patent'
> > > -
> > > -    bsd3_patent = 'BSD-3-Clause-Patent'
> > > -
> > > -    license_optional_list = ['BSD-2-Clause', 'BSD-3-Clause', 'MIT', 'Python-2.0', 'Zlib']
> > > -
> > > -    Readdedfileformat = re.compile(r'\+\+\+ b\/(.*)\n')
> > > -
> > > -    file_extension_list = [".c", ".h", ".inf", ".dsc", ".dec", ".py", ".bat", ".sh", ".uni", ".yaml", ".fdf", ".inc", "yml", ".asm", \
> > > -                          ".asm16", ".asl", ".vfr", ".s", ".S", ".aslc", ".nasm", ".nasmb", ".idf", ".Vfr", ".H"]
> > > -
> > >  class CheckOnePatch:
> > >      """Checks the contents of a git email formatted patch.
> > >  
> > > 
> > 
> > 
> > 
> > 




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2020-07-31  3:48 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-07-02 11:24 [PATCH 0/2] Drop suggestions of alternative acceptable licenses Leif Lindholm
2020-07-02 11:24 ` [PATCH 1/2] Revert "BaseTools/PatchCheck.py: Add LicenseCheck" Leif Lindholm
2020-07-03 16:20   ` Laszlo Ersek
2020-07-07 15:57     ` [edk2-devel] " Leif Lindholm
2020-07-14  2:28       ` Liming Gao
2020-07-14 11:24         ` Leif Lindholm
2020-07-31  3:13           ` Liming Gao
     [not found]           ` <1626B7D0592AAD67.4967@groups.io>
2020-07-31  3:48             ` Liming Gao
2020-07-02 11:24 ` [PATCH 2/2] ReadMe.rst: delete statements about other accepted licenses Leif Lindholm
2020-07-03 16:24   ` Laszlo Ersek
2020-07-03 16:10 ` [PATCH 0/2] Drop suggestions of alternative acceptable licenses Laszlo Ersek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox