Gentoo Archives: gentoo-portage-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH] Use env to find python
Date: Tue, 16 Jun 2020 20:58:07
Message-Id: 5b88b150999c5fe5263fbe0589fbab7d31e80725.camel@gentoo.org
In Reply to: Re: [gentoo-portage-dev] [PATCH] Use env to find python by Mike Gilbert
1 On Tue, 2020-06-16 at 15:19 -0400, Mike Gilbert wrote:
2 > On Tue, Jun 16, 2020 at 1:55 PM Zac Medico <zmedico@g.o> wrote:
3 > > On 6/16/20 10:46 AM, Mike Gilbert wrote:
4 > > > On Tue, Jun 16, 2020 at 1:45 PM Mike Gilbert <floppym@g.o> wrote:
5 > > > > On Mon, Jun 15, 2020 at 9:39 AM Sid Spry <sid@××××.us> wrote:
6 > > > > > On Mon, Jun 15, 2020, at 2:36 AM, Ulrich Mueller wrote:
7 > > > > > > But we know that it is in /usr/bin, so why add yet another indirection?
8 > > > > > >
9 > > > > > > Attachments:
10 > > > > > > * signature.asc
11 > > > > >
12 > > > > > Ah, sorry -- I forgot to note this here. If you wish to support prefix it is possible it may not be in /usr/bin. Granted I am not sure if the prefix stage3 I was using is old enough to be broken in some way, but adding this would prevent future breakage.
13 > > > >
14 > > > > The portage ebuild and the python distutils module already take care
15 > > > > of updating shebangs at install time.
16 > > >
17 > > > I suppose your patch might be useful if you are trying to run portage
18 > > > from a git checkout on a prefix system.
19 > > >
20 > >
21 > > So, given that the ebuild updates shebangs automatically, should't we
22 > > optimize the default shebangs to be as flexible as possible?
23 >
24 > Yes, that makes sense.
25 >
26 > However, we should test to make sure that distutils is smart enough to
27 > parse that "/usr/bin/env -S python" string and replace it with
28 > version-specific python shebang.
29 >
30
31 '/usr/bin/env python' (with no extra options) is the portable shebang.
32
33 --
34 Best regards,
35 Michał Górny

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies