Subject: [Boost-build] RFC: Boost.Build Python Prototype
From: Stefan Seefeld (stefan_at_[hidden])
Date: 2016-11-14 14:54:10
A few weeks ago I started to look into a new Python frontend for
Boost.Build. After quite a few nights of exploration, I'm now happy to
present first results:
In https://stefanseefeld.github.io/boost.build/doc/html/index.html I
describe a few examples of how to write build logic with this prototype.
Conceptually this is quite similar to Boost.Build V2 (with a few
noteworthy exceptions mentioned in
Most of the differences are syntactic in nature, as I'm using Python
(Doh!). I'd like to convince you that this is an elegant yet powerful
language to write build logic in. Indeed, I believe that there is a
smooth path from beginner (i.e. the minimum of Python you need to
understand to be able to read and write simple build scripts) to
advanced (the knowledge you need to be able to write Boost.Build
extensions, such as new tools, or new composite targets.), and in fact
that by adopting this frontend will allow Boost.Build to gain a much
wider audience. (I paid particular attention not to let any
domain-specific assumptions slip into the model. For example, while
Boost.Build V2 presents itself as a tool "...to build C++ projects", I
believe it's easy to make it useful to other use-cases, too.
To support this Python interface, I applied a few patches to the C
engine below. (In fact, the major patch consisted in refactoring the
Python module definition into its own .c file.) These changes are
however all fully backward compatible, so it should be possible, if not
easy, to merge these changes into the existing engine and then support
the original Jam and the new Python interfaces at the same time.
I did opt to reconsider the lowest interface (using the "bjam" module),
rather than code that integrates into the existing Python interface, as
this gave me greater flexibility in exploring possible new Boost.Build
foundations. This implies that, to augment the functionality of this new
interface, it's probably not very useful to attempt to translate all the
existing .jam files in Boost.Build. It's far more efficient to rewrite
the equivalent Python code (tools and targets mostly, I believe) from
scratch, once the remaining issues in the general design and
implementation are fleshed out.
The current code is in the "proto" branch in
I'd appreciate any and all feedback,
-- ...ich hab' noch einen Koffer in Berlin...
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk