public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] BaseTools: PCD can only use single access method by source build
@ 2017-05-03  9:20 Yonghong Zhu
  2017-05-05  9:14 ` Gao, Liming
  0 siblings, 1 reply; 2+ messages in thread
From: Yonghong Zhu @ 2017-05-03  9:20 UTC (permalink / raw)
  To: edk2-devel; +Cc: Liming Gao

Add the error check that A PCD can only use one type for all source
modules.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
---
 BaseTools/Source/Python/AutoGen/AutoGen.py | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py b/BaseTools/Source/Python/AutoGen/AutoGen.py
index 8075afc..205a75d 100644
--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
@@ -502,10 +502,26 @@ class WorkspaceAutoGen(AutoGen):
                         elif 'FixedAtBuild' in BuildData.Pcds[key].Type:
                             if (BuildData.Pcds[key].TokenCName, BuildData.Pcds[key].TokenSpaceGuidCName) not in SourcePcdDict['FixedAtBuild']:
                                 SourcePcdDict['FixedAtBuild'].append((BuildData.Pcds[key].TokenCName, BuildData.Pcds[key].TokenSpaceGuidCName))
                 else:
                     pass
+            #
+            # A PCD can only use one type for all source modules
+            #
+            for i in SourcePcdDict_Keys:
+                for j in SourcePcdDict_Keys:
+                    if i != j:
+                        IntersectionList = list(set(SourcePcdDict[i]).intersection(set(SourcePcdDict[j])))
+                        if len(IntersectionList) > 0:
+                            EdkLogger.error(
+                            'build',
+                            FORMAT_INVALID,
+                            "Building modules from source INFs, following PCD use %s and %s access method. It must be corrected to use only one access method." % (i, j),
+                            ExtraData="%s" % '\n\t'.join([str(P[1]+'.'+P[0]) for P in IntersectionList])
+                            )
+                    else:
+                        pass
 
             #
             # intersection the BinaryPCD for Mixed PCD
             #
             for i in BinaryPcdDict_Keys:
-- 
2.6.1.windows.1



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

* Re: [Patch] BaseTools: PCD can only use single access method by source build
  2017-05-03  9:20 [Patch] BaseTools: PCD can only use single access method by source build Yonghong Zhu
@ 2017-05-05  9:14 ` Gao, Liming
  0 siblings, 0 replies; 2+ messages in thread
From: Gao, Liming @ 2017-05-05  9:14 UTC (permalink / raw)
  To: Zhu, Yonghong, edk2-devel@lists.01.org

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

>-----Original Message-----
>From: Zhu, Yonghong
>Sent: Wednesday, May 03, 2017 5:21 PM
>To: edk2-devel@lists.01.org
>Cc: Gao, Liming <liming.gao@intel.com>
>Subject: [Patch] BaseTools: PCD can only use single access method by source
>build
>
>Add the error check that A PCD can only use one type for all source
>modules.
>
>Cc: Liming Gao <liming.gao@intel.com>
>Contributed-under: TianoCore Contribution Agreement 1.0
>Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
>---
> BaseTools/Source/Python/AutoGen/AutoGen.py | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
>diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py
>b/BaseTools/Source/Python/AutoGen/AutoGen.py
>index 8075afc..205a75d 100644
>--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
>+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
>@@ -502,10 +502,26 @@ class WorkspaceAutoGen(AutoGen):
>                         elif 'FixedAtBuild' in BuildData.Pcds[key].Type:
>                             if (BuildData.Pcds[key].TokenCName,
>BuildData.Pcds[key].TokenSpaceGuidCName) not in
>SourcePcdDict['FixedAtBuild']:
>
>SourcePcdDict['FixedAtBuild'].append((BuildData.Pcds[key].TokenCName,
>BuildData.Pcds[key].TokenSpaceGuidCName))
>                 else:
>                     pass
>+            #
>+            # A PCD can only use one type for all source modules
>+            #
>+            for i in SourcePcdDict_Keys:
>+                for j in SourcePcdDict_Keys:
>+                    if i != j:
>+                        IntersectionList =
>list(set(SourcePcdDict[i]).intersection(set(SourcePcdDict[j])))
>+                        if len(IntersectionList) > 0:
>+                            EdkLogger.error(
>+                            'build',
>+                            FORMAT_INVALID,
>+                            "Building modules from source INFs, following PCD use %s
>and %s access method. It must be corrected to use only one access method." %
>(i, j),
>+                            ExtraData="%s" % '\n\t'.join([str(P[1]+'.'+P[0]) for P in
>IntersectionList])
>+                            )
>+                    else:
>+                        pass
>
>             #
>             # intersection the BinaryPCD for Mixed PCD
>             #
>             for i in BinaryPcdDict_Keys:
>--
>2.6.1.windows.1



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

end of thread, other threads:[~2017-05-05  9:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-03  9:20 [Patch] BaseTools: PCD can only use single access method by source build Yonghong Zhu
2017-05-05  9:14 ` Gao, Liming

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