When --cook Boost is used with a versioned compiler (e.g. --compiler clang++-20) and no unversioned clang++/g++ symlink exists on PATH, configure fails during Boost bootstrap:
> clang++ -x c++ -std=c++11 check_cxx11.cpp
./tools/build/src/engine/build.sh: 120: clang++: not found
Cause
cooking_recipe.cmake passes --with-toolset=clang (unversioned) to Boost's bootstrap.sh. bootstrap.sh hardcodes the binary name clang++/g++ for the C++11 capability check it runs while building the B2 engine, and it does not accept --cxx (the flag errors out as unrecognized) nor forward $CXX to build.sh — the relevant line in bootstrap.sh is CXX= CXXFLAGS= "$my_dir/tools/build/src/engine/build.sh" ${TOOLSET}, which scrubs both. The cook_boost.jam user-config the recipe writes does carry the full ${CMAKE_CXX_COMPILER} path, but it's only consumed by the later b2 install step, not by bootstrap.sh.
Verified the same bootstrap.sh shape exists in Boost 1.86 and current master, so this isn't fixed by upgrading Boost — it's a recipe-side gap.
Reproduce
./configure.py --cook fmt --cook GnuTLS --cook Boost --compiler clang++-20 --c++-standard=20
(any setup where the chosen compiler has no unversioned clang++/g++ peer on PATH).
Fix that works
Create a per-project shim directory (e.g. ${CMAKE_CURRENT_BINARY_DIR}/cook_boost_shim/) containing a clang++ or g++ symlink to ${CMAKE_CXX_COMPILER} and prepend it to PATH only for the bootstrap.sh invocation in the Boost ingredient's PATCH_COMMAND. The rest of the build is unaffected. Happy to send a PR.
When
--cook Boostis used with a versioned compiler (e.g.--compiler clang++-20) and no unversionedclang++/g++symlink exists onPATH, configure fails during Boost bootstrap:Cause
cooking_recipe.cmakepasses--with-toolset=clang(unversioned) to Boost'sbootstrap.sh.bootstrap.shhardcodes the binary nameclang++/g++for the C++11 capability check it runs while building the B2 engine, and it does not accept--cxx(the flag errors out as unrecognized) nor forward$CXXtobuild.sh— the relevant line inbootstrap.shisCXX= CXXFLAGS= "$my_dir/tools/build/src/engine/build.sh" ${TOOLSET}, which scrubs both. Thecook_boost.jamuser-config the recipe writes does carry the full${CMAKE_CXX_COMPILER}path, but it's only consumed by the laterb2 installstep, not bybootstrap.sh.Verified the same
bootstrap.shshape exists in Boost 1.86 and current master, so this isn't fixed by upgrading Boost — it's a recipe-side gap.Reproduce
(any setup where the chosen compiler has no unversioned
clang++/g++peer onPATH).Fix that works
Create a per-project shim directory (e.g.
${CMAKE_CURRENT_BINARY_DIR}/cook_boost_shim/) containing aclang++org++symlink to${CMAKE_CXX_COMPILER}and prepend it toPATHonly for thebootstrap.shinvocation in the Boost ingredient'sPATCH_COMMAND. The rest of the build is unaffected. Happy to send a PR.