From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 4A98C81E56 for ; Tue, 22 Nov 2016 19:12:42 -0800 (PST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP; 22 Nov 2016 19:12:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,684,1473145200"; d="scan'208";a="8237971" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga002.jf.intel.com with ESMTP; 22 Nov 2016 19:12:41 -0800 Received: from fmsmsx151.amr.corp.intel.com (10.18.125.4) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 22 Nov 2016 19:12:41 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by FMSMSX151.amr.corp.intel.com (10.18.125.4) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 22 Nov 2016 19:12:40 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.239]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.138]) with mapi id 14.03.0248.002; Wed, 23 Nov 2016 11:12:39 +0800 From: "Gao, Liming" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" Thread-Topic: [Patch] BaseTools: report error for same Guid's Private definition conflict Thread-Index: AQHSQkZO3BwmuBE3yk+++n7NUaLSaaDl6lFQ Date: Wed, 23 Nov 2016 03:12:38 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14B4B84F6@shsmsx102.ccr.corp.intel.com> References: <1479547281-18232-1-git-send-email-yonghong.zhu@intel.com> In-Reply-To: <1479547281-18232-1-git-send-email-yonghong.zhu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] BaseTools: report error for same Guid's Private definition conflict X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Nov 2016 03:12:42 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao > -----Original Message----- > From: Zhu, Yonghong > Sent: Saturday, November 19, 2016 5:21 PM > To: edk2-devel@lists.01.org > Cc: Gao, Liming > Subject: [Patch] BaseTools: report error for same Guid's Private definiti= on > conflict >=20 > Add error check for the same Guid/Protocol/PPIs/Includes defined as both > Private and non-Private attribute. >=20 > Fixes: https://bugzilla.tianocore.org/show_bug.cgi?id=3D209 > Cc: Liming Gao > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Yonghong Zhu > --- > .../Source/Python/Workspace/WorkspaceDatabase.py | 33 > ++++++++++++++++++++++ > 1 file changed, 33 insertions(+) >=20 > diff --git a/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py > b/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py > index ceaa4b8..b413a98 100644 > --- a/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py > +++ b/BaseTools/Source/Python/Workspace/WorkspaceDatabase.py > @@ -1408,17 +1408,25 @@ class DecBuildData(PackageBuildClassObject): > # > ProtocolDict =3D tdict(True) > PrivateProtocolDict =3D tdict(True) > NameList =3D [] > PrivateNameList =3D [] > + PublicNameList =3D [] > # find out all protocol definitions for specific and 'common= ' arch > RecordList =3D self._RawData[MODEL_EFI_PROTOCOL, self._Arch] > for Name, Guid, Dummy, Arch, PrivateFlag, ID, LineNo in Reco= rdList: > if PrivateFlag =3D=3D 'PRIVATE': > if Name not in PrivateNameList: > PrivateNameList.append(Name) > PrivateProtocolDict[Arch, Name] =3D Guid > + if Name in PublicNameList: > + EdkLogger.error('build', OPTION_CONFLICT, "Can't > determine %s's attribute, it is both defined as Private and non-Private > attribute in DEC file." % Name, File=3Dself.MetaFile, Line=3DLineNo) > + else: > + if Name not in PublicNameList: > + PublicNameList.append(Name) > + if Name in PrivateNameList: > + EdkLogger.error('build', OPTION_CONFLICT, "Can't > determine %s's attribute, it is both defined as Private and non-Private > attribute in DEC file." % Name, File=3Dself.MetaFile, Line=3DLineNo) > if Name not in NameList: > NameList.append(Name) > ProtocolDict[Arch, Name] =3D Guid > # use sdict to keep the order > self._Protocols =3D sdict() > @@ -1442,17 +1450,25 @@ class DecBuildData(PackageBuildClassObject): > # > PpiDict =3D tdict(True) > PrivatePpiDict =3D tdict(True) > NameList =3D [] > PrivateNameList =3D [] > + PublicNameList =3D [] > # find out all PPI definitions for specific arch and 'common= ' arch > RecordList =3D self._RawData[MODEL_EFI_PPI, self._Arch] > for Name, Guid, Dummy, Arch, PrivateFlag, ID, LineNo in Reco= rdList: > if PrivateFlag =3D=3D 'PRIVATE': > if Name not in PrivateNameList: > PrivateNameList.append(Name) > PrivatePpiDict[Arch, Name] =3D Guid > + if Name in PublicNameList: > + EdkLogger.error('build', OPTION_CONFLICT, "Can't > determine %s's attribute, it is both defined as Private and non-Private > attribute in DEC file." % Name, File=3Dself.MetaFile, Line=3DLineNo) > + else: > + if Name not in PublicNameList: > + PublicNameList.append(Name) > + if Name in PrivateNameList: > + EdkLogger.error('build', OPTION_CONFLICT, "Can't > determine %s's attribute, it is both defined as Private and non-Private > attribute in DEC file." % Name, File=3Dself.MetaFile, Line=3DLineNo) > if Name not in NameList: > NameList.append(Name) > PpiDict[Arch, Name] =3D Guid > # use sdict to keep the order > self._Ppis =3D sdict() > @@ -1476,17 +1492,25 @@ class DecBuildData(PackageBuildClassObject): > # > GuidDict =3D tdict(True) > PrivateGuidDict =3D tdict(True) > NameList =3D [] > PrivateNameList =3D [] > + PublicNameList =3D [] > # find out all protocol definitions for specific and 'common= ' arch > RecordList =3D self._RawData[MODEL_EFI_GUID, self._Arch] > for Name, Guid, Dummy, Arch, PrivateFlag, ID, LineNo in Reco= rdList: > if PrivateFlag =3D=3D 'PRIVATE': > if Name not in PrivateNameList: > PrivateNameList.append(Name) > PrivateGuidDict[Arch, Name] =3D Guid > + if Name in PublicNameList: > + EdkLogger.error('build', OPTION_CONFLICT, "Can't > determine %s's attribute, it is both defined as Private and non-Private > attribute in DEC file." % Name, File=3Dself.MetaFile, Line=3DLineNo) > + else: > + if Name not in PublicNameList: > + PublicNameList.append(Name) > + if Name in PrivateNameList: > + EdkLogger.error('build', OPTION_CONFLICT, "Can't > determine %s's attribute, it is both defined as Private and non-Private > attribute in DEC file." % Name, File=3Dself.MetaFile, Line=3DLineNo) > if Name not in NameList: > NameList.append(Name) > GuidDict[Arch, Name] =3D Guid > # use sdict to keep the order > self._Guids =3D sdict() > @@ -1504,10 +1528,11 @@ class DecBuildData(PackageBuildClassObject): > ## Retrieve public include paths declared in this package > def _GetInclude(self): > if self._Includes =3D=3D None: > self._Includes =3D [] > self._PrivateIncludes =3D [] > + PublicInclues =3D [] > RecordList =3D self._RawData[MODEL_EFI_INCLUDE, self._Arch] > Macros =3D self._Macros > Macros["EDK_SOURCE"] =3D GlobalData.gEcpSource > for Record in RecordList: > File =3D PathClass(NormPath(Record[0], Macros), self._Pa= ckageDir, > Arch=3Dself._Arch) > @@ -1521,10 +1546,18 @@ class DecBuildData(PackageBuildClassObject): > if File not in self._Includes: > self._Includes.append(File) > if Record[4] =3D=3D 'PRIVATE': > if File not in self._PrivateIncludes: > self._PrivateIncludes.append(File) > + if File in PublicInclues: > + EdkLogger.error('build', OPTION_CONFLICT, "Can't > determine %s's attribute, it is both defined as Private and non-Private > attribute in DEC file." % File, File=3Dself.MetaFile, Line=3DLineNo) > + else: > + if File not in PublicInclues: > + PublicInclues.append(File) > + if File in self._PrivateIncludes: > + EdkLogger.error('build', OPTION_CONFLICT, "Can't > determine %s's attribute, it is both defined as Private and non-Private > attribute in DEC file." % File, File=3Dself.MetaFile, Line=3DLineNo) > + > return self._Includes >=20 > ## Retrieve library class declarations (not used in build at present= ) > def _GetLibraryClass(self): > if self._LibraryClasses =3D=3D None: > -- > 2.6.1.windows.1