public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Gao, Liming" <liming.gao@intel.com>
To: "Zhu, Yonghong" <yonghong.zhu@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Subject: Re: [Patch] BaseTools: Fix a bug Build directory should relative to WORKSPACE
Date: Mon, 16 Oct 2017 07:21:07 +0000	[thread overview]
Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E16B879@SHSMSX104.ccr.corp.intel.com> (raw)
In-Reply-To: <1507883512-19936-1-git-send-email-yonghong.zhu@intel.com>

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

>-----Original Message-----
>From: Zhu, Yonghong
>Sent: Friday, October 13, 2017 4:32 PM
>To: edk2-devel@lists.01.org
>Cc: Gao, Liming <liming.gao@intel.com>
>Subject: [Patch] BaseTools: Fix a bug Build directory should relative to
>WORKSPACE
>
>The bug is for build output files it still use mws.join function, it
>cause maybe we will get the build output files in the PACKAGES_PATH
>because mws.join will try WORKSPACE first, if the file doesn't exist
>then try PACKAGES_PATH. But for build output, we expected it should
>relative to WORKSPACE.
>
>Cc: Liming Gao <liming.gao@intel.com>
>Contributed-under: TianoCore Contribution Agreement 1.1
>Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
>---
> BaseTools/Source/Python/AutoGen/AutoGen.py   | 1 +
> BaseTools/Source/Python/Common/GlobalData.py | 1 +
> BaseTools/Source/Python/Common/String.py     | 2 +-
> 3 files changed, 3 insertions(+), 1 deletion(-)
>
>diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py
>b/BaseTools/Source/Python/AutoGen/AutoGen.py
>index f2196fd..2fcd471 100644
>--- a/BaseTools/Source/Python/AutoGen/AutoGen.py
>+++ b/BaseTools/Source/Python/AutoGen/AutoGen.py
>@@ -1796,10 +1796,11 @@ class PlatformAutoGen(AutoGen):
>                 self._BuildDir = path.join(
>                                             self.WorkspaceDir,
>                                             self.OutputDir,
>                                             self.BuildTarget + "_" + self.ToolChain,
>                                             )
>+            GlobalData.gBuildDirectory = self._BuildDir
>         return self._BuildDir
>
>     ## Return directory of platform makefile
>     #
>     #   @retval     string  Makefile directory
>diff --git a/BaseTools/Source/Python/Common/GlobalData.py
>b/BaseTools/Source/Python/Common/GlobalData.py
>index 45e7ea0..e348e9a 100644
>--- a/BaseTools/Source/Python/Common/GlobalData.py
>+++ b/BaseTools/Source/Python/Common/GlobalData.py
>@@ -54,10 +54,11 @@ gAutoGenPhase = False
> #
> # The Conf dir outside the workspace dir
> #
> gConfDirectory = ''
>
>+gBuildDirectory = ''
> #
> # The relative default database file path
> #
> gDatabasePath = ".cache/build.db"
>
>diff --git a/BaseTools/Source/Python/Common/String.py
>b/BaseTools/Source/Python/Common/String.py
>index 81c053d..4a8c03e 100644
>--- a/BaseTools/Source/Python/Common/String.py
>+++ b/BaseTools/Source/Python/Common/String.py
>@@ -309,11 +309,11 @@ def NormPath(Path, Defines={}):
>             Path = ReplaceMacro(Path, Defines)
>         #
>         # To local path format
>         #
>         Path = os.path.normpath(Path)
>-        if Path.startswith(GlobalData.gWorkspace) and not os.path.exists(Path):
>+        if Path.startswith(GlobalData.gWorkspace) and not
>Path.startswith(GlobalData.gBuildDirectory) and not os.path.exists(Path):
>             Path = Path[len (GlobalData.gWorkspace):]
>             if Path[0] == os.path.sep:
>                 Path = Path[1:]
>             Path = mws.join(GlobalData.gWorkspace, Path)
>
>--
>2.6.1.windows.1



      reply	other threads:[~2017-10-16  7:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-13  8:31 [Patch] BaseTools: Fix a bug Build directory should relative to WORKSPACE Yonghong Zhu
2017-10-16  7:21 ` Gao, Liming [this message]

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=4A89E2EF3DFEDB4C8BFDE51014F606A14E16B879@SHSMSX104.ccr.corp.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