public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Fan, ZhijuX" <zhijux.fan@intel.com>
To: devel@edk2.groups.io
Cc: "Zhiju . Fan" <zhijux.fan@intel.com>,
	Liming Gao <liming.gao@intel.com>,
	Bob Feng <bob.c.feng@intel.com>
Subject: [PATCH V2] BaseTools:GuidedSectionTools.txt is not generated correctly
Date: Fri,  6 Mar 2020 13:31:26 +0800	[thread overview]
Message-ID: <20200306053126.21376-1-zhijux.fan@intel.com> (raw)

REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2538

For LzmaCompress or BrotliCompress, the platform may use the different
options and add their batch file, such as LzmaCompressPlatform.
Then, specify it in platform.dsc [BuildOptions] to override the default
one in tools_def.txt.

*_*_*_LZMA_PATH = LzmaCompressPlatform

This override tool will be used. But, its name is not specified in the
generated GuidedSectionTools.txt.

Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
---
Changed an issue with an incorrect full path in GuidedSectionTools

 BaseTools/Source/Python/AutoGen/PlatformAutoGen.py | 4 +++-
 BaseTools/Source/Python/build/build.py             | 3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py
index d32178b00c93..478a5116fd7a 100644
--- a/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py
+++ b/BaseTools/Source/Python/AutoGen/PlatformAutoGen.py
@@ -866,7 +866,9 @@ class PlatformAutoGen(AutoGen):
                             Value += " " + self._BuildOptionWithToolDef(RetVal)[Tool][Attr]
                         else:
                             Value = self._BuildOptionWithToolDef(RetVal)[Tool][Attr]
-
+                            Def = '_'.join([self.BuildTarget, self.ToolChain, self.Arch, Tool, Attr])
+                            if self.Workspace.ToolDef.ToolsDefTxtDictionary.get(Def):
+                                self.Workspace.ToolDef.ToolsDefTxtDictionary[Def] = Value
                 if Attr == "PATH":
                     # Don't put MAKE definition in the file
                     if Tool != "MAKE":
diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py
index d841fefdc502..01c4c6fe2b84 100755
--- a/BaseTools/Source/Python/build/build.py
+++ b/BaseTools/Source/Python/build/build.py
@@ -2367,7 +2367,8 @@ class Build():
             # PATH environment variable.
             for dirInPath in os.environ['PATH'].split(os.pathsep):
                 foundPath = os.path.join(dirInPath, tool)
-                if os.path.exists(foundPath):
+                BaseName, Ext = os.path.splitext(foundPath)
+                if os.path.isdir(foundPath) or Ext:
                     return os.path.realpath(foundPath)
 
         # If the tool was not found in the path then we just return
-- 
2.14.1.windows.1


             reply	other threads:[~2020-03-06  5:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-06  5:31 Fan, ZhijuX [this message]
2020-03-09  5:54 ` [PATCH V2] BaseTools:GuidedSectionTools.txt is not generated correctly Bob Feng
2020-03-11  1:36   ` Liming Gao

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=20200306053126.21376-1-zhijux.fan@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