From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.120; helo=mga04.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (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 A49FD202E6152 for ; Mon, 16 Oct 2017 00:17:36 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Oct 2017 00:21:10 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,371,1503385200"; d="scan'208";a="598876" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga001.jf.intel.com with ESMTP; 16 Oct 2017 00:21:10 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 16 Oct 2017 00:21:10 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.152]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.213]) with mapi id 14.03.0319.002; Mon, 16 Oct 2017 15:21:08 +0800 From: "Gao, Liming" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" Thread-Topic: [Patch] BaseTools: Fix a bug Build directory should relative to WORKSPACE Thread-Index: AQHTQ/28sRyEQ6Ms30+LFkgH4ie2yaLmFqGQ Date: Mon, 16 Oct 2017 07:21:07 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E16B879@SHSMSX104.ccr.corp.intel.com> References: <1507883512-19936-1-git-send-email-yonghong.zhu@intel.com> In-Reply-To: <1507883512-19936-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: Fix a bug Build directory should relative to WORKSPACE X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 16 Oct 2017 07:17:36 -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: Friday, October 13, 2017 4:32 PM >To: edk2-devel@lists.01.org >Cc: Gao, Liming >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 >Contributed-under: TianoCore Contribution Agreement 1.1 >Signed-off-by: Yonghong Zhu >--- > 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 =3D path.join( > self.WorkspaceDir, > self.OutputDir, > self.BuildTarget + "_" + self= .ToolChain, > ) >+ GlobalData.gBuildDirectory =3D 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 =3D False > # > # The Conf dir outside the workspace dir > # > gConfDirectory =3D '' > >+gBuildDirectory =3D '' > # > # The relative default database file path > # > gDatabasePath =3D ".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=3D{}): > Path =3D ReplaceMacro(Path, Defines) > # > # To local path format > # > Path =3D 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 =3D Path[len (GlobalData.gWorkspace):] > if Path[0] =3D=3D os.path.sep: > Path =3D Path[1:] > Path =3D mws.join(GlobalData.gWorkspace, Path) > >-- >2.6.1.windows.1