From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web08.10720.1633705912855065747 for ; Fri, 08 Oct 2021 08:11:53 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=byIizgvN; spf=pass (domain: intel.com, ip: 192.55.52.151, mailfrom: bob.c.feng@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10130"; a="207334500" X-IronPort-AV: E=Sophos;i="5.85,358,1624345200"; d="scan'208";a="207334500" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Oct 2021 08:11:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,358,1624345200"; d="scan'208";a="479006868" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga007.jf.intel.com with ESMTP; 08 Oct 2021 08:11:51 -0700 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Fri, 8 Oct 2021 08:11:51 -0700 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Fri, 8 Oct 2021 08:11:51 -0700 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.173) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Fri, 8 Oct 2021 08:11:50 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X0zIUzhCnbXRrO3+PjpF5MzotI0046HPbViDNR129Hs0ocYuGrtzhs1d9sxklP+6yapk2NLaC35S7usrhHwTLzWjWQacI+6ZeiGlQLXFJUdj+XnpKFHyrv9K8/zfepeyECwmGw4+mJzXcW7fVwbUzu5jp7Scyk+fGnWg+eSqBmBQhKEZnvFGJjQzSIE9qJUJKtpppwG4t/mhx10IbI1jD5nsaQANHY7J/+ixpCf9GJC3LPAbKWUMkgL63hiKuxpWJimSQ5guMX64WJRQsuOlughvBD7vMz0o9aAqE6mUxw81+3ghzEU4FGjMDF+470YGwuLARsXeNsJuXkDUqY+c6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=EIONOUFog/pB2kJxB3WMGXmZgcVyNaZeIFwwXRxDsYw=; b=nqIJIhZXuCE5lvbqX5f/QbFSjkpUmmKZ7u3HyxLwrcgAr6HWpy+UQ8p7eswpUFFf6dwm3HEMrJpbP2STcLlYdPzxJAcPZqXBjIUug0ckTB0hhAQr8VD1c/TGdEBPeg/g1MGLlLRfBFWRZnAo2W54BS/N7vBHUAaxK8OLBtwPSdfT755v3T3HjPdTIPKsP7NdsGRcnvdRuSjJHtfLHqs6E/YDTPKz8TMnrzHCzlO6MtfDbjOIl93TGsHmE846RqSdKX8pJYXsftPHHNd/c664BkOEWiqgVvMDtThk6+HokpTz0JnQ9WdrDZHbmQ0N7xpfa0OtXZA7tAxZ1hFCyiqHDQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EIONOUFog/pB2kJxB3WMGXmZgcVyNaZeIFwwXRxDsYw=; b=byIizgvNHNinjDE16QegtB60rKQMtlX2n4R1dNtQAErpS5+cjOf5so0G34Z4T9AjRM9pO/qrFV6vupZpj/1km6CXFMu/TqGDL0bG+VkRV3vhY+tl6nKCBArPXB6AfAwNK+XCWsGYAh79XWWyRDfFUD0fKlp2RgpGnuuP2qQtYtE= Received: from MN2PR11MB4079.namprd11.prod.outlook.com (2603:10b6:208:153::33) by BL1PR11MB5495.namprd11.prod.outlook.com (2603:10b6:208:317::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.18; Fri, 8 Oct 2021 15:11:49 +0000 Received: from MN2PR11MB4079.namprd11.prod.outlook.com ([fe80::88b2:45c0:4f55:5b7f]) by MN2PR11MB4079.namprd11.prod.outlook.com ([fe80::88b2:45c0:4f55:5b7f%3]) with mapi id 15.20.4587.022; Fri, 8 Oct 2021 15:11:49 +0000 From: "Bob Feng" To: "Chen, Christine" , "devel@edk2.groups.io" CC: Liming Gao Subject: Re: [Patch V2 1/1] BaseTools: Change RealPath to AbsPath Thread-Topic: [Patch V2 1/1] BaseTools: Change RealPath to AbsPath Thread-Index: AQHXtQ4d1CI0qdezYUSUjxCbDYqz9qvJQypw Date: Fri, 8 Oct 2021 15:11:49 +0000 Message-ID: References: <20210929084339.201-1-yuwei.chen@intel.com> In-Reply-To: <20210929084339.201-1-yuwei.chen@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.200.16 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 9761341a-88e7-4d72-41da-08d98a6df3e2 x-ms-traffictypediagnostic: BL1PR11MB5495: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: jWL/ctcdsofoX10BwpNC/Ss4a5TLFWuAoPNbU/g35RSxM0QBtGQksKtG37WSEECXcIzsILPRTlV0xdmiqe48+krplOvoqxWvkkjEC2HquIziIbPeHUriaPMq83nw6cVaonFkWaUBMURyHiOZxZ2Yw4kmhEIq+aadka77LedwMqQnOSjbR9ghtcgk+7OP+3tNR5U3LXyeehj/PWDu8FF7TWRwHMs6V9tSC8NQAO8PoQk2NKxyGA+it/A8K4MtqqzMN7BzvjoXSQDmDCkZjBlwVJz6ffElzMOcnOwyIgDcvkuj+0t1mrvo8lsiCGkg9q2ePslDMH8ntdEuKDuIaaS+eaddDFhqLbj82l80AwUioE2oySAYxgA0GkB3y4Rv1m6BtDxccMQrfdUg0axEG3cDaK4HLXp3/Rvo8p9lX6QAETsSr0b+9Pec1jeJ0GdyYnpiBMHH0D511/jqQeqFPzJJigvOmLvhXmzvnh/XP3Blhjz0AIRiA4Jan8dVpwr6WL1et+hWT4Ys+/6hS3kuYSPHbdQTrDX4qbnlEvHu4uDHlhzM68Dgn8Z6X2t1W7FSOaX3mPRRSIHzLjHzmB+1AKelq4lim9EakI5YWFmGjwV8ZqKY/hDPaHETv2QXLlCLOkVQKkFk9LiftVqHDyqTTVsOa5wLu7QoErBEQwaNtYR7MtoEh8/99M9M//XyB5ObJmreg/q24Urpa0afZvcVXpu8KA== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR11MB4079.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(186003)(2906002)(66476007)(508600001)(7696005)(316002)(33656002)(38070700005)(110136005)(5660300002)(86362001)(71200400001)(122000001)(55016002)(66446008)(52536014)(8676002)(9686003)(66556008)(64756008)(66946007)(8936002)(6506007)(53546011)(76116006)(26005)(83380400001)(4326008)(38100700002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?r9mNNt2CHHSrduOz9ym57xE/bckTq82xAXgE5jLn7NI4HOFZ/tMhl93Je2bn?= =?us-ascii?Q?yp98cHoML+oM80BSE6Zh4imBPReGK5Q1PeXOyTsqUxo0qP2sGcUKOi7NQAlH?= =?us-ascii?Q?GbhWuzdPqCcVKuZS67e9tAvpq2iZxGwZqsd5vNEdDJl2dfUGbrfSQT2A1f00?= =?us-ascii?Q?U+kFh6N6VKv/u/s5OoBYPjgTW+Iq36DcaG2o5bp9l7qOb5IQv943UGtVDSv8?= =?us-ascii?Q?Yn2+WmSHRjHiSoutTq2A7fvPU2BBgrl77cuiXVdkIcrNzN9Lqw5EeFVl0L40?= =?us-ascii?Q?ND8/o+g92QXwanTF4O3ce5mFqPe6IU9Zr8g7QRTXfQ7gabtWCouO3HbmljDl?= =?us-ascii?Q?y52NE6kTS4SyYqLCw/+furuXzV+Zx8lhz/6fQBdznDJq01sURHv9aWbflzQv?= =?us-ascii?Q?wdiAy4sk+iIG8pMnhyCrKU8ZQG1qxZsQMKAu3bC13pmlkF5h5q2p3Y+hjl6N?= =?us-ascii?Q?jqAdb7ma2bgzKNiJus6dwwhEqNT59N4VUqHbsGeG79gBu0zbSIHJdlezJIcg?= =?us-ascii?Q?Q5D29WNlmrUdoODAL7OpW8gza7hj7+2tDljGsZvzOvz+oOzllsyW8qOlEmz2?= =?us-ascii?Q?I/DXec1/6BamDVSu8qTo74DR/ZJoacG6i+rQ7Q59uZH1npDd+V0pD4zDqNan?= =?us-ascii?Q?8tAqLwncOOFufc2zCtwHSPN46Zkt2ycu2msGXbWzIZlm1HTnoHzET6ItOeZL?= =?us-ascii?Q?r70Ux4LinX6mpowSe6UfvUtXgULtoW/mjAUdZyODl5gDNApgK9apgqNlwuPY?= =?us-ascii?Q?0zbHtVF7IBOrG81LDDl4N0IVPKBU1QCNEwlDBGOJhzhVmaA3rDyHRn6zTFWX?= =?us-ascii?Q?J2ss8vESIkqQQySTmgHCwRD3q2PWMYyvO1l4qxZ//P1horXX5R2tiM7qYjrC?= =?us-ascii?Q?yP121Pe1uW61gjBuHlWD0i1cw1zdvV/PKckZ9Xf6XMJyzewSWJUjauP5hNDz?= =?us-ascii?Q?pkCzcaPOGD3L5lUHvqG2b+oIOLKQu91h5uD1I4mqYNHoFfTJTf/ff8dxMGgY?= =?us-ascii?Q?6VWNkYPXGoyn3zy7agjyshFUPaGGJk8R3W1W/CRant54Uk8KrjgWXrQEOmGc?= =?us-ascii?Q?YRPATMD5UvxQ4e8iev9Lm7VuMyf1SXkEr97oZKbPPMF2jdLnohihnZczp3dd?= =?us-ascii?Q?vUO3sy3xvmeLcxQ4plpxRjqHq6VbK2B+Rdh8zHEUdUZcs9W4fmrZvxGWQ0ry?= =?us-ascii?Q?K6KV069V48jIsqIGFTuz9D18fFeYQYLM04zemHXkjbpvAGsUh32fETEySafh?= =?us-ascii?Q?7DX1ohmUQ8L40yGcTQBhTMY7qirLl4EjFG1/nQCA5o0WGKEBqBItvIpH5rMb?= =?us-ascii?Q?CmBfGApNVLmy+8zwq13QnSDj?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR11MB4079.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9761341a-88e7-4d72-41da-08d98a6df3e2 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Oct 2021 15:11:49.5716 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: VZH0hObm1i9XfoOQtABhPfvnSBE9I3vJNeJ9mWWpkWoN/w+BYdpaY04ZH2llEqjBR9HsWmnKwdDtdgvtRNtsIg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR11MB5495 Return-Path: bob.c.feng@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Christine, For the case that a directory is a symbol link, we should use os.path.realp= ath. if os.path.islink(Dirname): - Dirname =3D os.path.realpath(Dirname) + Dirname =3D os.path.abspath(Dirname) Thanks, Bob -----Original Message----- From: Chen, Christine =20 Sent: Wednesday, September 29, 2021 4:44 PM To: devel@edk2.groups.io Cc: Feng, Bob C ; Liming Gao Subject: [Patch V2 1/1] BaseTools: Change RealPath to AbsPath Currently the realpath is used when parse modules, which shows the path wit= h a drive letter in build log. In Windows 'subst' comand is used to associa= tes 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 s= how the path info, it will keep same letter with the mapped drive letter, w= hich avoids confusion. This patch modifies the realpath to abspath. Cc: Bob Feng Cc: Liming Gao Signed-off-by: Yuwei Chen --- .gitignore | 1 + BaseTools/Source/Python/Ecc/Check.py | 2 +- BaseTools/Source/Python/Ecc/EccMain.py | 4 ++-- BaseTools/Source/Python/Ecc/c.py | 2 +- BaseTools/Source/Python/GenFds/FfsInfStatement.py | 4 ++-- BaseTools/Source/Python/GenFds/GenFds.py | 6 +++--- 6 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 1dd30c141066..41471df06ba8 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ Build/ __pycache__/ tags/ .vscode/ +/bin/ diff --git a/BaseTools/Source/Python/Ecc/Check.py b/BaseTools/Source/Python= /Ecc/Check.py index 33060db5f27a..ba04e6e0619d 100644 --- a/BaseTools/Source/Python/Ecc/Check.py +++ b/BaseTools/Source/Python/Ecc/Check.py @@ -332,7 +332,7 @@ class Check(object): for Dir in Dirnames: Dirname =3D os.path.join(Dirpath, Dir) if os.path.islink(Dirname): - Dirname =3D os.path.realpath(Dirname) + Dirname =3D os.path.abspath(Dirname) if os.path.isdir(Dirname): # symlinks to directories are treated as directori= es Dirnames.remove(Dir) diff --git a/BaseTools/Source= /Python/Ecc/EccMain.py b/BaseTools/Source/Python/Ecc/EccMain.py index 72edbea3b883..e7d44f57f1b4 100644 --- a/BaseTools/Source/Python/Ecc/EccMain.py +++ b/BaseTools/Source/Python/Ecc/EccMain.py @@ -105,7 +105,7 @@ class Ecc(object): =20 def InitDefaultConfigIni(self): paths =3D map(lambda p: os.path.join(p, 'Ecc', 'config.ini'), sys.= path) - paths =3D (os.path.realpath('config.ini'),) + tuple(paths) + paths =3D (os.path.abspath('config.ini'),) + tuple(paths) for path in paths: if os.path.exists(path): self.ConfigFile =3D path @@ -183,7 +183,7 @@ class Ecc(object): for Dir in Dirs: Dirname =3D os.path.join(Root, Dir) if os.path.islink(Dirname): - Dirname =3D os.path.realpath(Dirname) + Dirname =3D os.path.abspath(Dirname) if os.path.isdir(Dirname): # symlinks to directories are treated as direc= tories Dirs.remove(Dir) diff --git a/BaseTools/Source= /Python/Ecc/c.py b/BaseTools/Source/Python/Ecc/c.py index 4a82e5e76003..313d6b088c12 100644 --- a/BaseTools/Source/Python/Ecc/c.py +++ b/BaseTools/Source/Python/Ecc/c.py @@ -508,7 +508,7 @@ def CollectSourceCodeDataIntoDB(RootDir): for Dir in dirnames: Dirname =3D os.path.join(dirpath, Dir) if os.path.islink(Dirname): - Dirname =3D os.path.realpath(Dirname) + Dirname =3D os.path.abspath(Dirname) if os.path.isdir(Dirname): # symlinks to directories are treated as directories dirnames.remove(Dir) diff --git a/BaseTools/Source/Pyt= hon/GenFds/FfsInfStatement.py b/BaseTools/Source/Python/GenFds/FfsInfStatem= ent.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 =3D os.path.realpath(OutputPath) - DebugPath =3D os.path.realpath(DebugPath) + OutputPath =3D os.path.abspath(OutputPath) + DebugPath =3D os.path.abspath(DebugPath) return OutputPath, DebugPath =20 ## __GenSimpleFileSection__() method diff --git a/BaseTools/Source/Pyt= hon/GenFds/GenFds.py b/BaseTools/Source/Python/GenFds/GenFds.py index ae3e776a5540..7f266e163c73 100644 --- a/BaseTools/Source/Python/GenFds/GenFds.py +++ b/BaseTools/Source/Python/GenFds/GenFds.py @@ -153,7 +153,7 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=3DNone)= : FdfFilename =3D GenFdsGlobalVariable.ReplaceWorkspaceMacro(Fdf= Filename) =20 if FdfFilename[0:2] =3D=3D '..': - FdfFilename =3D os.path.realpath(FdfFilename) + FdfFilename =3D os.path.abspath(FdfFilename) if not os.path.isabs(FdfFilename): FdfFilename =3D mws.join(GenFdsGlobalVariable.WorkSpaceDir= , FdfFilename) if not os.path.exists(FdfFilename): @@ -175,7 +175,7 @@ def GenFdsApi(FdsCommandDict, WorkSpaceDataBase=3DNone)= : ActivePlatform =3D GenFdsGlobalVariable.ReplaceWorkspaceMacro(= ActivePlatform) =20 if ActivePlatform[0:2] =3D=3D '..': - ActivePlatform =3D os.path.realpath(ActivePlatform) + ActivePlatform =3D os.path.abspath(ActivePlatform) =20 if not os.path.isabs (ActivePlatform): ActivePlatform =3D mws.join(GenFdsGlobalVariable.WorkSpace= Dir, ActivePlatform) @@ -299,7 +299,7 @@ def GenFdsApi(FdsCommandDict, Work= SpaceDataBase=3DNone): for Key in GenFdsGlobalVariable.OutputDirDict: OutputDir =3D GenFdsGlobalVariable.OutputDirDict[Key] if OutputDir[0:2] =3D=3D '..': - OutputDir =3D os.path.realpath(OutputDir) + OutputDir =3D os.path.abspath(OutputDir) =20 if OutputDir[1] !=3D ':': OutputDir =3D os.path.join (GenFdsGlobalVariable.WorkSpace= Dir, OutputDir) -- 2.26.1.windows.1