Boost logo

Boost :

From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2024-05-15 12:21:24


On 5/14/24 08:00, Ted Lyngmo via Boost wrote:
> This didn't look right:
>
> $ git submodule status libs/scope
> -8321450aca6fc6a075225ba225036e585ce1716b libs/scope
>
> I wasn't able to reset the repo and submodules to get the missing
> `libs/scope` module in 1.85 (but going back to 1.84 and building there
> worked).

As others have mentioned, the `--init` argument to `git submodule
update` should initialize the submodules that were introduced since your
last `git submodule init` or `git submodule update --init`.

https://git-scm.com/book/en/v2/Git-Tools-Submodules

If you maintain the same git tree over the course of Boost development,
you should definitely add `--init` to your `git submodule update`
command to ensure any new submodules that are added to the Boost
superproject are properly checked out in your tree.

> I ended up cloning the whole boost repo again with `git clone
> --recurse-submodules ...` and then building worked fine.

The `--recurse-submodules` option automatically initializes submodules
during cloning, similarly to how `--init` would do.

> I've now added
> the `./b2 headers` step which I've never used before and I don't know
> what it's needed for.

`./b2 headers` recreates the unified `boost` directory with links to
headers of every library. This unified tree is required for the building
process. Boost.Build is able to detect header dependencies during the
build process and create those links "on demand", but this doesn't work
reliably, and as of now `./b2 headers` is required for building Boost
with Boost.Build.

Note that if you maintain the same git tree over time, you should do
`./b2 headers` periodically (or before build) so that the links are
updated if new headers in Boost libraries are added or old ones removed.


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