From nobody Wed Dec 25 12:52:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 15078835189891000.2889944404621; Fri, 13 Oct 2017 01:31:58 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 495F021F7D4F0; Fri, 13 Oct 2017 01:28:26 -0700 (PDT) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (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 26A9121F38842 for ; Fri, 13 Oct 2017 01:28:25 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Oct 2017 01:31:56 -0700 Received: from shwdeopenpsi168.ccr.corp.intel.com ([10.239.158.121]) by orsmga001.jf.intel.com with ESMTP; 13 Oct 2017 01:31:55 -0700 X-Original-To: edk2-devel@lists.01.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.65; helo=mga03.intel.com; envelope-from=yonghong.zhu@intel.com; receiver=edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,370,1503385200"; d="scan'208";a="1181545914" From: Yonghong Zhu To: edk2-devel@lists.01.org Date: Fri, 13 Oct 2017 16:31:52 +0800 Message-Id: <1507883512-19936-1-git-send-email-yonghong.zhu@intel.com> X-Mailer: git-send-email 2.6.1.windows.1 Subject: [edk2] [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: , Cc: Liming Gao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Liming Gao --- 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 =20 ## Return directory of platform makefile # # @retval string Makefile directory diff --git a/BaseTools/Source/Python/Common/GlobalData.py b/BaseTools/Sourc= e/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 '' =20 +gBuildDirectory =3D '' # # The relative default database file path # gDatabasePath =3D ".cache/build.db" =20 diff --git a/BaseTools/Source/Python/Common/String.py b/BaseTools/Source/Py= thon/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(P= ath): + 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) =20 --=20 2.6.1.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel