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=KH/84gAp; spf=pass (domain: linaro.org, ip: 209.85.128.67, mailfrom: leif.lindholm@linaro.org) Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by groups.io with SMTP; Wed, 17 Jul 2019 15:37:16 -0700 Received: by mail-wm1-f67.google.com with SMTP id s3so23641065wms.2 for ; Wed, 17 Jul 2019 15:37:15 -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:content-transfer-encoding:in-reply-to :user-agent; bh=JtC93KtnjTEf2aai0CJK4vkbJhgk9R1kf/SsGsOGUbs=; b=KH/84gApVqU+uLYzv7E7NJ7yTeB3iDp0+u2A9CXJ4E7I+XnH5uWgQFemSRGCBlNqLM 2NxTTJxwHe/e91Zvtkr6RNmf+QtD5l6GkaU5edUbcFllRYUzGcds+VO9KxeRF9E22qGv bHUOPUUITmLT54ZdJip2ALy8CqMz9vGrtVdPCNSiQMRnDI5k7ZlvTleg/JQ/Gt5KUenu MamsbkqYpELknTBB1sHkMu7D342NF5ivbFF//DPbUNDeyHLthPqvAoY68V8BgTYjGyXB 8SjgC+0jptM1NDOwKztb86VKEPBzOTqFrHmw/FeM8/llfqUfLnPIQd6CPbqxhRIj4Xk2 A2AQ== 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:content-transfer-encoding :in-reply-to:user-agent; bh=JtC93KtnjTEf2aai0CJK4vkbJhgk9R1kf/SsGsOGUbs=; b=TCnPf94vLostglYGO2REEcELGchtt/Lhzd/757v//70jga4P7EZMY9BOnNqzukQUSn 7BhcV6CUs/krKWXT1dUF4js/eYDwKyKplGQkkx3NGbagtSbl1jU6YEAGGN4mXq8Ndh/F a1Em5T5uqoNWPu66EGSY/6i6UY4UFvBv607V8pmqeIpRPZYwxAfgV0qq+Ct1bJmOseSs CDtv9cun7ckAoTTGMjDeT0plUkndhv49UBS7n09rSzCSYldYbD43aHCV2IC25Ne8lUjl TZqKmYE3M+eA8s7Ly0h0woBfowIE3Pqs7jDozFnki8wst0hpmFPBIsBsnF/LaFObyuBq 4OkQ== X-Gm-Message-State: APjAAAUFJgfoyxIFIajVwp4nemQ9RQufUzLBnn+fDl7ACEKE/4KZvXce caS/bqvOgi38t9lGBsw8/RJNsQ== X-Google-Smtp-Source: APXvYqyp6res7IW6eqvLMK8fyPBswJrXM/u5o+AzAI7cSC5WFTMsUwNqkxtqHFBCCp2mbWhhVARJIA== X-Received: by 2002:a1c:9696:: with SMTP id y144mr38279400wmd.73.1563403034233; Wed, 17 Jul 2019 15:37:14 -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 r4sm11112409wrq.82.2019.07.17.15.37.13 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 17 Jul 2019 15:37:13 -0700 (PDT) Date: Wed, 17 Jul 2019 23:37:11 +0100 From: "Leif Lindholm" To: "Gao, Liming" Cc: Laszlo Ersek , "devel@edk2.groups.io" , Rebecca Cran , "Feng, Bob C" , "Kinney, Michael D" , "afish@apple.com" Subject: Re: [PATCH 1/1] edksetup.sh: rework python executable scanning Message-ID: <20190717223711.GE2712@bivouac.eciton.net> References: <20190716190754.25412-1-leif.lindholm@linaro.org> <20579d07-778d-ef9f-9226-25e9629fa2d5@redhat.com> <20190716220449.r7kfozr7yaasi64k@bivouac.eciton.net> <4A89E2EF3DFEDB4C8BFDE51014F606A14E4A974D@SHSMSX104.ccr.corp.intel.com> MIME-Version: 1.0 In-Reply-To: <4A89E2EF3DFEDB4C8BFDE51014F606A14E4A974D@SHSMSX104.ccr.corp.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Wed, Jul 17, 2019 at 03:23:26AM +0000, Gao, Liming wrote: > Leif: > I agree to discuss the behavior first, then review the code logic in detail. I add my comments below. > > > -----Original Message----- > > From: Leif Lindholm [mailto:leif.lindholm@linaro.org] > > So, first of all - I am entirely happy with dropping the function. > > But I wanted to have it written anyway in case someone came up with a > > really good explanation for why we needed to completely cover the same > > pattern as the code currently in tree: and the situation does not > > relate to python4 or python5 - it relates to picking the latest of > > 2.7, 2.7.6, 3.5, 3.5.2, 3.5,4, 3.7 (which is my interpretation of the > > behaviour of current HEAD). > > > > So basically - I think we need to reach an agreement (with BaseTools > > maintainers, and existing users) about what the behaviour should be. > > > > - What does PYTHON3_ENABLE mean? Is it for probing only, or are we > > setting it for later use by BaseTools? > > PYTHON3_EANBLE is to decide python3 enable or not. It has high priority. > Once it is set, PYTHON_COMMAND will be ignored. > If it is set to TRUE, edksetup.sh will find Python3 in the system, set PYTHON_COMMAND env. > If it is set to other value, edksetup.sh will find Python2 in the system, set PYTHON_COMMAND env. > If PYTHON3_EANBLE is not set, PYTHON_COMMAND will be used if PYTHON_COMMAND is set. > If PYTHON3_EANBLE is not set, and PYTHON_COMMAND is not set, the > default behavior will set PYTHON3_EANBLE to TRUE. (typo as discussed in other email corrected above (python3->python2)) > So, the default behavior is to use highest version Python3. User can > set PYTHON_COMMAND for their python version. > > > - What should the priority order be when looking for python > > executables? > > Find the high version python. When we enable Python3, we find > Python37 does great performance optimization. > So, we think high version python can bring more benefit. This is where I disagree. As a user/admin, I am no more interested in my build tools deciding I would prefer another python than the default one than I am in they deciding I would prefer another toolchain. If I build a specific commit of edk2 (including BaseTools) from a specific command line, then I expect any subsequent builds to behave identically unless I have reconfigured the system. Installing another version of python without changing the system default shoulds not change that. If I _want_ to use the newly installed python, I can change the python/python2/python3 links. And if I don't want to do that, I can set PYTHON_COMMAND. "We have seen better performance with 3.7" is an excellent argment for suggesting people install, and use, python 3.7. I do not see it as a good argument for always preferring the highest version available. > > - Can we use simply 'python' as the default? > > Based on previous discussion, we recommend to use Python3 as default. If python3 is to be the default, then I see no use for PYTHON3_£NABLE. If PYTHON_COMMAND is set, it should always be respected. If it's not set, python3 is picked in preference anyway. > > - Do we need functionality for more than selecting between > > python2/python3? > > Yes. Find the high version python installed in the system. Best Regards, Leif