Received: by 10.223.176.5 with SMTP id f5csp449776wra; Tue, 6 Feb 2018 01:35:42 -0800 (PST) X-Google-Smtp-Source: AH8x2240nqg0EQJVEbMzLThr6lSjiy0NTYSqV1QfIPhzhSc+kZhi6f6JJ8S8VNDEtCUvE02KxRdD X-Received: by 10.98.94.71 with SMTP id s68mr1802911pfb.135.1517909741933; Tue, 06 Feb 2018 01:35:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517909741; cv=none; d=google.com; s=arc-20160816; b=ZGEPvsaaKBVdOtxkE6iV5jvhfS3XwcOj141Hr3udagdDzQY37lWpgjDjJU2h1s/a8u IzweN9418ehx2vqvrnwRwzVY5AcNOpBV/A/SP7iKW363mt3aX17LpX6PPr0r8jge5+l5 CP6hdgtuVScI4RQniCp/JCnnbqKM3Vs7/R3rmikoeTEHe1kgn01MA413jdIqWKjcIjBC rJe9T8khkM57eZRffF7SEAlG2yGgo/TLCK8v1yswUyWiAH9nG43YIJVTYDYe07yZ+V+W cN2yMFU0lob3uZ7QisQ6ErORaxwB7HDQHDv6kZSSHZQRT9MXE2YsgAehNgI1yiH4FhEU hyPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=8XjwyIQMBpaD6zOr2bUZ894amqyIgPZIY7BBH7mYOSY=; b=mKiFPY2Jn4fvQkQG+tuFqL2G18RfisY0TLb0Eoig1ebku++44Quvk9BVtVAmgfLEOc Dfe8AcaumTCN0ZUMylMvXw8GGLhToXFATZcW4+LLLBkP4qT4KSXon05GfgAU9jLJ0zSi emPm0r0+mLpG0ZYf7O6FKP4ah5dNhp/PdFxxyPIgi6XZB0qBbszYFAzfaJkgl92EaI3T ah1h1xQdnygHMHKFVqmUD+8tElj4Cdy3Mu/QOJQIHX6J7RuW1vYqVYDGxG8lLB9uYFnM jbEmwZ5gzX7S5NRdlQCQ+zWPC36j4cK9A6yUnPDDjrLPYNXluCAEpdsBcb8Q3MMxJHlg MQyw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p2-v6si1005659pll.733.2018.02.06.01.35.27; Tue, 06 Feb 2018 01:35:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752656AbeBFJe4 (ORCPT + 99 others); Tue, 6 Feb 2018 04:34:56 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:51482 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752183AbeBFJew (ORCPT ); Tue, 6 Feb 2018 04:34:52 -0500 Received: from localhost (unknown [209.136.236.94]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 409A411D3; Tue, 6 Feb 2018 09:34:52 +0000 (UTC) Date: Tue, 6 Feb 2018 01:34:50 -0800 From: Greg Kroah-Hartman To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, Andrew Morton , Nicolas Pitre , "Luis R . Rodriguez" , Randy Dunlap , Ulf Magnusson , Sam Ravnborg , Michal Marek , Linus Torvalds , Tony Luck , linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org, Fenghua Yu Subject: Re: [PATCH 06/14] kbuild: define PYTHON2 and PYTHON3 variables instead of PYTHON Message-ID: <20180206093450.GB31558@kroah.com> References: <1517877294-4826-1-git-send-email-yamada.masahiro@socionext.com> <1517877294-4826-7-git-send-email-yamada.masahiro@socionext.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1517877294-4826-7-git-send-email-yamada.masahiro@socionext.com> User-Agent: Mutt/1.9.3 (2018-01-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > > 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