From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: michael.d.kinney@intel.com) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by groups.io with SMTP; Thu, 03 Oct 2019 14:14:15 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Oct 2019 14:14:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,253,1566889200"; d="scan'208";a="186044755" Received: from orsmsx105.amr.corp.intel.com ([10.22.225.132]) by orsmga008.jf.intel.com with ESMTP; 03 Oct 2019 14:14:14 -0700 Received: from orsmsx151.amr.corp.intel.com (10.22.226.38) by ORSMSX105.amr.corp.intel.com (10.22.225.132) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 3 Oct 2019 14:14:14 -0700 Received: from orsmsx113.amr.corp.intel.com ([169.254.9.232]) by ORSMSX151.amr.corp.intel.com ([169.254.7.201]) with mapi id 14.03.0439.000; Thu, 3 Oct 2019 14:14:13 -0700 From: "Michael D Kinney" 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-workspace failure Thread-Topic: [edk2-devel] [PATCH V1 1/1] BaseTools: Fix GenMake multi-workspace failure Thread-Index: AQHVeKu219+ejqXe7kuvogkNpoXGPKdJbVTw Date: Thu, 3 Oct 2019 21:14:13 +0000 Message-ID: References: <20191001225756.47384-1-michael.a.kubacki@intel.com> In-Reply-To: <20191001225756.47384-1-michael.a.kubacki@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.22.254.138] MIME-Version: 1.0 Return-Path: michael.d.kinney@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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 Kubacki, Michael A > Sent: Tuesday, October 1, 2019 3:58 PM > To: devel@edk2.groups.io > Cc: Feng, Bob C ; Gao, Liming > ; Kinney, Michael D > > Subject: [edk2-devel] [PATCH V1 1/1] BaseTools: Fix > GenMake 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 multiple workspace packages paths are > specified. For example, if edk2-platforms is used, the > root directory will contain an edk and edk2-platforms > directory representing the respective repositories. >=20 > In GenMake, the path to the package DEC file for a > module is discovered by getting the relative path of the > INF to the workspace root directory. Each directory in > the relative path is incrementally joined to the > WORKSPACE directory. The file list in the joined path is > searched for a DEC file. >=20 > As an example, if the build command is used on a package > outside the edk2 repository, the INF file path is > relative to the edk2-platforms directory not edk2. This > causes directory paths to be built that do not exist. > Commit 0075ab2cec replaced the > os.path.exists() call with a try except block that > always fails when os.listdir() is invoked to enumerate > the list of files in the built directory path on > packages outside edk2. >=20 > This commit restores the original conditional statement > which avoids 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