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