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.web10.17710.1594725894165068465 for ; Tue, 14 Jul 2020 04:24:54 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=S/UcUcSY; spf=pass (domain: nuviainc.com, ip: 209.85.128.66, mailfrom: leif@nuviainc.com) Received: by mail-wm1-f66.google.com with SMTP id 22so4831012wmg.1 for ; Tue, 14 Jul 2020 04:24:53 -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:content-transfer-encoding:in-reply-to :user-agent; bh=hPcMGLMmz9MEhYpLdJsU8HoLIpdOSDuA877QS07mqvQ=; b=S/UcUcSYfnkHQsiiAb7xayDKtmpkUW4SWXwVrVBNYfl58SakAvAyWA1moE8KfoLK6C RixqitdavxjKUmaM5uY7XTPfh6lZak7SuySpMPlPRsqPW2iC699QlJe6lCseniXG8+2c JYE343X0MZL1FZ+BpY+G4Ob7xStLggzVOC/T/g3yoa5HU2Nopxq/5drCKSBKadGeS5au AL3WUetM6jifS49LvxzS9sxEVvbFtEBkRObH6pM1RURjFFXktYmy7+G8hynLVr8ml1RC +eqXSUOVUS1Q3ToBAe1IeD22xWa+WO38YfcU7f/kP3XzWti/i0BVZ4Ur3M91HN250i12 h4iw== 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:content-transfer-encoding :in-reply-to:user-agent; bh=hPcMGLMmz9MEhYpLdJsU8HoLIpdOSDuA877QS07mqvQ=; b=omGUz3JVb2CgABpKnvpmkGx6pn+2JQjAuoi9UJh5Zm0hvoFW1C/0He/HfDC3er3y7d GgKgVVL93jdBe8l0JkJa6HUbGCuMutmMQxjrRZ4sMitno9z9cpefzcXBhHthg8GRzRnV w6BP4ufMmQhoWcbpKJsDBSbquBUnXhgNsbuSPa1+5E8ZM1DxszyA6/F3Wt4xvULsI02+ CCC3gW4Bgs+tE2wYV/NKajIaJcaXH7gbPa+JQwsPsnZEcD+NRBmf0lbn5jk4ScgHzAe7 1ABGfv8jJKmtOhHoyAJZgatJ/ILUYzorOcI+UFz7eqHgVsdDVAm25sOhra15J9j/29g0 wv9A== X-Gm-Message-State: AOAM533D63EmxafqZS8Qt2RHLMHMs+tUrmfSwlB/9WM72HQmBsg9oc94 GXFGllQBLuZG6Qs80Sj0Z5mgVw== X-Google-Smtp-Source: ABdhPJx7DX4e8CeFp6lABkLacIG8eYgh0JXWC68vQDvwLtKx8WP8BTRT7q4vZGArk9uae6BK5/AEfg== X-Received: by 2002:a05:600c:2295:: with SMTP id 21mr3728873wmf.87.1594725892722; Tue, 14 Jul 2020 04:24:52 -0700 (PDT) Return-Path: Received: from vanye ([2001:470:1f09:12f0:b26e:bfff:fea9:f1b8]) by smtp.gmail.com with ESMTPSA id n3sm16099408wrm.87.2020.07.14.04.24.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Jul 2020 04:24:52 -0700 (PDT) Date: Tue, 14 Jul 2020 12:24:50 +0100 From: "Leif Lindholm" To: "Gao, Liming" Cc: "devel@edk2.groups.io" , "lersek@redhat.com" , Andrew Fish , "Kinney, Michael D" , "Zhang, Shenglei" , "Chen, Yuwei" Subject: Re: [edk2-devel] [PATCH 1/2] Revert "BaseTools/PatchCheck.py: Add LicenseCheck" Message-ID: <20200714112450.GT12303@vanye> References: <20200702112420.18408-1-leif@nuviainc.com> <20200702112420.18408-2-leif@nuviainc.com> <98aaf25a-62e3-6877-99fe-082f4b6ba437@redhat.com> <20200707155717.GG12303@vanye> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit 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 > Sent: 2020年7月7日 23:57 > To: devel@edk2.groups.io; lersek@redhat.com > Cc: Andrew Fish ; Kinney, Michael D ; Zhang, Shenglei ; Chen, Yuwei ; Gao, Liming > 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 > > > > 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. > > > > > > > > > > > > > >