Hello all 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. 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. Main highlights: - 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) - builds in a separate build directory, can have arbitrarily many build dirs with different configurations (for gcc/clang/static analysis/debug/release/etc) - 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) - the file describing the build is 433 lines, most of which look like this: if cc.has_header('io.h') pyconf.set('HAVE_IO_H', 1) endif - implementation of Meson is 100% Python 3, it does not have a dependency on the shell and in fact already works on Windows If you want to try it yourself, here are the steps (only 64 bit Linux tested thus far): - install python3-ply and Ninja (Ubuntu package ninja-build) - get Meson git head: https://sourceforge.net/p/meson/code/ - get Python3 trunk - download and extract the build files into trunk: https://dl.dropboxusercontent.com/u/37517477/python-meson.tar.gz - cd into Python trunk and do the following commands: mkdir build cd build path/to/meson.py .. ninja And there you have it. You can't do much with it, though (except run pgen to ensure that it actually did something ;) ). If you have any questions that are not directly related to Python, feel free to email me or the Meson mailing list. Enjoy,
On Thu, Jun 6, 2013 at 5:21 AM, Jussi Pakkanen <jpakkane@gmail.com> wrote:
- implementation of Meson is 100% Python 3, it does not have a dependency on the shell and in fact already works on Windows
Since you're talking about a bootstrap requirement here, the obvious question is: What version of Python 3 does it require? Will it be a lot of hassle to get hold of (say) Python 3.2, only to uninstall it when you have your 3.4 built? ChrisA
On Wed, Jun 5, 2013 at 10:37 PM, Chris Angelico <rosuav@gmail.com> wrote:
Since you're talking about a bootstrap requirement here, the obvious question is: What version of Python 3 does it require? Will it be a lot of hassle to get hold of (say) Python 3.2, only to uninstall it when you have your 3.4 built?
The implementation does not use deep Python magic such as C extensions or the like so it should work with future releases of Python. The current version requires 3.3 or newer but only because it uses a couple of pythonlib functions that were added at 3.3. Changing it to work with 3.2 or earlier should not be a big task.
On Thu, Jun 6, 2013 at 6:00 AM, Jussi Pakkanen <jpakkane@gmail.com> wrote:
On Wed, Jun 5, 2013 at 10:37 PM, Chris Angelico <rosuav@gmail.com> wrote:
Since you're talking about a bootstrap requirement here, the obvious question is: What version of Python 3 does it require? Will it be a lot of hassle to get hold of (say) Python 3.2, only to uninstall it when you have your 3.4 built?
The implementation does not use deep Python magic such as C extensions or the like so it should work with future releases of Python. The current version requires 3.3 or newer but only because it uses a couple of pythonlib functions that were added at 3.3. Changing it to work with 3.2 or earlier should not be a big task.
Newer versions shouldn't be a problem, older ones will. I'm mainly thinking about systems that can't just casually apt-get a Python 3.3. With Ubuntu, most people probably don't even need to worry about building from source, as there'll be a decently-recent Python in the repo; but what happens when you're on Debian Squeeze and the only Python 3 you can get is 3.1.3? Even Wheezy (the current stable Debian) comes with only 3.2. I do like the symmetry of using Python to build Python. But I also like using Python 3.3+ for everything, and not having to support the older Pythons. Unfortunately those two capacities clash, my lords, they clash! ChrisA
What's the advantage in writing a new build tool? I'm asking this because I'm doing the same using scons: https://bitbucket.org/cavallo71/fatpython At the moment I'm very interested into this problem: the main advantages I see so far are (in scons) are node dependencies and the fact it is plain python syntax. Thanks On 5 Jun 2013, at 20:21, Jussi Pakkanen <jpakkane@gmail.com> wrote:
Hello all
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.
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.
Main highlights:
- 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)
- builds in a separate build directory, can have arbitrarily many build dirs with different configurations (for gcc/clang/static analysis/debug/release/etc)
- 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)
- the file describing the build is 433 lines, most of which look like this:
if cc.has_header('io.h') pyconf.set('HAVE_IO_H', 1) endif
- implementation of Meson is 100% Python 3, it does not have a dependency on the shell and in fact already works on Windows
If you want to try it yourself, here are the steps (only 64 bit Linux tested thus far):
- install python3-ply and Ninja (Ubuntu package ninja-build) - get Meson git head: https://sourceforge.net/p/meson/code/ - get Python3 trunk - download and extract the build files into trunk: https://dl.dropboxusercontent.com/u/37517477/python-meson.tar.gz - cd into Python trunk and do the following commands:
mkdir build cd build path/to/meson.py .. ninja
And there you have it. You can't do much with it, though (except run pgen to ensure that it actually did something ;) ).
If you have any questions that are not directly related to Python, feel free to email me or the Meson mailing list.
Enjoy,
_______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/a.cavallo%40cavallinux.eu
participants (3)
-
Antonio Cavallo -
Chris Angelico -
Jussi Pakkanen