From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web11.9047.1634011662045740086 for ; Mon, 11 Oct 2021 21:07:42 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: yuwei.chen@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10134"; a="224454098" X-IronPort-AV: E=Sophos;i="5.85,366,1624345200"; d="scan'208";a="224454098" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2021 21:07:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,366,1624345200"; d="scan'208";a="490764440" Received: from yuweipc.ccr.corp.intel.com ([10.239.158.34]) by orsmga008.jf.intel.com with ESMTP; 11 Oct 2021 21:07:39 -0700 From: "Yuwei Chen" To: devel@edk2.groups.io Cc: Bob Feng , Liming Gao Subject: [Patch V4 1/1] BaseTools: Change RealPath to AbsPath Date: Tue, 12 Oct 2021 12:07:38 +0800 Message-Id: <20211012040738.1656-1-yuwei.chen@intel.com> X-Mailer: git-send-email 2.27.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Currently the realpath is used when parse modules, which shows the path with a drive letter in build log. In Windows 'subst' comand is used to associates a path with a drive letter, when use the mapped drive letter for build, with realpath function the build log will have different disk letter info which will cause confusion. In this situation, if use adspath function to show the path info, it will keep same letter with the mapped drive letter, which avoids confusion. This patch modifies the realpath to abspath. Cc: Bob Feng Cc: Liming Gao Signed-off-by: Yuwei Chen --- BaseTools/Source/Python/Ecc/EccMain.py | 2 +- BaseTools/Source/Python/GenFds/FfsInfStatement.py | 4 ++-- BaseTools/Source/Python/GenFds/GenFds.py | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/BaseTools/Source/Python/Ecc/EccMain.py b/BaseTools/Source/Python/Ecc/EccMain.py index 72edbea3b883..a349cd80147f 100644 --- a/BaseTools/Source/Python/Ecc/EccMain.py +++ b/BaseTools/Source/Python/Ecc/EccMain.py @@ -105,7 +105,7 @@ class Ecc(object): def InitDefaultConfigIni(self): paths = map(lambda p: os.path.join(p, 'Ecc', 'config.ini'), sys.path) - paths = (os.path.realpath('config.ini'),) + tuple(paths) + paths = (os.path.abspath('config.ini'),) + tuple(paths) for path in paths: if os.path.exists(path): self.ConfigFile = path diff --git a/BaseTools/Source/Python/GenFds/FfsInfStatement.py b/BaseTools/Source/Python/GenFds/FfsInfStatement.py index 20573ca28d2f..568efb6d7685 100644 --- a/BaseTools/Source/Python/GenFds/FfsInfStatement.py +++ b/BaseTools/Source/Python/GenFds/FfsInfStatement.py @@ -707,8 +707,8 @@ class FfsInfStatement(FfsInfStatementClassObject): FileName, 'DEBUG' ) - OutputPath = os.path.realpath(OutputPath) - DebugPath = os.path.realpath(DebugPath) + OutputPath = os.path.abspath(OutputPath) + DebugPath = os.path.abspath(DebugPath) return OutputPath, DebugPath ## __GenSimpleFileSection__() method diff --git a/BaseTools/Source/Python/GenFds/GenFds.py b/BaseTools/Source/Python/GenFds/GenFds.py index c34104500059..17b71b7cd347 100644 --- a/BaseTools/Source/Python/GenFds/GenFds.py +++ b/BaseTools/Source/Python/GenFds/GenFds.py @@ -153,7 +153,7 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=None): FdfFilename = GenFdsGlobalVariable.ReplaceWorkspaceMacro(FdfFilename) if FdfFilename[0:2] == '..': - FdfFilename = os.path.realpath(FdfFilename) + FdfFilename = os.path.abspath(FdfFilename) if not os.path.isabs(FdfFilename): FdfFilename = mws.join(GenFdsGlobalVariable.WorkSpaceDir, FdfFilename) if not os.path.exists(FdfFilename): @@ -175,7 +175,7 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=None): ActivePlatform = GenFdsGlobalVariable.ReplaceWorkspaceMacro(ActivePlatform) if ActivePlatform[0:2] == '..': - ActivePlatform = os.path.realpath(ActivePlatform) + ActivePlatform = os.path.abspath(ActivePlatform) if not os.path.isabs (ActivePlatform): ActivePlatform = mws.join(GenFdsGlobalVariable.WorkSpaceDir, ActivePlatform) @@ -299,7 +299,7 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=None): for Key in GenFdsGlobalVariable.OutputDirDict: OutputDir = GenFdsGlobalVariable.OutputDirDict[Key] if OutputDir[0:2] == '..': - OutputDir = os.path.realpath(OutputDir) + OutputDir = os.path.abspath(OutputDir) if OutputDir[1] != ':': OutputDir = os.path.join (GenFdsGlobalVariable.WorkSpaceDir, OutputDir) -- 2.27.0.windows.1