[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180206093450.GB31558@kroah.com>
Date: Tue, 6 Feb 2018 01:34:50 -0800
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Masahiro Yamada <yamada.masahiro@...ionext.com>
Cc: linux-kbuild@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
Nicolas Pitre <nicolas.pitre@...aro.org>,
"Luis R . Rodriguez" <mcgrof@...e.com>,
Randy Dunlap <rdunlap@...radead.org>,
Ulf Magnusson <ulfalizer@...il.com>,
Sam Ravnborg <sam@...nborg.org>,
Michal Marek <michal.lkml@...kovi.net>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Tony Luck <tony.luck@...el.com>, linux-ia64@...r.kernel.org,
linux-kernel@...r.kernel.org, Fenghua Yu <fenghua.yu@...el.com>
Subject: Re: [PATCH 06/14] kbuild: define PYTHON2 and PYTHON3 variables
instead of PYTHON
On Tue, Feb 06, 2018 at 09:34:46AM +0900, Masahiro Yamada wrote:
> The variable 'PYTHON' allows users to specify a proper executable
> name in case the default 'python' does not work. However, this does
> not address the case where both Python 2 and Python 3 scripts are
> used in one system.
>
> PEP 394 (https://www.python.org/dev/peps/pep-0394/) provides a
> convention for Python scripts portability. Here is a quotation:
>
> In order to tolerate differences across platforms, all new code
> that needs to invoke the Python interpreter should not specify
> 'python', but rather should specify either 'python2' or 'python3'.
> This distinction should be made in shebangs, when invoking from a
> shell script, when invoking via the system() call, or when invoking
> in any other context.
>
> arch/ia64/scripts/unwcheck.py is apparently written in Python 2, so
> it should be invoked by 'python2'.
>
> It is legitimate to use 'python' for scripts compatible with both
> Python 2 and Python 3, but this is rare (at least I do not see the
> case in kernel tree). You do not need to make efforts to write your
> scripts in that way. Anyway, Python 2 will retire in 2020.
>
> This commit is needed for my new scripts written in Python 3.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@...ionext.com>
> ---
>
> Makefile | 5 +++--
> arch/ia64/Makefile | 2 +-
> 2 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 11aff0f..c4e935c 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -384,7 +384,8 @@ GENKSYMS = scripts/genksyms/genksyms
> INSTALLKERNEL := installkernel
> DEPMOD = /sbin/depmod
> PERL = perl
> -PYTHON = python
> +PYTHON2 = python2
> +PYTHON3 = python3
Is this going to break any systems that were previous setting PYTHON?
I like this change, and feel it is the correct thing to do, but having a
"fallback" might be needed here.
Could you do what the perf makefile does and do something like:
override PYTHON := $(call get-executable-or-default,PYTHON,$(PYTHON2))
or is it really not an issue as only ia64 seems to care about this?
thanks,
greg k-h
Powered by blists - more mailing lists