From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by mx.groups.io with SMTP id smtpd.web12.19303.1594137442256921385 for ; Tue, 07 Jul 2020 08:57:22 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=Gur74i2O; spf=pass (domain: nuviainc.com, ip: 209.85.128.66, mailfrom: leif@nuviainc.com) Received: by mail-wm1-f66.google.com with SMTP id o8so43825608wmh.4 for ; Tue, 07 Jul 2020 08:57:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=61cBcpF8Ez2/GAReO/sOINmwP5nXvG9c6M/hl9EosLU=; b=Gur74i2OwjOUG/8+RVwO5/sQgHRLC3Z24qaCH+LIZNG0P0cGSnRMzKqm3rfWo7yfdn NkMUq8W2QjGB5a9r62VAWoyjFcrl/b2lzmEaWhaaP5ZQCKYDc7C9WVrEjBi6VR54KWpS H8/UBdc+7Kwj7RNDiN1cCctlKtopdc/4cGciKFVklzrFSqWBbPqApH1qh4mkVKpAm8T8 FazQtHO4eZwajQpTMmvZBA8tTx3pV5x6zIrd0KA2H56BHOeQkujMCprrHwdzi553KKId Zirgrpwkd0Ch9+RBqTv56TS31CGTT/B9P5h8/o0dAioh5ldPBYhOfq4gIVtBjn4HIu9q e+NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=61cBcpF8Ez2/GAReO/sOINmwP5nXvG9c6M/hl9EosLU=; b=GMppcrju6P3gzzNUPNxfyve35Ehiz7eCcyRAlgqDefTHJ22e+2or3FjWO+Cmi/Zabh rQt78I/9DwEb39uxveyAaG+v8F7Pwc/pduEwwYyPlzmYvbB5cyxlWH0OHh7NIMErUzWQ jNE890rW3PPyuUXKsysZbKgRRWOY7pDIXOIKr52D5wYI7N2LBuWYPEW0ohNE72MLjUEa wnXMC4NgaJcHyD7mfd5E9SWW0aC5m7RPaqjiDnqHg823rgR1IB2pgnPfjx1RMccbtsSe XwdIajoK3YNJaD3UrYr2HwDqXz718nl6186SRZcYCvg8YNOJiWUf0ZQYnpzT/dy7pw3U u4cA== X-Gm-Message-State: AOAM5302txPNDjaWp/Txzi2MPPOiH+qaofmEbUK0Liqqq2I0+fHNy3pA Ws01g2l/xnp/lh0sHQtrXbh09LWNqERC7njZmWOnDpKZR4u9NeeKo1+hCsxHWLO2bHpXz0hvaco x9K1pDjlA4sCrZGepC+jnRWVzoXBy8zMbbiltYJHfZ2yplqJmMiaAFopIV1nms3f/rw== X-Google-Smtp-Source: ABdhPJy58SC9NsXc9BQQpluqZLDBrxLQ8uYKjbL8ObPFCkFMXTdViMHslD3rWE2/a5nfbNSCMx8Zag== X-Received: by 2002:a05:600c:2182:: with SMTP id e2mr4815462wme.186.1594137440559; Tue, 07 Jul 2020 08:57:20 -0700 (PDT) Return-Path: Received: from vanye ([2001:470:1f09:12f0:b26e:bfff:fea9:f1b8]) by smtp.gmail.com with ESMTPSA id y16sm1548600wro.71.2020.07.07.08.57.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jul 2020 08:57:19 -0700 (PDT) Date: Tue, 7 Jul 2020 16:57:17 +0100 From: "Leif Lindholm" To: devel@edk2.groups.io, lersek@redhat.com Cc: Andrew Fish , Michael D Kinney , Shenglei Zhang , Yuwei Chen , Liming Gao Subject: Re: [edk2-devel] [PATCH 1/2] Revert "BaseTools/PatchCheck.py: Add LicenseCheck" Message-ID: <20200707155717.GG12303@vanye> References: <20200702112420.18408-1-leif@nuviainc.com> <20200702112420.18408-2-leif@nuviainc.com> <98aaf25a-62e3-6877-99fe-082f4b6ba437@redhat.com> MIME-Version: 1.0 In-Reply-To: <98aaf25a-62e3-6877-99fe-082f4b6ba437@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 > > 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 > > Cc: Yuwei Chen > > Cc: Liming Gao > > Signed-off-by: Leif Lindholm > > --- > > 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. > > > > > > > >