From nobody Thu May 2 21:40:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+60632+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+60632+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1591174095; cv=none; d=zohomail.com; s=zohoarc; b=TGcOrfnHs2nw5+SoEhvFWS3DvCYpO39Jn5nWR87F2o3sfyXOwbG2quNnF34LJRnUvFTevJGh8a5Jm1P1MgxGiCTwfRkYS6mE5FcYU6IEGUhlPXDxjkgoDX9SJDoFJciWYi8cyhT7gLbcl6ZCwb1Ada1IMtdZqMQhhsOtyArs0Hg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591174095; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=n4zsLox2221RYOAxFB7m00QnIIN6AMkwiQ1xU0Aclx0=; b=JKVpMHEPOmkHkSvoTx5WN5+RgAIMqZc0iKHSL5Z6jRCj/281RPvtx/EIzNIAMNWJJMryktFEigHJPJoOqWXsuhbFP6ZMqAlhvs0A8/DAadv6CerA6Q1vboTPDswwY6YuYQbORoATSh84d+iUNaVSNqmYl8O2VFcmmvrlwbFPMJA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+60632+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1591174095653170.95780998058228; Wed, 3 Jun 2020 01:48:15 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 3FnNYY1788612xUdE6iP17QJ; Wed, 03 Jun 2020 01:48:15 -0700 X-Received: from mga01.intel.com (mga01.intel.com []) by mx.groups.io with SMTP id smtpd.web10.9648.1591174092723471280 for ; Wed, 03 Jun 2020 01:48:14 -0700 IronPort-SDR: JTlVZc/Lg6Y9u//S9wsn4N9HP7nRvjng2NIKnUB+C8fG59fjWS8Pl48yCdUXizDw7s9Oi0zaop Lgw+oVS5fFmQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2020 01:48:14 -0700 IronPort-SDR: AIjpAcx9RBhUhBF6b8NPJPSn3IBVkMXjNFkpFYl7MsaYbA2YX/x2KuvDxkRi41e5wmyW9zTrCo j45iAbKJ7Opg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,467,1583222400"; d="scan'208";a="470975800" X-Received: from shenglei-dev.ccr.corp.intel.com ([10.239.158.52]) by fmsmga006.fm.intel.com with ESMTP; 03 Jun 2020 01:48:12 -0700 From: "Zhang, Shenglei" To: devel@edk2.groups.io Cc: "Fan, Zhiju" , Bob Feng , Liming Gao Subject: [edk2-devel] [PATCH v2 1/5] BaseTools:ECC needs to update the contents of CParser4 Date: Wed, 3 Jun 2020 16:48:03 +0800 Message-Id: <20200603084807.24484-2-shenglei.zhang@intel.com> In-Reply-To: <20200603084807.24484-1-shenglei.zhang@intel.com> References: <20200603084807.24484-1-shenglei.zhang@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,shenglei.zhang@intel.com X-Gm-Message-State: 6lYAxezuyQTeqXoqtAcfzzbQx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1591174095; bh=BIb5Rku8n/elwyyjs49b6ujIONsyB8f2ovTpDO8R5h4=; h=Cc:Date:From:Reply-To:Subject:To; b=UeSRQ6R39Q+/Uts67SkLYbAZJIvFul2vbFwu/zNoH5hn+eoW3iw+ZX1Nz/jDKWI/9uZ hvvUptWlajWpHkkhuvxNN9/zc0V49sJJQQF7Z8pJbDOOlrUDEJGC+F9LaumMeSiRSeCYf mIdOfsp6+YyRZcTpDb/rjGzAKz7BgNyfOGY= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: "Fan, Zhiju" REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2676 Because Ecc relies on the antlr extension package, When the antlr version is updated, we need to change the code in it. Currently, if you use the latest version antlr4.8, Ecc will fail We will update the version to support the use of antlr4.8 and all previous versions will have errors.This can be resolved by installing the antlr4.8 version. Installation method: pip install antlr4-python3-runtime=3D=3D4.8 This patch is going to fixed this issue Cc: Bob Feng Cc: Liming Gao Signed-off-by: Zhiju.Fan --- .../Source/Python/Ecc/CParser4/CLexer.py | 6 +-- .../Source/Python/Ecc/CParser4/CListener.py | 4 +- .../Source/Python/Ecc/CParser4/CParser.py | 38 ++++++++++--------- 3 files changed, 25 insertions(+), 23 deletions(-) diff --git a/BaseTools/Source/Python/Ecc/CParser4/CLexer.py b/BaseTools/Sou= rce/Python/Ecc/CParser4/CLexer.py index a2cc5bf56e66..40e2afbf1a1f 100644 --- a/BaseTools/Source/Python/Ecc/CParser4/CLexer.py +++ b/BaseTools/Source/Python/Ecc/CParser4/CLexer.py @@ -1,4 +1,4 @@ -# Generated from C.g4 by ANTLR 4.7.1 +# Generated from C.g4 by ANTLR 4.8 from antlr4 import * from io import StringIO from typing.io import TextIO @@ -12,7 +12,7 @@ import sys # This file is generated by running: # java org.antlr.Tool C.g # -# Copyright (c) 2009 - 2010, Intel Corporation All rights reserved. +# Copyright (c) 2009 - 2020, Intel Corporation All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -584,7 +584,7 @@ class CLexer(Lexer): # @param output=3D sys.stdout Type: TextIO def __init__(self,input=3DNone,output=3D sys.stdout): super().__init__(input, output) - self.checkVersion("4.7.1") + self.checkVersion("4.8") self._interp =3D LexerATNSimulator(self, self.atn, self.decisionsT= oDFA, PredictionContextCache()) self._actions =3D None self._predicates =3D None diff --git a/BaseTools/Source/Python/Ecc/CParser4/CListener.py b/BaseTools/= Source/Python/Ecc/CParser4/CListener.py index bb4351d9249a..ba7e70892680 100644 --- a/BaseTools/Source/Python/Ecc/CParser4/CListener.py +++ b/BaseTools/Source/Python/Ecc/CParser4/CListener.py @@ -1,4 +1,4 @@ -# Generated from C.g4 by ANTLR 4.7.1 +# Generated from C.g4 by ANTLR 4.8 from antlr4 import * if __name__ is not None and "." in __name__: from .CParser import CParser @@ -12,7 +12,7 @@ else: # This file is generated by running: # java org.antlr.Tool C.g # -# Copyright (c) 2009 - 2010, Intel Corporation All rights reserved. +# Copyright (c) 2009 - 2020, Intel Corporation All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # diff --git a/BaseTools/Source/Python/Ecc/CParser4/CParser.py b/BaseTools/So= urce/Python/Ecc/CParser4/CParser.py index 31d23d55aa57..30d70a74e669 100644 --- a/BaseTools/Source/Python/Ecc/CParser4/CParser.py +++ b/BaseTools/Source/Python/Ecc/CParser4/CParser.py @@ -1,10 +1,12 @@ -# Generated from C.g4 by ANTLR 4.7.1 +# Generated from C.g4 by ANTLR 4.8 # encoding: utf-8 from antlr4 import * from io import StringIO -from typing.io import TextIO import sys - +if sys.version_info[1] > 5: + from typing import TextIO +else: + from typing.io import TextIO =20 ## @file # The file defines the parser for C source files. @@ -13,7 +15,7 @@ import sys # This file is generated by running: # java org.antlr.Tool C.g # -# Copyright (c) 2009 - 2010, Intel Corporation All rights reserved. +# Copyright (c) 2009 - 2020, Intel Corporation All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -739,7 +741,7 @@ class CParser ( Parser ): # @param output=3D sys.stdout Type: TextIO def __init__(self,input,output=3D sys.stdout): super().__init__(input, output) - self.checkVersion("4.7.1") + self.checkVersion("4.8") self._interp =3D ParserATNSimulator(self, self.atn, self.decisions= ToDFA, self.sharedContextCache) self._predicates =3D None =20 @@ -1062,10 +1064,10 @@ class CParser ( Parser ): =20 =20 if localctx.d !=3D None: - ModifierText =3D (None if localctx._declaration_specifiers= is None else self._input.getText((localctx._declaration_specifiers.start,l= ocalctx._declaration_specifiers.stop))) + ModifierText =3D (None if localctx._declaration_specifiers= is None else self._input.getText(localctx._declaration_specifiers.start,lo= calctx._declaration_specifiers.stop)) else: ModifierText =3D '' - DeclText =3D (None if localctx._declarator is None else self._= input.getText((localctx._declarator.start,localctx._declarator.stop))) + DeclText =3D (None if localctx._declarator is None else self._= input.getText(localctx._declarator.start,localctx._declarator.stop)) DeclLine =3D (None if localctx._declarator is None else localc= tx._declarator.start).line DeclOffset =3D (None if localctx._declarator is None else loca= lctx._declarator.start).column if localctx.a !=3D None: @@ -1245,9 +1247,9 @@ class CParser ( Parser ): localctx.d =3D self.match(CParser.T__1) =20 if localctx.b is not None: - self.StoreTypedefDefinition(localctx.a.line, localctx.= a.column, (0 if localctx.d is None else localctx.d.line), localctx.d.column= , (None if localctx.b is None else self._input.getText((localctx.b.start,lo= calctx.b.stop))), (None if localctx.c is None else self._input.getText((loc= alctx.c.start,localctx.c.stop)))) + self.StoreTypedefDefinition(localctx.a.line, localctx.= a.column, (0 if localctx.d is None else localctx.d.line), localctx.d.column= , (None if localctx.b is None else self._input.getText(localctx.b.start,loc= alctx.b.stop)), (None if localctx.c is None else self._input.getText(localc= tx.c.start,localctx.c.stop))) else: - self.StoreTypedefDefinition(localctx.a.line, localctx.= a.column, (0 if localctx.d is None else localctx.d.line), localctx.d.column= , '', (None if localctx.c is None else self._input.getText((localctx.c.star= t,localctx.c.stop)))) + self.StoreTypedefDefinition(localctx.a.line, localctx.= a.column, (0 if localctx.d is None else localctx.d.line), localctx.d.column= , '', (None if localctx.c is None else self._input.getText(localctx.c.start= ,localctx.c.stop))) =20 pass elif token in [CParser.T__5, CParser.T__6, CParser.T__7, CPars= er.T__8, CParser.T__9, CParser.T__10, CParser.T__11, CParser.T__12, CParser= .T__13, CParser.T__14, CParser.T__15, CParser.T__16, CParser.T__17, CParser= .T__18, CParser.T__20, CParser.T__21, CParser.T__23, CParser.T__24, CParser= .T__25, CParser.T__26, CParser.T__27, CParser.T__28, CParser.T__29, CParser= .T__30, CParser.T__31, CParser.T__32, CParser.T__33, CParser.T__34, CParser= .T__35, CParser.T__36, CParser.IDENTIFIER]: @@ -1266,7 +1268,7 @@ class CParser ( Parser ): localctx.e =3D self.match(CParser.T__1) =20 if localctx.t is not None: - self.StoreVariableDeclaration((None if localctx.s is N= one else localctx.s.start).line, (None if localctx.s is None else localctx.= s.start).column, (None if localctx.t is None else localctx.t.start).line, (= None if localctx.t is None else localctx.t.start).column, (None if localctx= .s is None else self._input.getText((localctx.s.start,localctx.s.stop))), (= None if localctx.t is None else self._input.getText((localctx.t.start,local= ctx.t.stop)))) + self.StoreVariableDeclaration((None if localctx.s is N= one else localctx.s.start).line, (None if localctx.s is None else localctx.= s.start).column, (None if localctx.t is None else localctx.t.start).line, (= None if localctx.t is None else localctx.t.start).column, (None if localctx= .s is None else self._input.getText(localctx.s.start,localctx.s.stop)), (No= ne if localctx.t is None else self._input.getText(localctx.t.start,localctx= .t.stop))) =20 pass else: @@ -1568,7 +1570,7 @@ class CParser ( Parser ): localctx.s =3D self.struct_or_union_specifier() =20 if localctx.s.stop is not None: - self.StoreStructUnionDefinition((None if localctx.s is= None else localctx.s.start).line, (None if localctx.s is None else localct= x.s.start).column, (None if localctx.s is None else localctx.s.stop).line, = (None if localctx.s is None else localctx.s.stop).column, (None if localctx= .s is None else self._input.getText((localctx.s.start,localctx.s.stop)))) + self.StoreStructUnionDefinition((None if localctx.s is= None else localctx.s.start).line, (None if localctx.s is None else localct= x.s.start).column, (None if localctx.s is None else localctx.s.stop).line, = (None if localctx.s is None else localctx.s.stop).column, (None if localctx= .s is None else self._input.getText(localctx.s.start,localctx.s.stop))) =20 pass =20 @@ -1578,7 +1580,7 @@ class CParser ( Parser ): localctx.e =3D self.enum_specifier() =20 if localctx.e.stop is not None: - self.StoreEnumerationDefinition((None if localctx.e is= None else localctx.e.start).line, (None if localctx.e is None else localct= x.e.start).column, (None if localctx.e is None else localctx.e.stop).line, = (None if localctx.e is None else localctx.e.stop).column, (None if localctx= .e is None else self._input.getText((localctx.e.start,localctx.e.stop)))) + self.StoreEnumerationDefinition((None if localctx.e is= None else localctx.e.start).line, (None if localctx.e is None else localct= x.e.start).column, (None if localctx.e is None else localctx.e.stop).line, = (None if localctx.e is None else localctx.e.stop).column, (None if localctx= .e is None else self._input.getText(localctx.e.start,localctx.e.stop))) =20 pass =20 @@ -4022,7 +4024,7 @@ class CParser ( Parser ): self.enterOuterAlt(localctx, 1) self.state =3D 569 localctx.p =3D self.primary_expression() - self.FuncCallText +=3D (None if localctx.p is None else self._= input.getText((localctx.p.start,localctx.p.stop))) + self.FuncCallText +=3D (None if localctx.p is None else self._= input.getText(localctx.p.start,localctx.p.stop)) self.state =3D 600 self._errHandler.sync(self) _alt =3D self._interp.adaptivePredict(self._input,73,self._ctx) @@ -4055,7 +4057,7 @@ class CParser ( Parser ): localctx.c =3D self.argument_expression_list() self.state =3D 580 localctx.b =3D self.match(CParser.T__38) - self.StoreFunctionCalling((None if localctx.p is N= one else localctx.p.start).line, (None if localctx.p is None else localctx.= p.start).column, (0 if localctx.b is None else localctx.b.line), localctx.b= .column, self.FuncCallText, (None if localctx.c is None else self._input.ge= tText((localctx.c.start,localctx.c.stop)))) + self.StoreFunctionCalling((None if localctx.p is N= one else localctx.p.start).line, (None if localctx.p is None else localctx.= p.start).column, (0 if localctx.b is None else localctx.b.line), localctx.b= .column, self.FuncCallText, (None if localctx.c is None else self._input.ge= tText(localctx.c.start,localctx.c.stop))) pass =20 elif la_ =3D=3D 4: @@ -4770,7 +4772,7 @@ class CParser ( Parser ): self.match(CParser.T__22) self.state =3D 674 self.conditional_expression() - self.StorePredicateExpression((None if localctx.e is None = else localctx.e.start).line, (None if localctx.e is None else localctx.e.st= art).column, (None if localctx.e is None else localctx.e.stop).line, (None = if localctx.e is None else localctx.e.stop).column, (None if localctx.e is = None else self._input.getText((localctx.e.start,localctx.e.stop)))) + self.StorePredicateExpression((None if localctx.e is None = else localctx.e.start).line, (None if localctx.e is None else localctx.e.st= art).column, (None if localctx.e is None else localctx.e.stop).line, (None = if localctx.e is None else localctx.e.stop).column, (None if localctx.e is = None else self._input.getText(localctx.e.start,localctx.e.stop))) =20 =20 except RecognitionException as re: @@ -6053,7 +6055,7 @@ class CParser ( Parser ): localctx.e =3D self.expression() self.state =3D 845 self.match(CParser.T__38) - self.StorePredicateExpression((None if localctx.e is None = else localctx.e.start).line, (None if localctx.e is None else localctx.e.st= art).column, (None if localctx.e is None else localctx.e.stop).line, (None = if localctx.e is None else localctx.e.stop).column, (None if localctx.e is = None else self._input.getText((localctx.e.start,localctx.e.stop)))) + self.StorePredicateExpression((None if localctx.e is None = else localctx.e.start).line, (None if localctx.e is None else localctx.e.st= art).column, (None if localctx.e is None else localctx.e.stop).line, (None = if localctx.e is None else localctx.e.stop).column, (None if localctx.e is = None else self._input.getText(localctx.e.start,localctx.e.stop))) self.state =3D 847 self.statement() self.state =3D 850 @@ -6144,7 +6146,7 @@ class CParser ( Parser ): self.match(CParser.T__38) self.state =3D 864 self.statement() - self.StorePredicateExpression((None if localctx.e is None = else localctx.e.start).line, (None if localctx.e is None else localctx.e.st= art).column, (None if localctx.e is None else localctx.e.stop).line, (None = if localctx.e is None else localctx.e.stop).column, (None if localctx.e is = None else self._input.getText((localctx.e.start,localctx.e.stop)))) + self.StorePredicateExpression((None if localctx.e is None = else localctx.e.start).line, (None if localctx.e is None else localctx.e.st= art).column, (None if localctx.e is None else localctx.e.stop).line, (None = if localctx.e is None else localctx.e.stop).column, (None if localctx.e is = None else self._input.getText(localctx.e.start,localctx.e.stop))) pass elif token in [CParser.T__87]: self.enterOuterAlt(localctx, 2) @@ -6162,7 +6164,7 @@ class CParser ( Parser ): self.match(CParser.T__38) self.state =3D 873 self.match(CParser.T__1) - self.StorePredicateExpression((None if localctx.e is None = else localctx.e.start).line, (None if localctx.e is None else localctx.e.st= art).column, (None if localctx.e is None else localctx.e.stop).line, (None = if localctx.e is None else localctx.e.stop).column, (None if localctx.e is = None else self._input.getText((localctx.e.start,localctx.e.stop)))) + self.StorePredicateExpression((None if localctx.e is None = else localctx.e.start).line, (None if localctx.e is None else localctx.e.st= art).column, (None if localctx.e is None else localctx.e.stop).line, (None = if localctx.e is None else localctx.e.stop).column, (None if localctx.e is = None else self._input.getText(localctx.e.start,localctx.e.stop))) pass else: raise NoViableAltException(self) --=20 2.18.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#60632): https://edk2.groups.io/g/devel/message/60632 Mute This Topic: https://groups.io/mt/74645922/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu May 2 21:40:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+60633+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+60633+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1591174098; cv=none; d=zohomail.com; s=zohoarc; b=dolfU8/DIhK0Secl9nJiCCE94ItXssgP3ZmbUiJu8tkmUFX/P/P/260S0OukP8/iY6H+UoQqVitljvlbN/ZD42pidBCKBUkYslmPyMCLsqDz02cmLI3ZFSRlgrpeP1Sy0XRfKr7PXEMchgSrB8m5FBg3ycIQ9mBJhPpBijw1zwY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591174098; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=b+teBs6R4jQWfzspsukuV00SeO1orEiCnacHlGLEIDA=; b=jEuMhgl5/xsWl3wfdIl18OT8ixwWami5dpfcwvnqqq4jG1THcurJA+xqD7+T3We0EtDQd3XNYvPmIQpAhebqkmKZWppcGkbrgaAuNh+gtV8kQ8QVpug/VeokdkQPAf5imvN3GwYSmMegTCYpfN+R0JPJ2InAN1ZDjbKTK2VZhKY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+60633+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1591174098323656.5178423957511; Wed, 3 Jun 2020 01:48:18 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id g36vYY1788612xtO3LEe0wU6; Wed, 03 Jun 2020 01:48:18 -0700 X-Received: from mga01.intel.com (mga01.intel.com []) by mx.groups.io with SMTP id smtpd.web10.9648.1591174092723471280 for ; Wed, 03 Jun 2020 01:48:17 -0700 IronPort-SDR: XXS1y91Ya/g9+QKqvx6CNXhftf4pURwLDB+DGXQ6MK5Ah0xVyOG/18tuvRyB1Nth8/pYEv2TNP 6Zz0lSYa+tWQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2020 01:48:17 -0700 IronPort-SDR: LzNm5OC5L/47xQe1lsNqtMX59a6/AxqCNcsPQZCcDIo/DyB3CUHYyhs3xmVbY9RDRgukB6eZfY yOM6lgZY04Lw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,467,1583222400"; d="scan'208";a="470975837" X-Received: from shenglei-dev.ccr.corp.intel.com ([10.239.158.52]) by fmsmga006.fm.intel.com with ESMTP; 03 Jun 2020 01:48:15 -0700 From: "Zhang, Shenglei" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao Subject: [edk2-devel] [PATCH v2 2/5] BaseTools/Scripts: Add EccCheck.py Date: Wed, 3 Jun 2020 16:48:04 +0800 Message-Id: <20200603084807.24484-3-shenglei.zhang@intel.com> In-Reply-To: <20200603084807.24484-1-shenglei.zhang@intel.com> References: <20200603084807.24484-1-shenglei.zhang@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,shenglei.zhang@intel.com X-Gm-Message-State: pV6ulErUa5HLftYE1opkyMYYx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1591174098; bh=96n4C97DEv8XBmopj/GcouMasCcZXFFoKsqXPD0QLSM=; h=Cc:Date:From:Reply-To:Subject:To; b=ez+PLjJohVAKO5AuS2gnw13HMw1suNGZmknhZxQe8YvIM5Wy4Inq+0YJ++p0dE7kp39 ZdjJ3suNUUL4bTmqdujYFbtJ7f8TlHlOPk1ID6Rs1dN2dKfrMtZOAE3gIx6qUx+RsD79j wwPcFNn5yafDb1VZElO0GhsRX9uEuQoBj+U= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2606 EccCheck.py is a tool to report Ecc issues for commits, which will be run on open ci. But note not each kind of issue could be reported out. It can only handle the issues, whose line number in CSV report accurately map with their code in source code files. And comment issues can also be handled. Its usage is similar to PatchCheck.py. Type EccCheck.py -h and then learn how to use it. If a patch passes EccCheck, "Ecc Pass" will show up. Otherwise, "Ecc error detected" alerts the users and the details are also presented. Cc: Bob Feng Cc: Liming Gao Signed-off-by: Shenglei Zhang --- v2: Update 2/5, fix the bug that the script can't hanlde multiple commits. BaseTools/Scripts/EccCheck.py | 433 ++++++++++++++++++++++++++++++++++ 1 file changed, 433 insertions(+) create mode 100644 BaseTools/Scripts/EccCheck.py diff --git a/BaseTools/Scripts/EccCheck.py b/BaseTools/Scripts/EccCheck.py new file mode 100644 index 000000000000..034a9965a79b --- /dev/null +++ b/BaseTools/Scripts/EccCheck.py @@ -0,0 +1,433 @@ +## @file +# Check a patch for various format issues +# +# Copyright (c) 2020, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# + +import os +import re +import csv +import subprocess +import argparse +import sys +import yaml +import xml.dom.minidom + +__copyright__ =3D "Copyright (c) 2020, Intel Corporation All rights reser= ved." +ReModifyFile =3D re.compile(r'[B-Q,S-Z]+[\d]*\t(.*?)\n') +FindModifyFile =3D re.compile(r'\+\+\+ b\/(.*)') +LineScopePattern =3D (r'@@ -\d*\,*\d* \+\d*\,*\d* @@.*') +LineNumRange =3D re.compile(r'@@ -\d*\,*\d* \+(\d*)\,*(\d*) @@.*') + +EnvList =3D os.environ +GlobalSymbol =3D {} + +def AppendException(ExceptionList, ExceptionFile): + error_code_list =3D ExceptionList[::2] + keyword_list =3D ExceptionList[1::2] + domTree =3D xml.dom.minidom.parse(ExceptionFile) + rootNode =3D domTree.documentElement + for error_code, keyword in zip(error_code_list, keyword_list): + customer_node =3D domTree.createElement("Exception") + keyword_node =3D domTree.createElement("KeyWord") + keyword_node_text_value =3D domTree.createTextNode(keyword) + keyword_node.appendChild(keyword_node_text_value) + customer_node.appendChild(keyword_node) + error_code_node =3D domTree.createElement("ErrorID") + error_code_text_value =3D domTree.createTextNode(error_code) + error_code_node.appendChild(error_code_text_value) + customer_node.appendChild(error_code_node) + rootNode.appendChild(customer_node) + + with open(ExceptionFile, 'w') as f: + domTree.writexml(f,indent=3D'',addindent=3D'',newl=3D'\n',encoding= =3D'UTF-8') + +def GetPkgList(EnvList): + WORKDIR =3D EnvList['WORKDIR'] + dirs =3D os.listdir(WORKDIR) + PkgList =3D [] + for directory in dirs: + if directory.endswith('Pkg'): + PkgList.append(directory) + return PkgList + +def GenerateEccReport(EnvList, ModifyDirList, EccDiffRange): + IsECCNeed =3D False + IsTrue =3D True + PkgList =3D GetPkgList(EnvList) + + for Line in ModifyDirList: + print('echo Run ECC tool for the commit in %s' % Line) + GlobalSymbol['GenerateEccReport'] =3D True + for Pkg in PkgList: + if Pkg in Line: + IsECCNeed =3D True + Ecc_cmd =3D ["ecc", "-c", "%WORKDIR%\BaseTools\Source\Pyth= on\Ecc\config.ini", + "-e", "%WORKDIR%\BaseTools\Source\Python= \Ecc\exception.xml", + "-t", "%WORKDIR%\{}".format(Line), + "-r", "%WORKDIR%\Ecc.csv"] + _, _, result, return_code =3D ExecuteScript(Ecc_cmd, EnvLi= st, shell=3DTrue) + if return_code !=3D 0: + IsTrue =3D False + break + + if not IsTrue: + print('Fail to run ECC tool') + GlobalSymbol['SCRIPT_ERROR'] =3D True + EndDelFile(EnvList) + + if GlobalSymbol.get('GenerateEccReport'): + ParseEccReport(EnvList, EccDiffRange) + else: + print("Patch check tool or ECC tool don't detect error") + + if IsECCNeed: + revert_cmd =3D ["git", "checkout", "--", "%WORKDIR%\BaseTools\Sour= ce\Python\Ecc\exception.xml"] + _, _, result, return_code =3D ExecuteScript(revert_cmd, EnvList, s= hell=3DTrue) + else: + print("Doesn't need run ECC check") + return + +def ParseEccReport(EnvList, EccDiffRange): + WorkDir =3D EnvList['WORKDIR'] + EccLog =3D os.path.join(WorkDir, "Ecc.log") + EccsCsv =3D "Ecc.csv" + FileList =3D os.listdir(WorkDir) + rowLines =3D [] + if EccsCsv in FileList: + with open(EccsCsv) as Csv: + reader =3D csv.reader(Csv) + for row in reader: + for ModifyFile in EccDiffRange: + if ModifyFile in row[3]: + for i in EccDiffRange[ModifyFile]: + LineNo =3D int(row[4]) + if i[0] <=3D LineNo <=3D i[1]: + row[0] =3D '\nEFI coding style error' + row[1] =3D 'Error code: ' + row[1] + row[3] =3D 'File: ' + row[3] + row[4] =3D 'Line number: ' + row[4] + rowLine =3D '\n *'.join(row) + rowLines.append(rowLine) + break + break + if rowLines: + GlobalSymbol['ECC_PASS'] =3D False + + with open(EccLog, 'a') as EccFile: + AllLine =3D '\n'.join(rowLines) + AllLine =3D AllLine + '\n' + EccFile.writelines(AllLine) + +def RemoveFile(File): + if os.path.exists(File): + os.remove(File) + +def ExecuteScript(command, env_variables, collect_env=3DFalse, + enable_std_pipe=3DFalse, shell=3DTrue): + """launches a process that executes a script/shell command passed to it + + :param command: The command/script with its commandline + arguments to be executed + :type command: List:String + :param env_variables: Environment variables passed to the process + :type env_variables: String + :param collect_env: Enables the collection of evironment variables + when process execution is done + :type collect_env: Boolean + :param enable_std_pipe: Enables process out to be piped to + :type enable_std_pipe: String + :returns: a tuple of std_out, stderr , environment variables, + return code + :rtype: Tuple: (std_out, stderr , enVar, return_code) + """ + + env_marker =3D '-----env-----' + env =3D {} + kwarg =3D {"env": env_variables, + "universal_newlines": True, + "shell": shell, + "cwd": env_variables["WORKSPACE"]} + + if enable_std_pipe or collect_env: + kwarg["stdout"] =3D subprocess.PIPE + kwarg["stderr"] =3D subprocess.PIPE + + if collect_env: + # get the binary that prints environment variables based on os + if os.name =3D=3D 'nt': + get_var_command =3D "set" + else: + get_var_command =3D "env" + # modify the command to print the environment variables + if isinstance(command, list): + command +=3D ["&&", "echo", env_marker, "&&", + get_var_command, "&&", "echo", env_marker] + else: + command +=3D " " + " ".join(["&&", "echo", env_marker, + "&&", get_var_command, + "&&", "echo", env_marker]) + + # execute the command + execute =3D subprocess.Popen(command, **kwarg) + std_out, stderr =3D execute.communicate() + code =3D execute.returncode + + # wait for process to be done + execute.wait() + + # if collect enviroment variables + if collect_env: + # get the new environment variables + std_out, env =3D GetEnvironmentVariables(std_out, env_marker) + return (std_out, stderr, env, code) + +def GetEnvironmentVariables(std_out_str, marker): + """Gets the environment variables from a process + + :param std_out_str: The std_out pipe + :type std_out_str: String + :param marker: A begining and end mark of environment + variables printed to std_out + :type marker: String + :returns: The environment variables read from the process' std_out= pipe + :rtype: Tuple + """ + start_env_update =3D False + environment_vars =3D {} + out_put =3D "" + for line in std_out_str.split("\n"): + if start_env_update and len(line.split("=3D")) =3D=3D 2: + key, value =3D line.split("=3D") + environment_vars[key] =3D value + else: + out_put +=3D "\n" + line.replace(marker, "") + + if marker in line: + if start_env_update: + start_env_update =3D False + else: + start_env_update =3D True + return (out_put, environment_vars) + +def EndDelFile(EnvList): + WORKDIR =3D EnvList['WORKDIR'] + ModifyFileListLog =3D os.path.join(WORKDIR, 'PatchModifyFiles.log') + RemoveFile(ModifyFileListLog) + PatchLog =3D os.path.join(WORKDIR, 'PatchFile.log') + RemoveFile(PatchLog) + FileLog =3D os.path.join(WORKDIR, "File.log") + RemoveFile(FileLog) + if GlobalSymbol.get('GenerateEccReport'): + FileList =3D os.listdir(WORKDIR) + CsvList =3D [os.path.join(WORKDIR, File) for File in FileList if F= ile.endswith('.csv')] + for Csv in CsvList: + RemoveFile(Csv) + if GlobalSymbol.get('SCRIPT_ERROR'): + print('ECC tool detect error') + exit(1) + +def EdksetupRebuild(EnvList, WORKDIR): + EnvList['WORKDIR'] =3D WORKDIR + EnvList['WORKSPACE'] =3D WORKDIR + edk2_setup_cmd =3D ["edksetup", "Rebuild"] + _, _, result, return_code =3D ExecuteScript(edk2_setup_cmd, EnvList, c= ollect_env=3DTrue, shell=3DTrue) + if return_code =3D=3D 0: + for Key in result: + EnvList[Key] =3D result[Key] + return True + return False + +def GetDiffrange(EnvList, commit): + WORKDIR =3D EnvList['WORKDIR'] + ModifyFileListLog =3D EnvList['ModifyFileListLog'] + RangeDirectory =3D {} + PatchLog =3D os.path.join(WORKDIR, 'PatchFile.log') + Format_Patch_cmd =3D ["git", "show", str(commit), "--unified=3D0", ">"= , PatchLog] + _, _, result, return_code =3D ExecuteScript(Format_Patch_cmd, EnvList,= shell=3DTrue) + if return_code !=3D 0: + print('Fail to run GIT') + GlobalSymbol['SCRIPT_ERROR'] =3D True + EndDelFile(EnvList) + with open(PatchLog, encoding=3D'utf8') as PatchLogFile: + Filelines =3D PatchLogFile.readlines() + IsDelete =3D True + StartCheck =3D False + for line in Filelines: + ModifyFile =3D FindModifyFile.findall(line) + if ModifyFile and not StartCheck and os.path.isfile(ModifyFile= [0]): + ModifyFileCommentDic =3D GetCommentRange(EnvList, ModifyFi= le[0]) + IsDelete =3D False + StartCheck =3D True + ModifyFilieDic =3D ModifyFile[0] + ModifyFilieDic =3D ModifyFilieDic.replace("/","\\") + RangeDirectory[ModifyFilieDic] =3D [] + elif line.startswith('--- '): + StartCheck =3D False + elif re.match(LineScopePattern, line, re.I) and not IsDelete a= nd StartCheck: + startline =3D LineNumRange.search(line).group(1) + linerange =3D LineNumRange.search(line).group(2) + if not linerange: + linerange =3D '1' + RangeDirectory[ModifyFilieDic].append((int(startline), int= (startline) + int(linerange) - 1)) + for i in ModifyFileCommentDic: + if i[0] <=3D int(startline) <=3D i[1]: + RangeDirectory[ModifyFilieDic].append(i) + return RangeDirectory + +def GetCommentRange(EnvList, ModifyFile): + WORKDIR =3D EnvList['WORKDIR'] + ModifyFilePath =3D os.path.join(WORKDIR, ModifyFile) + with open(ModifyFilePath) as f: + LineNo =3D 1 + CommentRange =3D [] + Start =3D False + for line in f: + if line.startswith('/**'): + startno =3D LineNo + Start =3D True + if line.startswith('**/') and Start: + endno =3D LineNo + Start =3D False + CommentRange.append((int(startno), int(endno))) + LineNo +=3D 1 + + if CommentRange and CommentRange[0][0] =3D=3D 1: + del CommentRange[0] + return CommentRange + +def GetModifyDir(EnvList, commit): + WORKDIR =3D EnvList['WORKDIR'] + ModifyDirList =3D [] + ModifyFileListLog =3D os.path.join(WORKDIR, 'PatchModifyFiles.log') + EnvList['ModifyFileListLog'] =3D ModifyFileListLog + Patch_Modify_cmd =3D ["git", "diff", "--name-status", str(commit), str= (commit)+"~1", ">", ModifyFileListLog] + _, _, result, return_code =3D ExecuteScript(Patch_Modify_cmd, EnvList,= shell=3DTrue) + if return_code !=3D 0: + print('Fail to run GIT') + GlobalSymbol['SCRIPT_ERROR'] =3D True + EndDelFile(EnvList) + with open(ModifyFileListLog) as ModifyFile: + Filelines =3D ModifyFile.readlines() + for Line in Filelines: + FilePath =3D ReModifyFile.findall(Line) + if FilePath: + FileDir =3D os.path.dirname(FilePath[0]) + else: + continue + PkgList =3D GetPkgList(EnvList) + if FileDir in PkgList or not FileDir: + continue + else: + ModifyDirList.append('%s'%FileDir) + + ModifyDirList =3D list(set(ModifyDirList)) + return ModifyDirList + +def ApplyConfig(EnvList, ModifyDirList, EccDiffRange): + WORKDIR =3D EnvList['WORKDIR'] + ModifyPkgList =3D [] + for ModifyDir in ModifyDirList: + ModifyPkg =3D ModifyDir.split("/")[0] + ModifyPkgList.append(ModifyPkg) + ModifyPkgList =3D list(set(ModifyPkgList)) + for ModifyPkg in ModifyPkgList: + pkg_config_file =3D os.path.join(WORKDIR, ModifyPkg, ModifyPkg + "= .ci.yaml") + if os.path.exists(pkg_config_file): + with open(pkg_config_file, 'r') as f: + pkg_config =3D yaml.safe_load(f) + if "EccCheck" in pkg_config: + EccConfig =3D pkg_config["EccCheck"] + # + # Add exceptions + # + ExceptionList =3D EccConfig["ExceptionList"] + ExceptionFile =3D os.path.join(WORKDIR, "BaseTools", "Sour= ce", "Python", "Ecc", "exception.xml") + if os.path.exists(ExceptionFile): + AppendException(ExceptionList, ExceptionFile) + # + # Exclude ignored files + # + IgnoreFilesList =3D EccConfig['IgnoreFiles'] + for ignore_file in IgnoreFilesList: + ignore_file =3D ignore_file.replace("/", "\\") + ignore_file =3D os.path.join(ModifyPkg, ignore_file) + if ignore_file in EccDiffRange: + del EccDiffRange[ignore_file] + return + +def CheckOneCommit(commit): + WORKDIR =3D os.getcwd() + EdksetupRebuild(EnvList, WORKDIR) + ModifyDirList =3D GetModifyDir(EnvList, commit) + EccDiffRange =3D GetDiffrange(EnvList, commit) + ApplyConfig(EnvList, ModifyDirList, EccDiffRange) + GenerateEccReport(EnvList, ModifyDirList, EccDiffRange) + EndDelFile(EnvList) + +def parse_options(): + parser =3D argparse.ArgumentParser(description=3D__copyright__) + parser.add_argument('commits', nargs=3D'*', + help=3D'[commit(s) ID | number of commits, like "-= 3" means check first 3 commits]') + args =3D parser.parse_args() + return args + +def process_one_arg(self, arg): + if len(arg) >=3D 2 and arg[0] =3D=3D '-': + count =3D int(arg[1:]) + CheckOneArg(arg, self.count).ok + + +def read_commit_list_from_git(start_commit, count): + cmd =3D ['git', 'rev-list', '--abbrev-commit', '--no-walk' ] + if count is not None: + cmd.append('--max-count=3D' + str(count)) + cmd.append(start_commit) + p =3D subprocess.Popen(cmd, + stdout=3Dsubprocess.PIPE, + stderr=3Dsubprocess.STDOUT) + result =3D p.communicate() + out =3D result[0].decode('utf-8', 'ignore') if result[0] and result[0]= .find(b"fatal")!=3D0 else None + return out.split() if out else [] + +def ReleaseReport(EnvList): + WORKDIR =3D EnvList['WORKDIR'] + EccLog =3D os.path.join(WORKDIR, "ECC.log") + if GlobalSymbol['ECC_PASS']: + print('\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3DEcc pass=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D') + RemoveFile(EccLog) + return 0 + else: + print('\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3DEcc error detected=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D') + with open(EccLog) as output: + print(output.read()) + RemoveFile(EccLog) + return -1 + +def main(): + commits =3D parse_options().commits + + if len(commits) =3D=3D 0: + commits =3D [ 'HEAD' ] + + if len(commits[0]) >=3D 2 and commits[0][0] =3D=3D '-': + count =3D int(commits[0][1:]) + commits =3D read_commit_list_from_git('HEAD', count) + + """ + This 'if' block is only used for creating pull request. + """ + if ".." in commits[0]: + commits =3D read_commit_list_from_git(commits[0], None) + + GlobalSymbol['ECC_PASS'] =3D True + for commit in commits: + CheckOneCommit(commit) + + retval =3D ReleaseReport(EnvList) + return retval + +if __name__ =3D=3D "__main__": + sys.exit(main()) \ No newline at end of file --=20 2.18.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#60633): https://edk2.groups.io/g/devel/message/60633 Mute This Topic: https://groups.io/mt/74645923/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu May 2 21:40:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+60634+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+60634+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1591174100; cv=none; d=zohomail.com; s=zohoarc; b=UyqEOp0XYxM+x+T+i5iuR7Pqt9QaNWV/8uY9bhkujtErkOmrwr5Yt+AocugLWEK8q8zHgUJszdfF+aAlWYvqeJ9eewmU1KpyiEa2fGkXgukrw+nCISoJc/XV0NIw724WNZoAxTMhsVTmzcFuBQLQFmWrllhoaebnZRhS5ZRuW68= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591174100; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=tpngWifi+XsOIfyHt9xa6+vhhjN4Q+nkwfjqn1Vhqb4=; b=NF59Kp3qyZRRIiO7oFFoh9z7upYSdk6YpNI98kGMzZ+Ynj8/XwZ4Gaa+Lnm/3b4UA9T+Xmnte845hJrMHh8hsy7OCh2u9XBZ97RuIbhAlue3yhwsh0f1CL5OyWWaoap/YAOHBFWaodgmyby9AiuYNqZI6vkjGftTwGKwNyhTmHQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+60634+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1591174100745870.2967276426787; Wed, 3 Jun 2020 01:48:20 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id BXFEYY1788612x8fyPHJa7UX; Wed, 03 Jun 2020 01:48:20 -0700 X-Received: from mga01.intel.com (mga01.intel.com []) by mx.groups.io with SMTP id smtpd.web10.9648.1591174092723471280 for ; Wed, 03 Jun 2020 01:48:19 -0700 IronPort-SDR: +5rb6vSPoFH3nGQpHu1rWchHXte7I3AKegYX+JWOWOExx+p/vc8d2rLqDXompstiebHh0gvVEf Hi9wIp3rAYhg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2020 01:48:19 -0700 IronPort-SDR: yqMkLabFp23LhnBQen74XeC4RAIUfaQwYYcAu31xQ6O8Mso/uQN3sDZjV69b4thSqIKNsFlAT2 mXYsA6PkI9Ww== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,467,1583222400"; d="scan'208";a="470975847" X-Received: from shenglei-dev.ccr.corp.intel.com ([10.239.158.52]) by fmsmga006.fm.intel.com with ESMTP; 03 Jun 2020 01:48:17 -0700 From: "Zhang, Shenglei" To: devel@edk2.groups.io Cc: Sean Brogan , Bret Barkelew , Michael D Kinney , Liming Gao Subject: [edk2-devel] [PATCH v2 3/5] pip-requirements.txt: Add Ecc required lib Date: Wed, 3 Jun 2020 16:48:05 +0800 Message-Id: <20200603084807.24484-4-shenglei.zhang@intel.com> In-Reply-To: <20200603084807.24484-1-shenglei.zhang@intel.com> References: <20200603084807.24484-1-shenglei.zhang@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,shenglei.zhang@intel.com X-Gm-Message-State: MIhC1tM1XW6hVpkF2deBbNnjx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1591174100; bh=p1W2FeBJ2X+OXnvR94aSVnbiNDADVp47bibpp+hYeOI=; h=Cc:Date:From:Reply-To:Subject:To; b=lfqXkIAkTmUbVy33yJZyG4Wk/EBWDHIB2HcYCHY7q21GX/UjuDh+CVMi+uGmEBOpbuZ 2UmMwA4zOG+FiMW+IGVPpQTcoDOJqiylkBbpbm14re0egsGfqrRMAoTm4UF7W9CcC9tS8 DNLF9NCQrL93rj0CZinsla4ZFKxMcpNGQNc= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" antlr4-python3-runtime is a lib to support Ecc run with Py3.x. Cc: Sean Brogan Cc: Bret Barkelew Cc: Michael D Kinney Cc: Liming Gao Signed-off-by: Shenglei Zhang --- pip-requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/pip-requirements.txt b/pip-requirements.txt index 574dac43b1a6..7e83ddd9b3c9 100644 --- a/pip-requirements.txt +++ b/pip-requirements.txt @@ -14,3 +14,4 @@ =20 edk2-pytool-library=3D=3D0.10.* edk2-pytool-extensions~=3D0.13.3 +antlr4-python3-runtime \ No newline at end of file --=20 2.18.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#60634): https://edk2.groups.io/g/devel/message/60634 Mute This Topic: https://groups.io/mt/74645924/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu May 2 21:40:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+60635+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+60635+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1591174102; cv=none; d=zohomail.com; s=zohoarc; b=g1L2AvYY41YS4MXARFeIloppQmeEA+jhQ6QeuxClXRgyNihmx2ZITPh2NNRh0sL3nunMR2Fw7cCK9+mS7Mb88IHn6N+xTEZhTUVuj3F53e87jFq/HTGtCkSOI1Z3CImpPEtqt6Yk1XVktm7Ms+4oJ88S0tnitr/y2kBWldystcY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591174102; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=QIsmmeabsqNRx2eQ1Q/DbAjcRT8HUEAkr0yByvAXpQo=; b=gVGLs2BgG6snTZxyq9A+hFgFjxsQztmih/7XQxHg1cLFtVba7etYBCc+IZDtvEInV/aXnwj47/Zy7hYPIPOUmcxjOAwa+ljYtwSdU2SW8I7POl7Ge2/WR9Ks/Ofp2J+IMENYPyMR3Uva53z7O+rGGJHmLSC5al76bAKxmt+7wKM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+60635+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 15911741027694.80011735477899; Wed, 3 Jun 2020 01:48:22 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 9TdZYY1788612xie2NjI0tyW; Wed, 03 Jun 2020 01:48:22 -0700 X-Received: from mga01.intel.com (mga01.intel.com []) by mx.groups.io with SMTP id smtpd.web10.9648.1591174092723471280 for ; Wed, 03 Jun 2020 01:48:21 -0700 IronPort-SDR: dNwRzfxH/R66Mv9UTUUTIGwg+zW5zsTwZnhPX5pIavMaJP9gvP30rzYTBIqjk7lfZOuNaqLi1N wpg2bYMC4FUA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2020 01:48:21 -0700 IronPort-SDR: 0JSbtephq6HjnSFVkkuTqF9wn09GayxQC8E5c3vr92gFqTQFjbV+jziY5sp6kHFM3BrseqQMHE w8XpbtyWoObw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,467,1583222400"; d="scan'208";a="470975864" X-Received: from shenglei-dev.ccr.corp.intel.com ([10.239.158.52]) by fmsmga006.fm.intel.com with ESMTP; 03 Jun 2020 01:48:20 -0700 From: "Zhang, Shenglei" To: devel@edk2.groups.io Cc: Sean Brogan , Bret Barkelew , Michael D Kinney , Liming Gao Subject: [edk2-devel] [PATCH v2 4/5] .azurepiplines: Add a pipline to check ECC issues for commits Date: Wed, 3 Jun 2020 16:48:06 +0800 Message-Id: <20200603084807.24484-5-shenglei.zhang@intel.com> In-Reply-To: <20200603084807.24484-1-shenglei.zhang@intel.com> References: <20200603084807.24484-1-shenglei.zhang@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,shenglei.zhang@intel.com X-Gm-Message-State: Y5YV05Uf9MLLuWXGPW2mlbfJx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1591174102; bh=FIdakHa6xBQr2r7FDhJ0EL09kDeqMbV0qAL0qHdjPPw=; h=Cc:Date:From:Reply-To:Subject:To; b=IBe80MWU3AhtZGoTVzCGAf+9uLR1tmMDtEatRfrjiSadNefSJe/kUFVwTZ4gHkp2OoY R3zdaKz5AmS73ubvwr32/GfBWR8wQF2dz/7HjYm64mk2t09OyTXZbkkicBhRIKQjGVDAo uDHWUWjpX1V9QTBjVxCccEwRYOwjKKLpV7k= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2606 Add a pipeline to run the ECC checks on Azure Pipelines agents for edk2 open ci. Cc: Sean Brogan Cc: Bret Barkelew Cc: Michael D Kinney Cc: Liming Gao Signed-off-by: Shenglei Zhang --- .azurepipelines/Windows-EccCheck.yml | 38 ++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .azurepipelines/Windows-EccCheck.yml diff --git a/.azurepipelines/Windows-EccCheck.yml b/.azurepipelines/Windows= -EccCheck.yml new file mode 100644 index 000000000000..0d20551efb5f --- /dev/null +++ b/.azurepipelines/Windows-EccCheck.yml @@ -0,0 +1,38 @@ +## @file +# Azure Pipielines YML file that evalues the patch series in a PR using the +# python script BaseTools/Scripts/PatchCheck.py. +# +# NOTE: This example monitors pull requests against the edk2-ci branch. M= ost +# environments would replace 'edk2-ci' with 'master'. +# +# Copyright (c) 2019, Intel Corporation. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent +# +# https://github.com/tianocore +# +## + +trigger: none + +pr: +- master + +pool: + vmImage: 'windows-latest' + +steps: +- checkout: self + clean: true + +- task: UsePythonVersion@0 + inputs: + versionSpec: '3.8.x' + architecture: 'x64' + +- script: pip install -r pip-requirements.txt + displayName: 'Install/Upgrade pip modules' + +- script: | + git fetch origin $(System.PullRequest.TargetBranch):$(System.PullReque= st.TargetBranch) + py -3 BaseTools/Scripts/EccCheck.py $(System.PullRequest.TargetBranch)= ..$(System.PullRequest.SourceCommitId) + displayName: 'Use EccCheck.py to verify patch series in pull request' --=20 2.18.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#60635): https://edk2.groups.io/g/devel/message/60635 Mute This Topic: https://groups.io/mt/74645926/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Thu May 2 21:40:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+60636+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+60636+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1591174104; cv=none; d=zohomail.com; s=zohoarc; b=lZBW/SErEx7dTBxgZ+6vI5bC8rdlE6QnSdGbb7BCMDG+/LEFXKAOzm2LAfxdMEJgF/DJAYWzb4E91052hkz55Oogb2Vl0XeLkrBDhwlagSJq7V9JNHinE9Dz7EHL5i2ltNNmlGArC0wEruzwdKzr9H4ZamIgHtqT6qFsRNvz7Ac= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591174104; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=qqSBVChPDO2nLvMFjlO764zAmy11RvJ69TNKQOIPkLc=; b=Yle+CrZH4DNd6I7qaHy57V0r9Mxge1xHhmGGhjouHRS9s62i5a27ZlTVIZ3n319TvnW2eq039xk8xSshovujiFb2gy6V/HOEMVK5Oh3j9X4fK/m14g7w5tnJbG1K+H6lqaM9AC0RqKfsLp9LOlg1ncW7R+Gm2coj4jhev7TO1M8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+60636+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 15911741047371004.4882769667581; Wed, 3 Jun 2020 01:48:24 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id mp75YY1788612xuDZo1yTkyz; Wed, 03 Jun 2020 01:48:24 -0700 X-Received: from mga01.intel.com (mga01.intel.com []) by mx.groups.io with SMTP id smtpd.web10.9648.1591174092723471280 for ; Wed, 03 Jun 2020 01:48:24 -0700 IronPort-SDR: fWCIsmBMHQIiuwr+WpiHnhz40XvkdKXC7Q8zN1YB0DWo06c3NMJpGoTf/sI2nxX9FzF55ND2la KBGrL04Z2mzQ== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jun 2020 01:48:23 -0700 IronPort-SDR: I9TT+Nzi4SdmhkbZq8y3F2ZUTGWpqholRn6qjmRmk/f72n6NfCoKFB7fa1RHE2wKB8/drsEYRH PGP6AHBn8bjg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,467,1583222400"; d="scan'208";a="470975887" X-Received: from shenglei-dev.ccr.corp.intel.com ([10.239.158.52]) by fmsmga006.fm.intel.com with ESMTP; 03 Jun 2020 01:48:22 -0700 From: "Zhang, Shenglei" To: devel@edk2.groups.io Cc: Jian J Wang , Hao A Wu Subject: [edk2-devel] [PATCH v2 5/5] MdeModulePkg/MdeModulePkg.ci.yaml: Add configuration for Ecc check Date: Wed, 3 Jun 2020 16:48:07 +0800 Message-Id: <20200603084807.24484-6-shenglei.zhang@intel.com> In-Reply-To: <20200603084807.24484-1-shenglei.zhang@intel.com> References: <20200603084807.24484-1-shenglei.zhang@intel.com> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,shenglei.zhang@intel.com X-Gm-Message-State: d9CidytdiZg49065wUN0dkBLx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1591174104; bh=7a50HXr8hhRkFfW0H1r7wfUGWjvNDNyKBsHCOW4cX00=; h=Cc:Date:From:Reply-To:Subject:To; b=tlFSpNrFajVjvHZfRpmUC9NU8nfG1+TD8n9SWpI0RAcZW35QhLkXPvKOW/s09O8vDQL u/HVSXbDINNRb+HZqMA9Og7CsnkeeL++iXLmhDISc7Uw8Yy3b+TZD0PdG3Kzyel7dT3IT 1cmrPq2NHtfp8dSOTBPYYWQLyeJAeaVbzkw= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" This is a sample for users to add exceptions and ignored files for their own use. Cc: Jian J Wang Cc: Hao A Wu Signed-off-by: Shenglei Zhang --- MdeModulePkg/MdeModulePkg.ci.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/MdeModulePkg/MdeModulePkg.ci.yaml b/MdeModulePkg/MdeModulePkg.= ci.yaml index 1cfc1328390e..8ccf667d12f3 100644 --- a/MdeModulePkg/MdeModulePkg.ci.yaml +++ b/MdeModulePkg/MdeModulePkg.ci.yaml @@ -5,6 +5,14 @@ # SPDX-License-Identifier: BSD-2-Clause-Patent ## { + "EccCheck": { + "ExceptionList": [ + "8001", "aaabbb" + ], + "IgnoreFiles": [ + "Library/BaseBmpSupportLib/BmpSupportLib.c" + ] + }, ## options defined ci/Plugin/CompilerPlugin "CompilerPlugin": { "DscPath": "MdeModulePkg.dsc" --=20 2.18.0.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#60636): https://edk2.groups.io/g/devel/message/60636 Mute This Topic: https://groups.io/mt/74645927/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-