From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::443; helo=mail-wr1-x443.google.com; envelope-from=leif.lindholm@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 48A74211CD615 for ; Wed, 27 Feb 2019 00:26:04 -0800 (PST) Received: by mail-wr1-x443.google.com with SMTP id t18so16864927wrx.2 for ; Wed, 27 Feb 2019 00:26:04 -0800 (PST) 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=p9rr0MTRl+QqHxZ6xvMYQli5Nwt2A/y60XH64+92uyU=; b=pRsgY2jO2e5acs3B6lMdcHAG1mxH4hyCUPDID4Lja3R5btedHHeAz93N2Lw2hcgHHG VB7iaEb4BotZn4QzbunzQvfMyKpZmNL887CN5aCC1u7IenVrN7RPGBs8yHzvxqpc5PWL Tj3agFgO8rLxTt5XyjMqxkDMFPfEYvcb94JxjJO9K+Rk8wLgQXF6Jeyjz9y/cCRsl1DR Ckigh4bgOI0dUK9NTVKbCUvrUgubspd6mpsKn4bUxPulyz87RDJ5TP3RVM6Ar6yYMtvT GBIKB1FKvDRipIdQ0EQ0lEkx7irLJqW9uUJY0A/QWP1RN7ZlAt6WEj+g4six6IC5QK6+ JX9w== 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=p9rr0MTRl+QqHxZ6xvMYQli5Nwt2A/y60XH64+92uyU=; b=Hvlpm9aOUbAzjHJ1hu6AOxV/TiKNP8xrBs+DLln4ZR/TqOWPqix8itGnz/4TxayuSa ZzLJdgVatqwUPnXDoCmm5XTJqvl/vonRE8gNFXlIjxG+DWCjRajePSWugn9im+E/2TvV KS3k1hIEAlNu/F5mxz22dLuDsfrOGU55P0zJQE2zaksJYUmHBsb9mQez4sRjnqkgSlJO 790SVpaJOXpmWtdED4RrA0Coz96C0C3x7RZ4yNqdfkH87t8RJQpIUk+sGLqhQ76tawyf SzJrG83wvmV7628DvqD7yfrKSbz/3FkJsjCAPNPs3SZ1Lb7FpqSjCg8kxGfLvhOePCSs vOSw== X-Gm-Message-State: APjAAAUZiL3RTMYvY25A4m8j+nKVb+VZkBwu4nN+EhxwDQ/GvBJoIo/x OtKnld37EwhwOjdOO+1Veu6BzA== X-Google-Smtp-Source: APXvYqwzYxBU29ljJO83ShV6Mj64SM2k8d9ecGzFXnEpYNTSu6srDd1ya3kqn09CnUVGkrR7MWjX2Q== X-Received: by 2002:adf:dd12:: with SMTP id a18mr1315508wrm.4.1551255962507; Wed, 27 Feb 2019 00:26:02 -0800 (PST) Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id i10sm42442598wrx.54.2019.02.27.00.26.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Feb 2019 00:26:01 -0800 (PST) Date: Wed, 27 Feb 2019 08:26:00 +0000 From: Leif Lindholm To: "Feng, Bob C" Cc: Ard Biesheuvel , "edk2-devel@lists.01.org" , Liming Gao Message-ID: <20190227082600.7g6m6a6uwmp4sfuj@bivouac.eciton.net> References: <20190226010519.17740-1-bob.c.feng@intel.com> MIME-Version: 1.0 In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) 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:26:04 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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=1509 > > > > Add python3-distutils Ubuntu package checking. > > > > Hi Bob, > > This assumes that all Linux systems are Ubuntu based, which is not > true. The apt tool is specific to Debian/Ubuntu, Fedora/Redhat and > Suse all use something else. > > In general, I don't think we should validate the Python environment to > this extent, since we cannot fix the problem for the user anyway, only > flag it, and since python explodes rather loudly in this case, I think > we should be able to leave it up to developers that are savvy enough > to build EDK2 to also find the python distutils package for their > platform. > > Note that that doesn't mean we shouldn't document this, and not just > 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 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 = True > > +try: > > + import distutils.util > > +except: > > + distutils_exist = False > > + > > +if not distutils_exist: > > + print(""" > > +python3-distutil packages is missing. Please install it with the following 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