Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: Jason Zaman <perfinion@g.o>
Cc: gentoo-dev@l.g.o, python@g.o
Subject: Re: [gentoo-dev] [PATCH python-utils-r1 3/4] Ban calling pythonY and pythonY-config when pythonX is used
Date: Sat, 25 Jul 2015 15:47:08
Message-Id: 20150725174638.06b86a60@pomiot
In Reply to: Re: [gentoo-dev] [PATCH python-utils-r1 3/4] Ban calling pythonY and pythonY-config when pythonX is used by Jason Zaman
1 Dnia 2015-07-25, o godz. 22:25:57
2 Jason Zaman <perfinion@g.o> napisał(a):
3
4 > On Sat, Jul 25, 2015 at 12:37:43PM +0200, Michał Górny wrote:
5 > > Ban calling python3{,-config} when python2 is used, and the other way
6 > > around. While this will not prevent configure scripts from finding the
7 > > other Python version, it will cause them to fail eventually trying to
8 > > use it. Currently those attempt were able to pass through thanks to
9 > > python-config providing python{2,3} symlinks.
10 >
11 > you mean eselect providing.
12
13 Yes, you are correct.
14
15 > > ---
16 > > eclass/python-utils-r1.eclass | 6 ++++--
17 > > 1 file changed, 4 insertions(+), 2 deletions(-)
18 > >
19 > > diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
20 > > index 69d3262..2584f3e 100644
21 > > --- a/eclass/python-utils-r1.eclass
22 > > +++ b/eclass/python-utils-r1.eclass
23 > > @@ -847,11 +847,13 @@ python_wrapper_setup() {
24 > > local EPYTHON PYTHON
25 > > python_export "${impl}" EPYTHON PYTHON
26 > >
27 > > - local pyver
28 > > + local pyver pyother
29 > > if python_is_python3; then
30 > > pyver=3
31 > > + pyother=2
32 > > else
33 > > pyver=2
34 > > + pyother=3
35 > > fi
36 > >
37 > > # Python interpreter
38 > > @@ -865,7 +867,7 @@ python_wrapper_setup() {
39 > > cp "${workdir}/bin/python" "${workdir}/bin/python${pyver}" || die
40 > > chmod +x "${workdir}/bin/python" "${workdir}/bin/python${pyver}" || die
41 > >
42 > > - local nonsupp=()
43 > > + local nonsupp=( "python${pyother}" "python${pyother}-config" )
44 >
45 > I have had basically this exact patch locally for a few days since we
46 > talked about it and it hasnt been a problem yet but is not very much
47 > testing. I was wondering if perhaps this should be a qawarn for a while
48 > first instead of banning immediately?
49
50 Well, the problem is that those wrappers are more likely to be called
51 indirectly than directly by ebuilds, so we'd need some hacky magic to
52 pass warnings from within the wrapper to the ebuild. It doesn't really
53 fit the eclass design to receive them afterwards.
54
55 > > # CPython-specific
56 > > if [[ ${EPYTHON} == python* ]]; then
57 > > --
58 > > 2.4.6
59
60 --
61 Best regards,
62 Michał Górny
63 <http://dev.gentoo.org/~mgorny/>