From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=OrjGDhv3; spf=pass (domain: linaro.org, ip: 209.85.128.65, mailfrom: leif.lindholm@linaro.org) Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by groups.io with SMTP; Wed, 08 May 2019 04:38:28 -0700 Received: by mail-wm1-f65.google.com with SMTP id h11so2804862wmb.5 for ; Wed, 08 May 2019 04:38:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=f3pMf4Gyc3QnWT8BoJr7uvH+OZ470y6oqlxKWy+Ng48=; b=OrjGDhv3dD9ntnQsKx76EC4jQUJFpp9X7CkI0iaiQrgFtVuQbDoKPRDiFFbjfLUVXu HpSHthJHahcLG7Ca9lstvip1CNkOCG19chssM+GRq/wlyvtrPRdkm2sYj0nMpGf4y5Cg RtXaxK0ZSPz8xilqTsN65gXRVBzat8WSiq1PN07OypAjLs5cwUETCQtLxei1vSxQtXE/ 37W0nMEnhONdkjNxYXPHmCsXefPp5Ae4UkYNuV5j8aS2hzmooz2qeUGgpmVJ5FClRgJl i9g0OX6zfqpY7gRM/+w9qMVLe/up+PZJNs2Z7ubKRHt4C82k5YTs8DT2dYQ+fXmGesxs NURg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=f3pMf4Gyc3QnWT8BoJr7uvH+OZ470y6oqlxKWy+Ng48=; b=M+9ALPBVzq1eACxw7ICKZiQiUa1zYbuu/alo8oI+ScNkKlSRrqb5SMkk8DNe6vz4hx NsKgoSElCLUomVKkkKf8BBtzDU45jrofm6jHzYVnE4OVrT5NsOvbFZdbwJ89UFRzztXE K+PE6SyeVMbhSawmc7x4n5blKw567IRgffX+j9aZWJutmlWBO3mgEWXLHuAnfR7TNz8x 1BUUJ8PhlKMHgPk/XELqjv5vxfWe5tQUxbgTSGMoPU68flffmjshUhuodngUJLd7C3MX ey7LW1naQ1lhEooZSDSkokWhLhQIq1xzcgc8ZttDd2ZLeMgwqUKE5YFpzJmtHeF0LYUM NXtg== X-Gm-Message-State: APjAAAW1n3XNV2V/samljeba8JSJSYXHZBVrY02CQHkYmz6KlcMwk+WZ by5kf9Rkfp2ULhc64HKzQREKHQGrKCA= X-Google-Smtp-Source: APXvYqz/1cWnf6xplttv37Epjh48O9VOhyZP86a8ZBHUHRHZLC5j3k42OV6bB7Y+YPa2Sju/eeiJ7Q== X-Received: by 2002:a1c:238d:: with SMTP id j135mr2670465wmj.46.1557315506769; Wed, 08 May 2019 04:38:26 -0700 (PDT) Return-Path: Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id b2sm646808wma.41.2019.05.08.04.38.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 May 2019 04:38:25 -0700 (PDT) Date: Wed, 8 May 2019 12:38:24 +0100 From: "Leif Lindholm" To: devel@edk2.groups.io, "Fan, ZhijuX" Cc: "Gao, Liming" , bob.c.feng@intel.com Subject: Re: [edk2-devel] [PATCH] BaseTools:The code used to test python module is moved to edksetup Message-ID: <20190508113824.ixax7b3nl6meypty@bivouac.eciton.net> References: <08650203BA1BD64D8AD9B6D5D74A85D16010465E@SHSMSX101.ccr.corp.intel.com> MIME-Version: 1.0 In-Reply-To: <08650203BA1BD64D8AD9B6D5D74A85D16010465E@SHSMSX101.ccr.corp.intel.com> User-Agent: NeoMutt/20170113 (1.7.2) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi guys, This patch (now committed) break our ci (which runs with 'set -e'). This seems to be caused by TestUtilModule() returning error (1 - non-zero) when it actually finds the module, and success (0) when it does not. While debugging, I found another side effect that I have not had time to track down, and does not go away with resolving this incorrect behaviour. When I run from the command line: $ set -e $ . edks to tab-complete the filename in bash, this terminates the current shell. Unless someone can find a solution to the latter quickly, can we revert this patch please? One further comment below. On Tue, May 07, 2019 at 03:53:18AM +0000, Bob Feng wrote: > Reviewed-by: Bob Feng > > -----Original Message----- > From: Fan, ZhijuX > Sent: Tuesday, April 30, 2019 10:16 AM > 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 > > BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1582 > > 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 > > 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 > } > > +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 && Not adding this && in 9c2d68c0a299 ("BaseTools: Update windows and linux run scripts file to use Python3") when SetupPython was added was clearly an oversight, but that is not something to quietly fix up in this completely unrelated patch. When resending a new version, after revert, please do that as a separate patch. Best Regards, Leif > + SetupPython && > + TestUtilModule > } > > I=$# > -- > 2.14.1.windows.1 > > > >