From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: bob.c.feng@intel.com) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by groups.io with SMTP; Thu, 03 Oct 2019 20:05:46 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Oct 2019 20:05:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,254,1566889200"; d="scan'208";a="192300392" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga007.fm.intel.com with ESMTP; 03 Oct 2019 20:05:44 -0700 Received: from fmsmsx158.amr.corp.intel.com (10.18.116.75) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 3 Oct 2019 20:05:44 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx158.amr.corp.intel.com (10.18.116.75) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 3 Oct 2019 20:04:27 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.166]) by shsmsx102.ccr.corp.intel.com ([169.254.2.176]) with mapi id 14.03.0439.000; Fri, 4 Oct 2019 11:04:24 +0800 From: "Bob Feng" To: "devel@edk2.groups.io" , "Kinney, Michael D" , "Kubacki, Michael A" CC: "Gao, Liming" Subject: Re: [edk2-devel] [PATCH V1 1/1] BaseTools: Fix GenMake multi-workspace failure Thread-Topic: [edk2-devel] [PATCH V1 1/1] BaseTools: Fix GenMake multi-workspace failure Thread-Index: AQHVeKu2UlHWpzEqQ0a9DrF4PMaa0qdI54+AgADnCpA= Date: Fri, 4 Oct 2019 03:04:23 +0000 Message-ID: <08650203BA1BD64D8AD9B6D5D74A85D16154271D@SHSMSX104.ccr.corp.intel.com> References: <20191001225756.47384-1-michael.a.kubacki@intel.com> In-Reply-To: Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiZjAwOWUxOWYtNGM2Ny00YzAyLWI4ZTEtNzhhODg2NWE1MTk2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiUlZtY3BqWEVWbVpFN0VDeFM3bE1YNE4xelNaOWYyYllrZUhSbFliRitxaEJsRWxDOThCZityUzExZEEzSFBTNiJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: bob.c.feng@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks for the fix. I agree.=20 Reviewed-by: Bob Feng -----Original Message----- From: devel@edk2.groups.io On Behalf Of Michael D K= inney Sent: Friday, October 4, 2019 5:14 AM To: devel@edk2.groups.io; Kubacki, Michael A = ; Kinney, Michael D Cc: Feng, Bob C ; Gao, Liming Subject: Re: [edk2-devel] [PATCH V1 1/1] BaseTools: Fix GenMake multi-work= space failure Hi Michael, Reviewed-by: Michael D Kinney This look really important. Do you want me to push today? Mike > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of=20 > Kubacki, Michael A > Sent: Tuesday, October 1, 2019 3:58 PM > To: devel@edk2.groups.io > Cc: Feng, Bob C ; Gao, Liming=20 > ; Kinney, Michael D > Subject: [edk2-devel] [PATCH V1 1/1] BaseTools: Fix GenMake=20 > multi-workspace failure >=20 > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2232 >=20 > Commit 0075ab2cec introduced an issue that causes an exception when=20 > multiple workspace packages paths are specified. For example, if=20 > edk2-platforms is used, the root directory will contain an edk and=20 > edk2-platforms directory representing the respective repositories. >=20 > In GenMake, the path to the package DEC file for a module is=20 > discovered by getting the relative path of the INF to the workspace=20 > root directory. Each directory in the relative path is incrementally=20 > joined to the WORKSPACE directory. The file list in the joined path is= =20 > searched for a DEC file. >=20 > As an example, if the build command is used on a package outside the=20 > edk2 repository, the INF file path is relative to the edk2-platforms=20 > directory not edk2. This causes directory paths to be built that do=20 > not exist. > Commit 0075ab2cec replaced the > os.path.exists() call with a try except block that always fails when=20 > os.listdir() is invoked to enumerate the list of files in the built=20 > directory path on packages outside edk2. >=20 > This commit restores the original conditional statement which avoids=20 > calling os.listdir() with an invalid directory path. >=20 > Cc: Bob Feng > Cc: Liming Gao > Cc: Michael D Kinney > Signed-off-by: Michael Kubacki > > --- > BaseTools/Source/Python/AutoGen/GenMake.py | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) >=20 > diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py > b/BaseTools/Source/Python/AutoGen/GenMake.py > index 584156dab9..97ba158ff2 100755 > --- a/BaseTools/Source/Python/AutoGen/GenMake.py > +++ b/BaseTools/Source/Python/AutoGen/GenMake.py > @@ -637,13 +637,11 @@ cleanlib: > while not found and os.sep in package_rel_dir: > index =3D package_rel_dir.index(os.sep) > current_dir =3D mws.join(current_dir, > package_rel_dir[:index]) > - try: > + if os.path.exists(current_dir): > for fl in os.listdir(current_dir): > if fl.endswith('.dec'): > found =3D True > break > - except: > - EdkLogger.error('build', > FILE_NOT_FOUND, "WORKSPACE does not exist.") > package_rel_dir =3D package_rel_dir[index + 1:] >=20 > MakefileTemplateDict =3D { > -- > 2.16.2.windows.1 >=20 >=20 >=20