<div dir="ltr">Hello all<div><br></div><div style>I'd like to start this email by saying this is not a proposal to change Python's build system. This is just the results of some experimentation you might be interested it.</div>
<div style><br></div><div style>I have been working on a cross-platform build system called Meson, which is implemented in Python 3. For symmetry I wanted to see if it could be used to build Python itself. After about an evening worth of work, I got the basic C parts (that is, the build targets in the main Makefile such as core Python, pgen etc) built.</div>
<div style><br></div><div style>Main highlights:</div><div style><br></div><div style>- pyconfig.h generation in a fully cross-platform way without Autoconf (not tested with Visual Studio but should work as Meson has unit tests for this, tests for functions in header files and some others not done)</div>
<div style><br></div><div style>- builds in a separate build directory, can have arbitrarily many build dirs with different configurations (for gcc/clang/static analysis/debug/release/etc)</div><div style><br></div><div style>
- configure time 5s, build time 8s on an i5 Macbook running Ubuntu (Autotool-configure takes 37 s but it's not directly comparable because it does a lot more)</div><div style><br></div><div style>- the file describing the build is 433 lines, most of which look like this:</div>
<div style><br></div><div style><div>if cc.has_header('io.h')</div><div>  pyconf.set('HAVE_IO_H', 1)</div><div>endif</div><div><br></div><div style>- implementation of Meson is 100% Python 3, it does not have a dependency on the shell and in fact already works on Windows</div>
<div style><br></div><div style>If you want to try it yourself, here are the steps (only 64 bit Linux tested thus far):</div><div style><br></div><div style>- install python3-ply and Ninja (Ubuntu package ninja-build)</div>
<div style>- get Meson git head: <a href="https://sourceforge.net/p/meson/code/">https://sourceforge.net/p/meson/code/</a></div><div style>- get Python3 trunk</div><div style>- download and extract the build files into trunk:</div>
<div style><a href="https://dl.dropboxusercontent.com/u/37517477/python-meson.tar.gz">https://dl.dropboxusercontent.com/u/37517477/python-meson.tar.gz</a><br></div><div style>- cd into Python trunk and do the following commands:</div>
<div style><br></div><div style>mkdir build</div><div style>cd build</div><div style>path/to/meson.py ..</div><div style>ninja</div><div style><br></div><div style>And there you have it. You can't do much with it, though (except run pgen to ensure that it actually did something ;) ).</div>
<div style><br></div><div style>If you have any questions that are not directly related to Python, feel free to email me or the Meson mailing list.</div><div style><br></div><div style>Enjoy,</div><div style><br></div></div>
</div>