1 |
On Monday 15 October 2012 04:35:09 Gregory M. Turner wrote: |
2 |
> On 10/14/2012 9:29 PM, Mike Frysinger wrote: |
3 |
> > Python clearly has an amazing community, so I hate to say anything |
4 |
> > negative... but I sometimes wish they would "build" less and "buy" more. |
5 |
> |
6 |
> build systems are hard to get right. python is in the situation where the |
7 |
> setups they care about mostly work and people generally aren't complaining, |
8 |
> but it's more through a hack effort than doing it right which means all the |
9 |
> other cases they haven't considered break horribly. cross-compiling for |
10 |
> example has never worked correctly out of the box. |
11 |
|
12 |
The reasons for Python's awkward build system are probably mostly |
13 |
historical. I'll (unsuccessfully) try to keep this brief, but still: |
14 |
|
15 |
Python is old: Python 1.0.0 was released January 1994, and Python |
16 |
existed before that. I don't know what its build system was like back |
17 |
then, but most systems you might want them to "buy" didn't exist yet. |
18 |
|
19 |
Distutils (the build system for external extension modules as well as |
20 |
chunks of Python's standard library) is still old: it was integrated |
21 |
into Python 1.6 (September 5, 2000). Autoconf 2.13 existed, 2.50 |
22 |
wasn't there yet. Looks like CMake was just turned into a separate |
23 |
project around that time. |
24 |
|
25 |
Python's needs are a little special: you can build extension modules |
26 |
using just Python and a C compiler (and you don't need the C compiler |
27 |
if your code is pure-python). This is important on awkward platforms |
28 |
(currently mostly Windows, but I'm pretty sure there were others |
29 |
similarly awkward). This same Python-powered build system is used to |
30 |
build part of the standard library, for obvious reasons. And there are |
31 |
other build systems that make use of python mainly to be |
32 |
cross-platform (scons and derivatives mostly). |
33 |
|
34 |
It would probably be possible to redo Python's own build system now |
35 |
and end up with something better, but I'm not aware of anyone having |
36 |
seriously attempted this, probably because it's just not quite broken |
37 |
enough to be worth it. The awkwardness of distutils we're somewhat |
38 |
stuck with, although there are efforts to modernize and clean up |
39 |
distutils. I'm not so sure there's anything they could have "bought" |
40 |
to replace Python's own build system, let alone distutils (build |
41 |
systems like automake actually use distutils.sysconfig), without a |
42 |
working time machine (and a rather confusing time loop to allow build |
43 |
systems that currently support python to do so without |
44 |
distutils.sysconfig). |
45 |
|
46 |
-- |
47 |
marienz. |