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.93, mailfrom: chasel.chiu@intel.com) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by groups.io with SMTP; Mon, 19 Aug 2019 01:59:04 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Aug 2019 01:59:04 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,403,1559545200"; d="scan'208";a="177816860" Received: from pgsmsx107.gar.corp.intel.com ([10.221.44.105]) by fmsmga008.fm.intel.com with ESMTP; 19 Aug 2019 01:59:03 -0700 Received: from pgsmsx111.gar.corp.intel.com ([169.254.2.22]) by PGSMSX107.gar.corp.intel.com ([169.254.7.174]) with mapi id 14.03.0439.000; Mon, 19 Aug 2019 16:59:02 +0800 From: "Chiu, Chasel" To: "devel@edk2.groups.io" , "Cheng, Ching JenX" CC: "Chan, Amy" , "Kubacki, Michael A" , "Desimone, Nathaniel L" , "Gao, Liming" Subject: Re: [edk2-devel] [PATCH] Python run fail if env variable PYTHON_HOME is not set Thread-Topic: [edk2-devel] [PATCH] Python run fail if env variable PYTHON_HOME is not set Thread-Index: AQHVVl6xy4xCjEDEL067tB7yYIkRgqcCKCuA Date: Mon, 19 Aug 2019 08:59:02 +0000 Message-ID: <3C3EFB470A303B4AB093197B6777CCEC5046329F@PGSMSX111.gar.corp.intel.com> References: <20190819072128.15400-1-ching.jenx.cheng@intel.com> In-Reply-To: <20190819072128.15400-1-ching.jenx.cheng@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-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNDA0MTI5YzgtYTAxYy00YzkxLWI4OTItYWM5N2UzMzU3YTBmIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoidE5GNVNHcU90MndcL0wyQVBzaWc3MXV1Tzh3dGhsNG56aWJYdDIwN2IwcmtiM201ZHVETlVhZHFKVERnZHd1T2oifQ== x-ctpclassification: CTP_NT x-originating-ip: [172.30.20.205] MIME-Version: 1.0 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Please correct subject as you are modifying edk2-platform files: --subjec= t-prefix=3D"edk2-platforms: PATCH" Also the RebaseAndPatchFspBinBaseAddress.py should be obsolete soon, so pl= ease focus on RebaseFspBinBaseAddress.py. > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > Cheng, Ching JenX > Sent: Monday, August 19, 2019 3:21 PM > To: devel@edk2.groups.io > Cc: Chan, Amy ; Kubacki, Michael A > ; Chiu, Chasel ; > Desimone, Nathaniel L ; Gao, Liming > > Subject: [edk2-devel] [PATCH] Python run fail if env variable PYTHON_HOM= E is > not set >=20 > BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2041 >=20 > In Platform\Intel\MinPlatformPkg\Tools\Fsp\RebaseFspBinBaseAddress.py > It will run another python code. > But if the environment variable "PYTHON_HOME" is not exist and we didn't > add any python's path to "PATH". > It will cause error because python command not found. >=20 > the error message as below: > 'python' is not recognized as an internal or external command, operable > program or batch file. >=20 > So we set the python's path from which execute the python code if > PYTHON_HOME was not exist. >=20 > Cc: Amy Chan > Cc: Michael Kubacki > Cc: Chasel Chiu > Cc: Nate DeSimone > Cc: Liming Gao > Signed-off-by: Ching JenX Cheng > --- >=20 > Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAddre > ss.py | 2 ++ > 1 file changed, 2 insertions(+) >=20 > diff --git > a/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAdd > ress.py > b/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAd > dress.py > index 406e5ec130..1d72b4112f 100644 > --- > a/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAdd > ress.py > +++ > b/Platform/Intel/MinPlatformPkg/Tools/Fsp/RebaseAndPatchFspBinBaseAd > +++ dress.py > @@ -76,6 +76,8 @@ file.close() > pythontool =3D 'python' > if 'PYTHON_HOME' in os.environ: > pythontool =3D os.environ['PYTHON_HOME'] + os.sep + 'python' > +else: > + pythontool =3D sys.executable > Process =3D subprocess.Popen([pythontool, splitFspBinPath, > "info","-f",fspBinFilePath], stdout=3Dsubprocess.PIPE) Output =3D > Process.communicate()[0] FsptInfo =3D Output.rsplit(b"FSP_M", 1); > -- > 2.21.0.windows.1 >=20 >=20 >=20