Gentoo Archives: gentoo-dev

From: Mike Gilbert <floppym@g.o>
To: Gentoo Dev <gentoo-dev@l.g.o>
Subject: Re: [gentoo-dev] [PATCH 1/3] dev-util/meson: install meson-array script
Date: Thu, 17 Dec 2020 21:09:07
Message-Id: CAJ0EP42K9dkux-qtaCa+EhfKQuj2ipOvQuho7FNDStzq6FF4Sg@mail.gmail.com
In Reply to: Re: [gentoo-dev] [PATCH 1/3] dev-util/meson: install meson-array script by Mike Gilbert
1 On Thu, Dec 17, 2020 at 3:50 PM Mike Gilbert <floppym@g.o> wrote:
2 >
3 > On Thu, Dec 17, 2020 at 3:38 PM William Hubbs <williamh@g.o> wrote:
4 > >
5 > > On Sat, Dec 12, 2020 at 09:22:06PM -0500, Mike Gilbert wrote:
6 > > > On Sat, Dec 12, 2020 at 9:09 PM William Hubbs <williamh@g.o> wrote:
7 > > > >
8 > > > > On Sat, Dec 12, 2020 at 04:25:48PM -0500, Mike Gilbert wrote:
9 > > > > > On Sat, Dec 12, 2020 at 3:48 PM William Hubbs <williamh@g.o> wrote:
10 > > > > > > If both /usr/bin/python and /usr/bin/python3 are going away, the best
11 > > > > > > choice would be to add functionality to python-exec or eselect python to tell us
12 > > > > > > the path to the default python interpretor. Once we know that we call it
13 > > > > > > directly.
14 > > > > >
15 > > > > > I don't think they are "going away". There is a USE flag on
16 > > > > > dev-lang/python-exec that makes them optional, and I think it will be
17 > > > > > forcibly enabled for the foreseeable future.
18 > > > > >
19 > > > > > > Please do not apply this patch to meson; I think we can figure something
20 > > > > > > out that is better.
21 > > > > >
22 > > > > > I think installing a small script to help translate arguments from one
23 > > > > > format to another is a reasonable solution.
24 > > > >
25 > > > > I think we should look at the eclass to see if we can provide functions
26 > > > > that can be used by consumers to handle this.
27 > > >
28 > > > I don't really understand what you mean by this. I am converting one
29 > > > internal bash function into an external script so that its python
30 > > > dependencies can be better defined and managed.
31 > >
32 > > What I mean is, ebuilds should not be calling _meson_env_array at all
33 > > since it is defined and documented as an eclass internal function.
34 > >
35 > > I would like to know more about what the gallium-nine-standalone ebuild
36 > > is doing and why it needs to call a meson.eclass internal function.
37 > >
38 > > On the other hand, if _meson_env_array is meant to be called by ebuilds,
39 > > we need to rename it and improve the documentation for it in the eclass.
40 >
41 > I do not really care about gallium-nine-standalone and its abuse of
42 > the private _meson_env_array function. That's an issue that should be
43 > separate from the change I am proposing. I am only touching the ebuild
44 > because my patch removes the _meson_env_array function and I want to
45 > avoid breaking the ebuild.
46 >
47 > > > > Also, I don't think your script will run if native-symlinks is disabled since in
48 > > > > that setting /usr/bin/python would not exist.
49 > > >
50 > > > python_doscript updates the shebang before installing the script.
51 > >
52 > > Ok, I didn't know python_doscript does this, but couldn't we just
53 > > change line 129 in the eclass to "python3 -c ..."?
54 >
55 > No, that will not help in any way.
56 >
57 > > > > I question the value of the native-symlinks use flag on python-exec
58 > > > > unless there is a way to query the path of the default python
59 > > > > interpretor.
60 > > >
61 > > > Regardless, I don't see how that makes my solution a bad thing. It
62 > > > ensures that the code will be executed by a known/support/tested
63 > > > version of python.
64 > > >
65 > >
66 > > I'm not sure how useful the script is as a command, so I don't think it
67 > > should be installed that way, but I do want to hear more about this,
68 > > both from you and chewi. :-)
69 >
70 > I don't see any reasonable way to make it work otherwise. If you have
71 > no better suggestion, please refrain from further comments.
72
73 I gave it a little more thought, and I suppose we could use "eselect
74 python show" to get a valid python interpreter. I'll put together a
75 patch for that.

Replies