Received: from list by lists.gnu.org with archive (Exim 4.71) id 1fbXCS-0003hc-M3 for mharc-grub-devel@gnu.org; Fri, 06 Jul 2018 16:19:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50578) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fbXCP-0003fT-OI for grub-devel@gnu.org; Fri, 06 Jul 2018 16:19:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fbXCL-0002eO-MU for grub-devel@gnu.org; Fri, 06 Jul 2018 16:19:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62796) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fbXCL-0002dq-H9 for grub-devel@gnu.org; Fri, 06 Jul 2018 16:19:21 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id F2B204E90A; Fri, 6 Jul 2018 20:19:19 +0000 (UTC) Received: from mail.happyassassin.net (ovpn-117-149.phx2.redhat.com [10.3.117.149]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9CD61452B; Fri, 6 Jul 2018 20:19:19 +0000 (UTC) Message-ID: Authentication-Results: mail.happyassassin.net; dmarc=none (p=none dis=none) header.from=redhat.com Subject: Re: Patch: allow the 'python' used to run gentpl.py to be configured From: Adam Williamson To: Daniel Kiper Cc: pjones@redhat.com, grub-devel@gnu.org Date: Fri, 06 Jul 2018 13:19:18 -0700 In-Reply-To: <20180706172545.GA14342@router-fw-old.local.net-space.pl> References: <20180706172545.GA14342@router-fw-old.local.net-space.pl> Organization: Red Hat Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.29.3 (3.29.3-1.fc29) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Fri, 06 Jul 2018 20:19:20 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 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: Fri, 06 Jul 2018 20:19:26 -0000 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"? 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). > 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. -- Adam Williamson Fedora QA Community Monkey IRC: adamw | Twitter: AdamW_Fedora | XMPP: adamw AT happyassassin . net http://www.happyassassin.net