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=Nfc4fYil; spf=pass (domain: linaro.org, ip: 209.85.128.68, mailfrom: leif.lindholm@linaro.org) Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by groups.io with SMTP; Thu, 18 Jul 2019 10:55:42 -0700 Received: by mail-wm1-f68.google.com with SMTP id a15so26434097wmj.5 for ; Thu, 18 Jul 2019 10:55:42 -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=kNwxsSP0OcbWStLIyWuspnt0S1JnR4mdLTIfMR3OdUQ=; b=Nfc4fYil/jh8oLGwezEt2wipWKf10uOD7rpxwgedBb7N9HvGzliVaZmvdMjRbwIZzh U29V+mnNdAaUxXGuLIISIV878GuVXBFMS4OEoVQNmFVxm9onyKhUFtIZMkQ73f7OJ4/0 umCK3N7AMcwQqgP40B8prDrdYxLbMu9Vf7OgnZdK5oCzom0K0HQvgspNtf+J9YQ4H+wd bx5k/m7WgZzC+By735fMFSpB9JSFHksQP0CcAUjSfgPsS3pKQTsT5gJWhIWfoK5sWhLE 5LX4cGLsgdXeNKnyOd/6fui+paPUcGoBWRXh3eyNCHyvHJmhYWD67ZhJBZIk2PdHH6dN x9cA== 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=kNwxsSP0OcbWStLIyWuspnt0S1JnR4mdLTIfMR3OdUQ=; b=BMlDw67Ir/TakTXdFdTTJforhKH5Jg64t8jCGE53LTbRMvK+LinbyODk9yMgUUEF+r hhOIw/mWIXY+6hTWe4kxqxOE3csjgskmNPh1yH+21GhJWVzbNQY4VNMYiD+PfxWO0/8V wPDiae6quqn/pygf3DXj5xuO9CYvejZXZQ9joMu5QItkRnlty4Hnk0XTqTjztNNji2Zw m8VqBchsoyfXmsunmYjwn6mBeBzD76qA+1i/NVH6I6iPEUv3IBhnYf/ZKbgJedT9Yqcg yGUhBc3q7D/iJ5Kib+9H8pXqG8vFFhZ9AFIKLjBFTZTXCBVV5/NdkXEnpG1z16lfJ62o 4W/A== X-Gm-Message-State: APjAAAXrEEwAlb7EhnK1dv7LqQPCkqeOxlhaCJodzqy4zjDL7B/pXbZf uf+KP0BuKa+eeXhTjQXgZVyT1Q== X-Google-Smtp-Source: APXvYqyeeeYTE/jqkzhs1vse6snLrgRRPcbnAzFScRjE15lDEMnbL3qD321MZDCP6rWYR/zNsbWctA== X-Received: by 2002:a7b:cc09:: with SMTP id f9mr45030337wmh.68.1563472540931; Thu, 18 Jul 2019 10:55:40 -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 c30sm43160205wrb.15.2019.07.18.10.55.39 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 18 Jul 2019 10:55:39 -0700 (PDT) Date: Thu, 18 Jul 2019 18:55:38 +0100 From: "Leif Lindholm" To: "Gao, Liming" Cc: "devel@edk2.groups.io" , Laszlo Ersek , Rebecca Cran , "Feng, Bob C" , "Kinney, Michael D" , "afish@apple.com" Subject: Re: [edk2-devel] [PATCH 1/1] edksetup.sh: rework python executable scanning Message-ID: <20190718175538.GK2712@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> <20190717223711.GE2712@bivouac.eciton.net> <4A89E2EF3DFEDB4C8BFDE51014F606A14E4AC021@SHSMSX104.ccr.corp.intel.com> MIME-Version: 1.0 In-Reply-To: <4A89E2EF3DFEDB4C8BFDE51014F606A14E4AC021@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 Thu, Jul 18, 2019 at 04:48:18PM +0000, Gao, Liming wrote: > > > 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. > > I agree this is a good point to keep the same build behavior even if user > environment is changed. But, I think user installs new version python, he > may want to use it. Yes. But perhaps the user isn't the admin, and the admin installs a new version of python without updating the default links, in order to let a different user test the new version. Thinking this will not affect users, because python, python2 and python3 all behave exactly like before. > Current edksetup.sh can easily apply the new version python. > Now, the difference is the default policy to choose python version. > Your suggestion is to use default version python interpreter or base > on PATH to find the python interpreter. > Current logic is to find the high version in the available python interpreter. > It is added @d8238aaf862a55eec77040844c71a02c71294e86 commit. Yes, and ideally I would have noticed that and had this conversation back then. But I didn't. Sorry. > Do you meet with the real problem with the high version python interpreter? Not yet. But I can easily see this causing issues with the various docker images we have set up for various (not just TianoCore) CI jobs. > > 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. > > User can set PYTHON_COMMAND to keep the same python interpreter. Yes, but for me, that logic fails the "least amount of surprise" litmus test. If the command invoked when I call 'python' (or 'python2' or 'python3') is the same, then I would expect the same version to be used by the build system. If I *wanted* applications to use the newer version, I would change the 'python' (or 'python2' or 'python3') symlink. > > > > - 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. > > Now, BaseTools has not drop Python2 support. If user wants to use Python2, > he can simply set PYTHON3_ENABLE=FALSE, then he doesn't need to find python path > to set PYTHON_COMMAND env. On Linux, the path is not required for PYTHON_COMMAND. And this is the .sh, so I would hope the same holds true under cygwin. So PYTHON_COMMAND=python2 provides the same functionality as PYTHON3_ENABLE=FALSE. *But* the latest version of my script does not behave in this way, so that still needs to change. > > If PYTHON_COMMAND is set, it should always be respected. If it's not > > set, python3 is picked in preference anyway. > > So, PYTHON_COMMAND is higher priority than PYTHON3_ENABLE. > That means PYTHON3_ENABLE value will be ignored. Right? Exactly. So I think it it not needed. / Leif