public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: BobCF <bob.c.feng@intel.com>
To: edk2-devel@lists.01.org
Cc: Bob Feng <bob.c.feng@intel.com>, Liming Gao <liming.gao@intel.com>
Subject: [Patch] BaseTools: Report Error if use SET in Dsc
Date: Wed,  2 Jan 2019 16:44:01 +0800	[thread overview]
Message-ID: <20190102084401.1264-1-bob.c.feng@intel.com> (raw)

Build tool do not support SET syntax in DSC.

If the SET statement is used in DSC, build tool just ignore it.

That behavior confused some users that
they think SET statement works in DSC like in FDF.

To avoid such confusion, build tool report ERROR

if there is "SET" statement in Dsc file.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
---
 BaseTools/Source/Python/Workspace/MetaFileParser.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/BaseTools/Source/Python/Workspace/MetaFileParser.py b/BaseTools/Source/Python/Workspace/MetaFileParser.py
index 032220813b..19d8452a35 100644
--- a/BaseTools/Source/Python/Workspace/MetaFileParser.py
+++ b/BaseTools/Source/Python/Workspace/MetaFileParser.py
@@ -975,10 +975,15 @@ class DscParser(MetaFileParser):
             else:
                 SectionType = self._SectionType
             self._ItemType = SectionType
 
             self._ValueList = ['', '', '']
+            # "SET pcd = pcd_expression" syntax is not supported in Dsc file.
+            if self._CurrentLine.upper().strip().startswith("SET "):
+                EdkLogger.error('Parser', FORMAT_INVALID, '''"SET pcd = pcd_expression" syntax is not support in Dsc file''',
+                                ExtraData=self._CurrentLine,
+                                File=self.MetaFile, Line=self._LineIndex + 1)
             self._SectionParser[SectionType](self)
             if self._ValueList is None:
                 continue
             #
             # Model, Value1, Value2, Value3, Arch, ModuleType, BelongsToItem=-1, BelongsToFile=-1,
-- 
2.19.1.windows.1



             reply	other threads:[~2019-01-02  8:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-02  8:44 BobCF [this message]
2019-01-11  0:59 ` [Patch] BaseTools: Report Error if use SET in Dsc Gao, Liming

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190102084401.1264-1-bob.c.feng@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox