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: zhijux.fan@intel.com) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by groups.io with SMTP; Mon, 29 Apr 2019 19:16:08 -0700 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Apr 2019 19:16:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,412,1549958400"; d="dat'59?scan'59,208,59";a="153440281" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by FMSMGA003.fm.intel.com with ESMTP; 29 Apr 2019 19:16:07 -0700 Received: from FMSMSX110.amr.corp.intel.com (10.18.116.10) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 29 Apr 2019 19:16:07 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx110.amr.corp.intel.com (10.18.116.10) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 29 Apr 2019 19:16:06 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.129]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.216]) with mapi id 14.03.0415.000; Tue, 30 Apr 2019 10:16:02 +0800 From: "Fan, ZhijuX" To: "devel@edk2.groups.io" CC: "Gao, Liming" , "Feng, Bob C" Subject: [PATCH] BaseTools:The code used to test python module is moved to edksetup Thread-Topic: [PATCH] BaseTools:The code used to test python module is moved to edksetup Thread-Index: AdT++qa6Qb/hWb3eRCKan8n3nqgOaA== Date: Tue, 30 Apr 2019 02:16:01 +0000 Message-ID: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: zhijux.fan@intel.com X-Groupsio-MsgNum: 39815 Content-Type: multipart/mixed; boundary="_000_FAD0D7E0AE0FA54D987F6E72435CAFD50AF57197SHSMSX101ccrcor_" Content-Language: en-US --_000_FAD0D7E0AE0FA54D987F6E72435CAFD50AF57197SHSMSX101ccrcor_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=3D1582 testing for presence of python modules should be done in edksetup to reduce impact on subsequent build times. This code currently exists in BaseTools/Tests/RunTest.py. This patch is going to fix this issue. Cc: Bob Feng Cc: Liming Gao Signed-off-by: Zhiju.Fan --- BaseTools/Tests/RunTests.py | 8 -------- edksetup.sh | 15 +++++++++++++-- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/BaseTools/Tests/RunTests.py b/BaseTools/Tests/RunTests.py index 81af736cd8..e8acf1b348 100644 --- a/BaseTools/Tests/RunTests.py +++ b/BaseTools/Tests/RunTests.py @@ -12,14 +12,6 @@ import os import sys import unittest - -try: - import distutils.util -except ModuleNotFoundError: - sys.exit(''' -Python reported: "No module named 'distutils.util" -''') - import TestTools =20 def GetCTestSuite(): diff --git a/edksetup.sh b/edksetup.sh index c7b2e1e201..add18ca7c0 100755 --- a/edksetup.sh +++ b/edksetup.sh @@ -177,11 +177,22 @@ function SetupPython() SetupPython3 } =20 +function TestUtilModule() +{ + if ( $PYTHON_COMMAND -c "import distutils.util" >/dev/null 2>&1 );then + return 1 + else + echo Error: "No module named 'distutils.util" + return 0 + fi +} + function SourceEnv() { SetWorkspace && - SetupEnv - SetupPython + SetupEnv && + SetupPython && + TestUtilModule } =20 I=3D$# --=20 2.14.1.windows.1 --_000_FAD0D7E0AE0FA54D987F6E72435CAFD50AF57197SHSMSX101ccrcor_ Content-Disposition: attachment; filename="winmail.dat" Content-Transfer-Encoding: base64 Content-Type: application/ms-tnef; name="winmail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