The good: With minimal effort and using our existing tools and configurations, I was easily able to bootstrap `b2` and then run `b2` to build stock Boost with the normal `boost` namespace. All of that worked perfectly and without error.
The bad: When I went to do the same thing but with our custom namespace (via bcp), things fell apart. Our existing tooling copies the untouched 1.87.0 source tree into {dir}/_src. {dir}/user-config.jam is configured as follows:
```
constant BOOST_VERSION : mybranchname-1.87.0.a ;
constant MY_PLATFORM : macos15-clang16-arm-d ;
constant MY_LABEL : MYextralLabel ;
constant BOOST_USER_CONFIG : <my_boost/config/user.hpp> ;
using clang : 16 : clang++ : <cxxflags>-fvisibility=hidden <cxxflags>-fvisibility-inlines-hidden ;
```
Within {dir}/_src, I call `bootstrap.sh` and then build `bcp` with:
bc -sBOOST_ROOT={dir}/_src \
--boost-build=tools/build/src \
cxxstd=20 \
-d \
2 \
-j \
2 \
-q \
--prefix={dir}/bcp \
--build-dir={dir}/bcp \
--stagedir={dir}/bcp/stage \
--user-config={dir}/user-config.jam \
--layout=system \
toolset=clang-darwin \
threading=multi \
link=shared \
architecture=arm \
instruction-set=nocona \
address-model=64 \
--without-python \
--disable-icu \
variant=release
tools/bcp
That takes a few minutes to complete and does so without error. Once `bcp` is built, I run it with:
mkdir {dir}/_dst && \
{dir}/bcp/bin/bcp --boost={dir}/_src --namespace=boost_MYextralLabel --namespace-alias Jamroot boost boost-build.jam boostcpp.jam bootstrap.bat bootstrap.sh build status tools [insert_name_of_every_dir_in_libs] {dir}/_dst
That takes a few minutes to complete and does so without error. The contents of {dir}/_dst look as I would expect them to look, with diffs against {dir}/_src reflecting the change in namespace. Once complete, I cd into {dir}/_dst, re-bootstrap, and run `b2` to compile the modified Boost:
b2 -sBOOST_ROOT={dir}/_dst \
--boost-build=tools/build/src \
cxxstd=20 \
-d \
2 \
-j \
2 \
-q \
--prefix={dir} \
--build-dir={dir}/shobj \
--stagedir={dir}/stage \
--user-config={dir}/user-config.jam \
--layout=system \
toolset=clang-darwin \
threading=multi \
link=shared \
architecture=arm \
instruction-set=nocona \
address-model=64 \
--without-python \
--disable-icu \
variant=debug
This fails quickly, here:
...
- native syslog supported : yes [2]
- pthread supports robust mutexes : no [2]
- Boost.Regex is header-only : yes [2]
error: Unable to find file or target named
error: '/boost/align//boost_align'
error: referred to from project at
error: '{dir}/_dst/libs/atomic/build'
make: *** [build] Error 1
I have tried dozens of different things over the past two days and can't remember most of them, but they didn't change the outcome, so I don't supposed they're relevant. The one thing that *did* change the outcome is that, after running `bcp` and before re-bootstrapping in {dir}/_dst, I tried deleting the {dir}/_dst/boost directory. This still failed, but it got slightly further and failed with a different (albeit extremely similar) error:
...
- std_wstreambuf : no [2]
- std_wstreambuf : no [3]
- BOOST_COMP_GNUC >= 4.3.0 : no [2]
- BOOST_COMP_GNUC >= 4.3.0 : no [4]
error: Unable to find file or target named
error: 'libs/thread/build//boost_MYextralLabel_thread'
error: referred to from project at
error: '.'
make: *** [build] Error 1
I feel like I've exhausted my ability to discern what the problem is. Other than updating a handful of compiler flags (like changing cxxstd=17 to cxxstd=20), I'm doing this the same way we have (allegedly) always done it, but it's not working anymore and I don't know why.
I would appreciate any guidance you can offer.
Thank you,
Nick