Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: hasufell@g.o
Subject: Re: [gentoo-dev] [RFC] Initial python-r1.eclass & distutils-r1.eclass
Date: Thu, 25 Oct 2012 20:37:55
Message-Id: 20121025223742.57c63adb@pomiocik.lan
In Reply to: Re: [gentoo-dev] [RFC] Initial python-r1.eclass & distutils-r1.eclass by hasufell
1 On Thu, 25 Oct 2012 20:55:37 +0200
2 hasufell <hasufell@g.o> wrote:
3
4 > On 10/25/2012 07:43 PM, Michał Górny wrote:
5 > > On Thu, 25 Oct 2012 18:41:47 +0200 hasufell <hasufell@g.o>
6 > > wrote:
7 > >
8 > >> 1. there is still no way to convert shebangs via python-r1
9 > >
10 > > What conversion do you expect? The docs say it clearly that the
11 > > eclass will be extended on request, so please file a clear request
12 > > what you want with an example use case.
13 >
14 > request: A function that converts the shebang to a version specific
15 > python shebang chosen by me.
16 >
17 > usecase: python scripts installed by a non-distutils build system
18 > which need appropriate shebang conversion (Unless we can fix that in a
19 > different way.)
20
21 That's a fair request. Last thing which I have to think about is
22 whether we want this in python-r1, or a more general shebang replacement
23 function in eutils.
24
25 > >> 2. there are no equivalent functions to the python_get_* stuff
26 > >> which are sometimes necessary for broken build systems or test
27 > >> phases
28 > >
29 > > There is python_export(). I will be happy to extend it / add
30 > > python_get*() wrappers when someone makes a clear list of what is
31 > > needed.
32 > >
33 > > Example use cases will be appreciated again. Good examples will
34 > > make it possible to choose good variable names.
35 >
36 > example:
37 > x11-misc/redshift-1.7-r1
38 >
39 > I'll give more examples as I come across those again. This is much
40 > "afair".
41
42 Sorry, didn't notice the sitedir use.
43
44 > >> 3. there is no equivalent for python_mod_optimize. Having that
45 > >> in distutils-r1 does not suffice for non-distutils packages where
46 > >> I might have to do that stuff manually.
47 > >
48 > > There is a lot of stuff missing for packages which try to install
49 > > Python stuff by hand rather than using proper setup. I will be
50 > > happy to provide more when I know what is actually needed and how
51 > > it will be used.
52 > >
53 >
54 > example:
55 > x11-misc/redshift-1.7-r1
56 >
57 > Again, I'll give more examples as I come across those.
58
59 Err, do you expect the eclass to provide a function to restore
60 the py-compile script you're removing?
61
62 > >> 5. distutils-r1_rename_scripts does not allow to specify a
63 > >> location possibly breaking non-standard locations (e.g. games
64 > >> location)
65 > >
66 > > It's a quick function. Adding additional paths or changing the
67 > > algorithm won't be hard. Just don't expect me to do random stuff
68 > > just because someone may want that someday.
69 > >
70 > > FYI: I've added that mindless games/bin to the paths.
71 >
72 > that games/bin change is not sufficient since the games variables can
73 > be modified by the user and this is supported by the games eclass. So
74 > you have to pass an option to the ebuild developer.
75
76 User can do many stupid things, and some eclasses are just stupid
77 and should be killed with fire. A lot of fire. Passing an option is
78 just inventing a minigun to shot a mosquito.
79
80 I will be happy to fix that whenever someone stumbles around that.
81 If ever. If ever distutils setup.py will actually install anything
82 to /usr/randomlocation/bin which will be actually supposed to be
83 rewritten.
84
85 > >> 8. how would I manually generate implementation-suffixed scripts
86 > >> without distutils-r1?
87 > >
88 > > You would use the function I would introduce when I got the
89 > > request filed and potential discussion done. Most importantly,
90 > > whether there should be a way to call 2to3 on the scripts.
91 > >
92 > > By the way, did you just request two partial features instead of
93 > > requesting a way to manually install Python scripts?
94
95 Ok, looking at redshift, I'm not really sure if we really need or even
96 want to install implementation-suffixed scripts there. That's something
97 to discuss.
98
99 The main reason for implementation-suffixing of scripts is that
100 distutils can mangle the scripts for various implementations (i.e. 2to3
101 them). The side reason is ability to force a particular implementation
102 when no other suitable way is available (which is pretty rare).
103
104 To be honest, redshift doesn't fit either. I doubt anyone will really
105 need to put 'gtk-redshift-python2.6' anywhere, and both scripts will be
106 identical. So it may be just enough or even better just to mangle
107 the script to have 'python2' shebang.
108
109 > >> example: x11-misc/redshift-1.7-r1
110 > >
111 > > Thanks. I will take a look at that package and see what is
112 > > necessary to make it buildable with python-r1.
113 > >
114 > > By the way, do I understand correctly that right now you are
115 > > building stuff for a random Python implementation and removing it
116 > > afterwards? I believe that's something really worth fixing.
117 > >
118 >
119 > That way was chosen to avoid an extensive patch I have already
120 > written. The maintainer of the package did not want to keep that
121 > around through version bumps which is understandable.
122
123 You again fail to see an interim solution which will solve the issue
124 without much trouble, similar to one used for multilib. You let
125 the build system work with the default implementation, then repeat
126 install for remaining implementations.
127
128 Of course, right now it's not supported by python-r1. I will think how
129 to solve it in a simple way.
130
131 --
132 Best regards,
133 Michał Górny

Attachments

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