From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59899) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gM8DC-0002cS-7g for qemu-devel@nongnu.org; Mon, 12 Nov 2018 04:08:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gM8D0-0002cI-GV for qemu-devel@nongnu.org; Mon, 12 Nov 2018 04:08:44 -0500 From: Markus Armbruster References: <20181031003120.26771-1-ehabkost@redhat.com> <20181031003120.26771-12-ehabkost@redhat.com> <20181106141302.GP12503@habkost.net> <87efbxxw1c.fsf@dusky.pond.sub.org> <8ecdbb0e-aaf8-ddc5-6442-87977585d9d8@redhat.com> <87y3a4ot3g.fsf@dusky.pond.sub.org> <8736sboi33.fsf@dusky.pond.sub.org> <1b819b85-b713-379e-735a-65bf7d8d5239@redhat.com> Date: Mon, 12 Nov 2018 10:07:54 +0100 In-Reply-To: <1b819b85-b713-379e-735a-65bf7d8d5239@redhat.com> (Max Reitz's message of "Fri, 9 Nov 2018 18:58:56 +0100") Message-ID: <87d0rafytx.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [Qemu-block] [PATCH] tests: Fix Python 3 detection on older GNU make versions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , Kevin Wolf , Peter Maydell , Fam Zheng , Eduardo Habkost , Qemu-block , Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= , QEMU Developers , Cleber Rosa , Alex =?utf-8?Q?Benn=C3=A9e?= Max Reitz writes: > On 08.11.18 13:43, Markus Armbruster wrote: >> Philippe Mathieu-Daud=C3=A9 writes: >>=20 >>> Hi Markus, >>> >>> >>> Le jeu. 8 nov. 2018 09:46, Markus Armbruster a =C3= =A9crit : >>> >>>> Cleber Rosa writes: >>>> >>>>> On 11/7/18 1:05 AM, Markus Armbruster wrote: >> [...] >>>>>> PEP 394 recommends software distributions install Python 3 into the >>>>>> default path as python3, and users use that instead of python, except >>>>>> for programs that are source compatible with both 2 and 3. So, is >>>>>> finding out whether python is a Python 3 really appropriate? Why ca= n't >>>>>> we just use python3 and be done with it? >>>>>> >>>>> >>>>> I mentioned that before, when you pointed out the issue you fix here, >>>>> that configure may be the best place to get the Python version (not o= nly >>>>> the major version) and make it available elsewhere. Even if not used >>>>> for other purposes, it is IMO important information to show on the >>>>> resulting "configure" output. >>>>> >>>>> I'm sending patches to do that in a few. >>>>> >>>>>> If we can't: isn't this a configure problem? >>>>>> >>>>> >>>>> I believe adhering to PEP394 is a good thing, but even that document >>>>> recognizes that the real world is not a perfect place: "however, end >>>>> users should be aware that python refers to python3 on at least Arch >>>>> Linux". And it only covers *nix systems, so if we hope to care for >>>>> non-*nix systems, we have to check the Python version manually. >>>>> >>>>> So, I guess the safest approach from QEMU's side is to check for the >>>>> version indeed. >>>> >>>> If somebody can point to a system people still use where python3 doesn= 't >>>> get you a Python 3, but python does, catering for such (crappy) systems >>>> in configure makes sense. Until then, it's a waste of brain waves and >>>> configure run time. >>>> >>>> PEP 394 mentions Arch Linux. It's been seven years. What's the most >>>> recent version of Arch Linux that's still crappy in this regard? >>>> >>> >>> Arch doesn't provide python2 by default, thus python points to python3. >>=20 >> That's non-crappy as long as python3 also exists, as PEP 394 recommends. >> Does it? > > Sure it does. > > Arch is just problematic in how it handles "python" itself. I don't > think there is any system that has Python 3 but no "python3". Bottom line: we can safely assume that a host that has Python 3 provides it as python3. Corollary: * When python3 doesn't exist, checking whether python is Python 3 is futile. * Checking whether python3 really is Python 3 is silly.