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=XDpOrcu9; 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:45:57 -0700 Received: by mail-wm1-f65.google.com with SMTP id o189so2902116wmb.1 for ; Wed, 08 May 2019 04:45:57 -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=z9ZESOm5LVoD1X0spgxLgPfasbiPNaXzf4g6DmnYa94=; b=XDpOrcu9U2ozbSBm/FB/XjzH25HaMEkjVNdugq4XRXC15Di3oEwM3cZOTig0SlsjYd td2st5JAhYJMdp5VcPh2LGRNJUiuccM2MnCRvCI82VNpvVL3zaX/XUJd/R0w0GKH4ACi qmBA2qK0jEFPBjgUJwrIMnqKUTfsBksl38wkpz3L3BmXwdgtxSZCAsZEHIFwmf4kCuQM VhlbQBJo431LkeT6Z2Z5yBRA1l8VOOVlMu1E1TwfoWIOpT/EOxGAdbgb7Y+VFEE97qxh 33mQDM2w5hc6LOe7qBl2VjeZs86MlwKAMpdT1MGkXjG5JaHaeWy23tKfueo/PH43Kg4Y 0a/Q== 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=z9ZESOm5LVoD1X0spgxLgPfasbiPNaXzf4g6DmnYa94=; b=XwV1qNEbC3GAsXr0VEEVa47UAcGB17zU1ve758FrCQOKERgTNCt0rZ0vtdm/v9V8Ih /g+tO0f00irIi/PJI8jMxtiU6rJMEEP8BOfapkHrk1UpyWfemMd3XFflL25pm0HLp6Ys Nb7JWKggT0MDMD2RzJNwCWaR6T3Aqu6HJOuGCXllNqms9J0FOsKxJdpKmH8BKugkNXwp B3mqr2JXnRaqY2aIK7HIe264FfpJ0M7gtpC5QSLaX1DfYp9CfwQZgQbEnC8Saz8Ss480 57/YoEzCS2b+fXt99V5RLgsj7q+4YZsmbsiQCi2FcGtuthA0CB4M+WN5QVcgSFbulg/1 nCbg== X-Gm-Message-State: APjAAAUeOfTNzIQk1NfF0LhGtbDRMeG/PVPwGwfTL+QEF702537Xa011 0wZUjSq2nP2Xl/P7nTaUeh8NepDDbUg= X-Google-Smtp-Source: APXvYqzql9RTsJSrYTpejAPGaKOn+8n6YnaLFhaSS+Yf3r48XssOASDEsBgQ9eV6Z9Qj//lwcCfT5w== X-Received: by 2002:a1c:ef08:: with SMTP id n8mr2615073wmh.151.1557315955502; Wed, 08 May 2019 04:45:55 -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 b2sm5879138wrt.20.2019.05.08.04.45.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 08 May 2019 04:45:54 -0700 (PDT) Date: Wed, 8 May 2019 12:45:53 +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: <20190508114553.e4dumwsj7jeafnyn@bivouac.eciton.net> References: <08650203BA1BD64D8AD9B6D5D74A85D16010465E@SHSMSX101.ccr.corp.intel.com> <20190508113824.ixax7b3nl6meypty@bivouac.eciton.net> MIME-Version: 1.0 In-Reply-To: <20190508113824.ixax7b3nl6meypty@bivouac.eciton.net> User-Agent: NeoMutt/20170113 (1.7.2) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, May 08, 2019 at 12:38:24PM +0100, Leif Lindholm wrote: > 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? Err... Never mind, my brain engaged shortly after sending. As usual. There are many reasons why the various scripts invoked by bash for its command line completion may sometimes return non-zero, and the issue is not specific to this script. Still, due to the && issue pointed out below, I would still like to see a revert, a separate && fix to the pre-existing version, and a new version of this patch with corrected logic. Best Regards, Leif > 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 > > > > > > > >