From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.65; helo=mga03.intel.com; envelope-from=bob.c.feng@intel.com; receiver=edk2-devel@lists.01.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 0000021959CB2 for ; Wed, 27 Feb 2019 00:52:11 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Feb 2019 00:52:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,418,1544515200"; d="scan'208";a="125555532" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga007.fm.intel.com with ESMTP; 27 Feb 2019 00:52:10 -0800 Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 27 Feb 2019 00:52:10 -0800 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by fmsmsx110.amr.corp.intel.com (10.18.116.10) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 27 Feb 2019 00:52:10 -0800 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.110]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.102]) with mapi id 14.03.0415.000; Wed, 27 Feb 2019 16:52:08 +0800 From: "Feng, Bob C" To: Leif Lindholm CC: Ard Biesheuvel , "edk2-devel@lists.01.org" , "Gao, Liming" Thread-Topic: [edk2] [Patch] BaseTools: Add python3-distutils Ubuntu package checking Thread-Index: AQHUzW9qamYumj4fJ0Oby8CtteAveKXyxhOAgAAFFQCAAIf4EA== Date: Wed, 27 Feb 2019 08:52:08 +0000 Message-ID: <08650203BA1BD64D8AD9B6D5D74A85D1600901EC@SHSMSX101.ccr.corp.intel.com> References: <20190226010519.17740-1-bob.c.feng@intel.com> <20190227082600.7g6m6a6uwmp4sfuj@bivouac.eciton.net> In-Reply-To: <20190227082600.7g6m6a6uwmp4sfuj@bivouac.eciton.net> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] BaseTools: Add python3-distutils Ubuntu package checking X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Feb 2019 08:52:12 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks for comments. I think the print message is not good. It's based on U= butun OS. It's not right.=20 I think the import error need to be caught and then print some messages, ot= herwise the build tool will break and print the call stack which is not fri= endly to user. Thanks, Bob=20 -----Original Message----- From: Leif Lindholm [mailto:leif.lindholm@linaro.org]=20 Sent: Wednesday, February 27, 2019 4:26 PM To: Feng, Bob C Cc: Ard Biesheuvel ; edk2-devel@lists.01.org; Ga= o, Liming Subject: Re: [edk2] [Patch] BaseTools: Add python3-distutils Ubuntu package= checking On Wed, Feb 27, 2019 at 09:07:49AM +0100, Ard Biesheuvel wrote: > On Tue, 26 Feb 2019 at 02:05, Feng, Bob C wrote: > > > > https://bugzilla.tianocore.org/show_bug.cgi?id=3D1509 > > > > Add python3-distutils Ubuntu package checking. > > >=20 > Hi Bob, >=20 > This assumes that all Linux systems are Ubuntu based, which is not=20 > true. The apt tool is specific to Debian/Ubuntu, Fedora/Redhat and=20 > Suse all use something else. >=20 > In general, I don't think we should validate the Python environment to=20 > this extent, since we cannot fix the problem for the user anyway, only=20 > flag it, and since python explodes rather loudly in this case, I think=20 > we should be able to leave it up to developers that are savvy enough=20 > to build EDK2 to also find the python distutils package for their=20 > platform. >=20 > Note that that doesn't mean we shouldn't document this, and not just=20 > for Ubuntu. But I think putting it in the script is overkill. Yes, I agree It is also worth noting that python3-distutils is the current debian/ubuntu= package name. So if we *do* print a message... > > Contributed-under: TianoCore Contribution Agreement 1.1 > > Signed-off-by: Bob Feng > > Cc: Liming Gao > > --- > > BaseTools/Tests/RunTests.py | 14 ++++++++++++++ > > 1 file changed, 14 insertions(+) > > > > diff --git a/BaseTools/Tests/RunTests.py=20 > > b/BaseTools/Tests/RunTests.py index 0dd65632d0..64778db981 100644 > > --- a/BaseTools/Tests/RunTests.py > > +++ b/BaseTools/Tests/RunTests.py > > @@ -17,10 +17,24 @@ > > # > > import os > > import sys > > import unittest > > > > +distutils_exist =3D True > > +try: > > + import distutils.util > > +except: > > + distutils_exist =3D False > > + > > +if not distutils_exist: > > + print(""" > > +python3-distutil packages is missing. Please install it with the follo= wing command: ... printing "missing python distutils package" and possibly python version= would be more reliable. But as Ard points out - this is effectively what python itself will say. / Leif > > + > > +bash$ sudo apt-get install python3-distutil > > +""") > > + sys.exit(-1) > > + > > import TestTools > > > > def GetCTestSuite(): > > import CToolsTests > > return CToolsTests.TheTestSuite() > > -- > > 2.20.1.windows.1 > > > > _______________________________________________ > > edk2-devel mailing list > > edk2-devel@lists.01.org > > https://lists.01.org/mailman/listinfo/edk2-devel > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel