From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from ma1-aaemail-dr-lapp03.apple.com (ma1-aaemail-dr-lapp03.apple.com [17.171.2.72]) by mx.groups.io with SMTP id smtpd.web11.16823.1600875107086012308 for ; Wed, 23 Sep 2020 08:31:47 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@apple.com header.s=20180706 header.b=pr0KmYwF; spf=pass (domain: apple.com, ip: 17.171.2.72, mailfrom: afish@apple.com) Received: from pps.filterd (ma1-aaemail-dr-lapp03.apple.com [127.0.0.1]) by ma1-aaemail-dr-lapp03.apple.com (8.16.0.42/8.16.0.42) with SMTP id 08NFRbbB029134; Wed, 23 Sep 2020 08:31:26 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apple.com; h=from : message-id : content-type : mime-version : subject : date : in-reply-to : cc : to : references; s=20180706; bh=j+E83La3jNlZfHQtDMUwMCdZXaG5P7R2dSXfgEqWbZk=; b=pr0KmYwFoBxGB7Ov7p76stTDVlJxF4f4OswURS5fk92jbtELKCFe5ZlcFMajKf9IB7pA S83kBYH995csUhNQntmTb6ZGhXsquDd/ybM1dVNpb5qvLTPJey6qLlHGkhualhTWbWwk KYUfIKiMzfvMGD1SgtRVhop+oxEs8+QN2S8UoaQk2I5+wsIe1tcSI43qpQSjKq9vVi/e AjLbbMVaWlzR76wJXj4lpuewiyPWY3Wy4X6wpdSybjgm1QbX0XWVm/2wtUhmdGFXkcPi ep7gHrgfiCzikZfw3Dv5LgYRurNwDwFCswY7Kt5TlCPGpSzBym6yJu6k7xbC4KOLdxzx nw== Received: from rn-mailsvcp-mta-lapp02.rno.apple.com (rn-mailsvcp-mta-lapp02.rno.apple.com [10.225.203.150]) by ma1-aaemail-dr-lapp03.apple.com with ESMTP id 33ngyuv0tq-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NO); Wed, 23 Sep 2020 08:31:26 -0700 Received: from rn-mailsvcp-mmp-lapp01.rno.apple.com (rn-mailsvcp-mmp-lapp01.rno.apple.com [17.179.253.14]) by rn-mailsvcp-mta-lapp02.rno.apple.com (Oracle Communications Messaging Server 8.1.0.6.20200729 64bit (built Jul 29 2020)) with ESMTPS id <0QH4001SCB4CL600@rn-mailsvcp-mta-lapp02.rno.apple.com>; Wed, 23 Sep 2020 08:31:25 -0700 (PDT) Received: from process_milters-daemon.rn-mailsvcp-mmp-lapp01.rno.apple.com by rn-mailsvcp-mmp-lapp01.rno.apple.com (Oracle Communications Messaging Server 8.1.0.6.20200729 64bit (built Jul 29 2020)) id <0QH400100AZMNE00@rn-mailsvcp-mmp-lapp01.rno.apple.com>; Wed, 23 Sep 2020 08:31:24 -0700 (PDT) X-Va-A: X-Va-T-CD: a84d0a6266a8666c0cdfbbd3f96850e2 X-Va-E-CD: a3314b41e4eff180ee821234a1cdfe7c X-Va-R-CD: 05d879b13dac3a14d89238bdef03bbec X-Va-CD: 0 X-Va-ID: b9e91946-8340-4dd5-8d5b-79e45307bd3e X-V-A: X-V-T-CD: a84d0a6266a8666c0cdfbbd3f96850e2 X-V-E-CD: a3314b41e4eff180ee821234a1cdfe7c X-V-R-CD: 05d879b13dac3a14d89238bdef03bbec X-V-CD: 0 X-V-ID: 1c5a52a6-1c5e-41c0-91c5-ef403fd00503 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-09-23_10:2020-09-23,2020-09-23 signatures=0 Received: from [17.235.35.45] (unknown [17.235.35.45]) by rn-mailsvcp-mmp-lapp01.rno.apple.com (Oracle Communications Messaging Server 8.1.0.6.20200729 64bit (built Jul 29 2020)) with ESMTPSA id <0QH400826B4ADR00@rn-mailsvcp-mmp-lapp01.rno.apple.com>; Wed, 23 Sep 2020 08:31:23 -0700 (PDT) From: "Andrew Fish" Message-id: MIME-version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: [edk2-devel] [PATCH] BaseTools: Normalize case of pathname when evaluating Macros. Date: Wed, 23 Sep 2020 08:31:22 -0700 In-reply-to: Cc: "Liang, MingyueX" , Liming Gao , "Chen, Christine" To: edk2-devel-groups-io , bob.c.feng@intel.com References: <20200923105732.34648-1-bob.c.feng@intel.com> X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-09-23_12:2020-09-23,2020-09-23 signatures=0 Content-type: multipart/alternative; boundary="Apple-Mail=_7E357A16-9442-4BAD-91A5-D9AD5DADD8A3" --Apple-Mail=_7E357A16-9442-4BAD-91A5-D9AD5DADD8A3 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Bob, Sorry I was confused by the commit comment `inconsistent path case`. So th= is was only a bug on case insensitive file systems?=20 I=E2=80=99m paranoid as macOS support case and case insensitive file syste= ms and we have had a lot of strange bugs in the past.=20 Thanks, Andrew Fish > On Sep 23, 2020, at 7:59 AM, Bob Feng wrote: >=20 > Yes. we did test on Windows and Linux. >=20 > From the https://docs.python.org/3/library/os.path.html > os.path.normcase(path) > Normalize the case of a pathname. On Windows, convert all characters = in the pathname to lowercase, and also convert forward slashes to backward= slashes. On other operating systems, return the path unchanged. >=20 > Thanks, > Bob > -----Original Message----- > From: Andrew Fish >=20 > Sent: Wednesday, September 23, 2020 10:24 PM > To: devel@edk2.groups.io ; Feng, Bob C > > Cc: Liang, MingyueX >; Liming Gao >; Chen, Christine = > > Subject: Re: [edk2-devel] [PATCH] BaseTools: Normalize case of pathname = when evaluating Macros. >=20 > Does this work on case sensitive file systems? >> On Sep 23, 2020, at 3:58 AM, Bob Feng > wrote: >>=20 >> =EF=BB=BFFrom: Mingyue Liang > >>=20 >> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2880 >>=20 >> Currently, When doing the Incremental build, the directory macros=20 >> extended to absolute path in output Makefile, which is inconsistent=20 >> with the output of Clean build. >>=20 >> When we do macro replacement, we can't replace macro due to=20 >> inconsistent path case, which results in inconsistent display of=20 >> incremental build and clean build in makefile.Therefore, the path is=20 >> converted to achieve the correct macro replacement. >>=20 >> Signed-off-by: Mingyue Liang > >> Cc: Bob Feng > >> Cc: Liming Gao > >> Cc: Yuwei Chen > >> --- >> BaseTools/Source/Python/AutoGen/GenMake.py | 6 ++++-- >> 1 file changed, 4 insertions(+), 2 deletions(-) >>=20 >> diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py=20 >> b/BaseTools/Source/Python/AutoGen/GenMake.py >> index 0314d0ea34..b04d3f5436 100755 >> --- a/BaseTools/Source/Python/AutoGen/GenMake.py >> +++ b/BaseTools/Source/Python/AutoGen/GenMake.py >> @@ -786,8 +786,10 @@ cleanlib: >>=20 >> def ReplaceMacro(self, str): >> for Macro in self.MacroList: >> - if self._AutoGenObject.Macros[Macro] and self._AutoGenObje= ct.Macros[Macro] in str: >> - str =3D str.replace(self._AutoGenObject.Macros[Macro],= '$(' + Macro + ')') >> + if self._AutoGenObject.Macros[Macro] and os.path.normcase(= self._AutoGenObject.Macros[Macro]) in os.path.normcase(str): >> + replace_dir =3D str[os.path.normcase(str).index(os.pat= h.normcase(self._AutoGenObject.Macros[Macro])): os.path.normcase(str).index= ( >> + os.path.normcase(self._AutoGenObject.Macros[Macro]= )) + len(self._AutoGenObject.Macros[Macro])] >> + str =3D str.replace(replace_dir, '$(' + Macro + ')') >> return str >>=20 >> def CommandExceedLimit(self): >> -- >> 2.28.0.windows.1 >>=20 >>=20 >>=20 >>=20 >>=20 >>=20 >=20 >=20 >=20 --Apple-Mail=_7E357A16-9442-4BAD-91A5-D9AD5DADD8A3 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Bob,

Sorry I was confused by the commit comment = `inconsistent path case`. So this was only a bug on case insensitive file s= ystems? 

I= =E2=80=99m paranoid as macOS support case and case insensitive file system= s and we have had a lot of strange bugs in the past. 

Thanks,
Andrew Fish

On Sep 23, 2020= , at 7:59 AM, Bob Feng <bob.c.feng@intel.com> wrote:

Yes. we did test on Windows and Linux.

From the https://docs.python.org/3/library/os.pat= h.html
os.path.normcase(pa= th)
   N= ormalize the case of a pathname. On Windows, convert all characters in the = pathname to lowercase, and also convert forward slashes to  backward s= lashes. On other operating systems, return the path unchanged.

Thanks,

Bob
-----Original Message-----<= /span>
From: Andrew Fish <<= /span>afish@apple.com> 
Sen= t: Wednesday, September 23, 2020 10:24 PM
To: devel@edk2.groups.io; Feng, Bob C <bob.c.feng@intel.com>
Cc: Liang, MingyueX <mingyuex= .liang@intel.com>; Liming Gao <gaoli= ming@byosoft.com.cn>; Chen, Christine <y= uwei.chen@intel.com>
Subject: Re: [edk2-devel] [PATCH] BaseTools: Normalize case o= f pathname when evaluating Macros.

Does this work on case= sensitive file systems?
On Sep 23, 2020, at 3:58 AM, Bob Feng <bob.c.feng@intel.com> wrote:

=EF=BB=BFFrom: Mingyue Liang <mingyuex.liang@intel.com>

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2880

Currently, When doing the Incremental build, the dire= ctory macros 
extended to absolute path in output Makefile, which is inconsistent 

with the outpu= t of Clean build.

When we do macro replacement= , we can't replace macro due to =
inconsistent path case, which results in inconsistent= display of 
incremental build and clean build in makefile.Therefore, the path is 

converted to a= chieve the correct macro replacement.

Signed-o= ff-by: Mingyue Liang <mingyuex.liang@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>=
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen= <yuwei.chen@intel.co= m>
---
BaseTools/Source/Python/AutoGen/G= enMake.py | 6 ++++--
1 file changed, 4 insertions(+), 2 delet= ions(-)

diff --git a/BaseTools/Source/Python/A= utoGen/GenMake.py 
b/BaseTools/Source/Python/AutoGen/GenMake.py
index 03= 14d0ea34..b04d3f5436 100755
--- a/BaseTools/Source/Python/Aut= oGen/GenMake.py
+++ b/BaseTools/Source/Python/AutoGen/GenMake= .py
@@ -786,8 +786,10 @@ cleanlib:

   def ReplaceMacro(self, str):
  = ;     for Macro in self.MacroList:
-=            if self.= _AutoGenObject.Macros[Macro] and self._AutoGenObject.Macros[Macro] in str:<= br class=3D"">-           = ;     str =3D str.replace(self._AutoGenObject.Macr= os[Macro], '$(' + Macro + ')')
+     &nbs= p;      if self._AutoGenObject.Macros[Macro] = and os.path.normcase(self._AutoGenObject.Macros[Macro]) in os.path.normcase= (str):
+         &nbs= p;      replace_dir =3D str[os.path.normcase(= str).index(os.path.normcase(self._AutoGenObject.Macros[Macro])): os.path.no= rmcase(str).index(
+       &nbs= p;            o= s.path.normcase(self._AutoGenObject.Macros[Macro])) + len(self._AutoGenObje= ct.Macros[Macro])]
+       &nbs= p;        str =3D str.replace(repla= ce_dir, '$(' + Macro + ')')
     &nb= sp; return str

   def Comm= andExceedLimit(self):
--
2.28.0.windows.1









--Apple-Mail=_7E357A16-9442-4BAD-91A5-D9AD5DADD8A3--