Received: from list by lists.gnu.org with archive (Exim 4.71) id 1fcVCS-0004c2-La for mharc-grub-devel@gnu.org; Mon, 09 Jul 2018 08:23:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52427) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcVCO-0004Zc-W4 for grub-devel@gnu.org; Mon, 09 Jul 2018 08:23:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fcVCL-00065G-Q6 for grub-devel@gnu.org; Mon, 09 Jul 2018 08:23:24 -0400 Received: from boksu.net-space.pl ([185.15.1.105]:48878) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_3DES_EDE_CBC_SHA1:24) (Exim 4.71) (envelope-from ) id 1fcVCL-00062G-F7 for grub-devel@gnu.org; Mon, 09 Jul 2018 08:23:21 -0400 Received: (from localhost user: 'dkiper' uid#4000 fake: STDIN (dkiper@boksu.net-space.pl)) by router-fw-old.local.net-space.pl id S1848592AbeGIJZ5 (ORCPT ); Mon, 9 Jul 2018 11:25:57 +0200 Date: Mon, 9 Jul 2018 11:25:47 +0200 From: Daniel Kiper To: Adam Williamson Cc: Daniel Kiper , pjones@redhat.com, grub-devel@gnu.org Subject: Re: Patch: allow the 'python' used to run gentpl.py to be configured Message-ID: <20180709092547.GA6464@router-fw-old.local.net-space.pl> References: <20180706172545.GA14342@router-fw-old.local.net-space.pl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.28i X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 185.15.1.105 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2018 12:23:26 -0000 On Fri, Jul 06, 2018 at 01:19:18PM -0700, Adam Williamson wrote: > On Fri, 2018-07-06 at 19:25 +0200, Daniel Kiper wrote: > > On Wed, Jul 04, 2018 at 10:08:53AM -0700, Adam Williamson wrote: > > > gentpl.py is python2/3-agnostic, but there's no way to cause it > > > to be run with any interpreter other than 'python', it's just > > > hard-coded into Makefile.common that way. Adjust that to allow > > > a make variable PYTHONBIN to be set to the desired interpreter. > > > This will make it easier in situations where we specifically > > > want to build with 'python2' or 'python3' or whatever. > > > > > > Signed-off-by: Adam Williamson > > > > Thanks for the patch. However, I think that the configure should find > > correct python binary and set PYTHON variable (instead of PYTHONBIN) > > in the Makefile (good example is BUILD_CC variable in Makefile.in). > > That's possible, but it depends what you mean by "correct", doesn't it? > There could be many python interpreters installed on a system; which > are we to assume is "correct"? Yep. I think that we should start with python name and if that does not work then look for another common names. > We could make it configurable with some sort of default heuristic, I > guess, I was just going for a simple patch approximately in line with > what was done for autogen.sh for now. (And I wouldn't want to reinvent > python interpreter discovery, which has been invented enough times > already; if we were to go that route it'd probably make sense to use an > existing autoconf extension or something). This is what I was thinking about. Reinventing the wheel does not make sense. > > And there are more references to the python binary in other makefiles > > which should be fixed too. > > I can't find any...could those perhaps be in files generated from the > ones actually in the git repo? I grepped the whole of a clean git > checkout for 'python' and these were all I found, and with this patch > (as mentioned) I can successfully build grub using python3 on a system > with no 'python' executable at all. Ugh... My fault, sorry. It looks that "make distclean" does not work well. It have to be fixed. Daniel