Boost logo

Boost :

From: Christian Mazakas (christian.mazakas_at_[hidden])
Date: 2025-05-06 14:29:25


On Tue, May 6, 2025 at 12:52 AM Artyom Beilis via Boost <
boost_at_[hidden]> wrote:

> > . I am proposing to replace b2.
>
> While I can agree that b2 isn't particularly good build system by any
> stretch of imagination
>
> There was a long and yet incomplete effort of moving to CMake that most
> around
> there are familiar with. CMake works very well and is very well
> supported all around.
>
> Replacing one not-so-good homebrew system that was at least polished
> with yet another homebrew system is a horrible idea.
>
> Boost needs _less_ of "non-invented-here-syndrome": not _more_ of it
>

This actually seems like a fantastic time to shill this Python script I've
been working on.

It lives here: https://github.com/cmazakas/boost/blob/c2py/c2.py

This is intended to be a full drop-in replacement for b2.

Right now, it only works on Linux but that's because I want a quality
implementation before I work on a cross-platform solution. I'm actually
chatting with one of the CMake devs on slack about how to alter the
generation of the Ninja files. I might just manually patch them myself in
the interim though.

You can invoke it similarly to b2 today:

    ./c2.py \
      hash2 test \
      --cxxstd 11,20 \
      --variant debug,release \
      --address-model 64 \
      --toolset clang-19,gcc-14 \
      --asan --ubsan \
      --ctestflags="--output-on-failure -R 'xxh3'" \
      --no-cmake \
      -j20

What this tool does is, it generates a series of CMake build directories
under `build_c2py`, configuring each project in parallel and then builds
the tests in parallel using recursive Make invocations. It's not as fast as
b2 is but because it uses CMake, it really, really opens up the door for
us. I've been thinking about looking for beta testers. I use this script
daily to drive my work with the Alliance.

The script is woefully incomplete but I think it's a good first step.

- Christian


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk