Fix/bjam leaking cxx14#1477
Conversation
|
This doesn't show the problematic behaviour mentioned in the issue on my platform, full output until first copy: ➜ boost git:(develop) ✗ ./b2 --with-headers install \
--prefix=/tmp/boost-install-test \
--build-dir=/tmp/boost-build-test
Performing configuration checks
- default address-model : 64-bit [1]
- default architecture : arm [1]
- symlinks supported : yes
error: No best alternative for /Users/tinko/dev/boost/libs/histogram/install-libraries-shared with <abi>aapcs <address-model>64 <architecture>arm <asynch-exceptions>off <binary-format>mach-o <boost.beast.allow-deprecated>on <boost.beast.separate-compilation>on <boost.cobalt.executor>any_io_executor <boost.cobalt.pmr>std <context-impl>fcontext <coverage>off <cxxstd-dialect>iso <cxxstd>11 <debug-symbols>off <exception-handling>on <extern-c-nothrow>off <inlining>full <known-warnings>hide <link>shared <optimization>speed <os>MACOSX <pch>on <preserve-test-targets>on <profiling>off <python-debugging>off <python>3.14 <relevant>target-os <rtti>on <runtime-debugging>off <runtime-link>shared <stdlib>native <strip>off <target-os>darwin <testing.execute>on <threadapi>pthread <threading>multi <toolset-clang:platform>darwin <toolset-clang:version>21 <toolset>clang <variant>release <vectorize>off <visibility>hidden <warnings-as-errors>off <warnings>on <x-deduced-platform>arm_64
no match: <local-visibility>hidden
no match: <local-visibility>hidden <target-os>cygwin
error: No best alternative for /Users/tinko/dev/boost/libs/histogram/install-libraries-shared with <abi>aapcs <address-model>64 <architecture>arm <asynch-exceptions>off <binary-format>mach-o <boost.beast.allow-deprecated>on <boost.beast.separate-compilation>on <boost.cobalt.executor>any_io_executor <boost.cobalt.pmr>std <context-impl>fcontext <coverage>off <cxxstd-dialect>iso <cxxstd>11 <debug-symbols>off <exception-handling>on <extern-c-nothrow>off <inlining>full <known-warnings>hide <link>static <optimization>speed <os>MACOSX <pch>on <preserve-test-targets>on <profiling>off <python-debugging>off <python>3.14 <relevant>target-os <rtti>on <runtime-debugging>off <runtime-link>shared <stdlib>native <strip>off <target-os>darwin <testing.execute>on <threadapi>pthread <threading>multi <toolset-clang:platform>darwin <toolset-clang:version>21 <toolset>clang <variant>release <vectorize>off <visibility>hidden <warnings-as-errors>off <warnings>on <x-deduced-platform>arm_64
no match: <local-visibility>hidden
no match: <local-visibility>hidden <target-os>cygwin
[1] clang-21
Component configuration:
- atomic : not building
- charconv : not building
- chrono : not building
- cobalt : not building
- container : not building
- context : not building
- contract : not building
- coroutine : not building
- date_time : not building
- exception : not building
- fiber : not building
- filesystem : not building
- graph : not building
- graph_parallel : not building
- headers : building
- iostreams : not building
- json : not building
- locale : not building
- log : not building
- math : not building
- mpi : not building
- nowide : not building
- process : not building
- program_options : not building
- python : not building
- random : not building
- regex : not building
- serialization : not building
- stacktrace : not building
- system : not building
- test : not building
- thread : not building
- timer : not building
- type_erasure : not building
- url : not building
- wave : not building
...found 34555 targets...
...updating 18061 targets...
common.copy /tmp/boost-install-test/include/boost/align.hpp |
There was a problem hiding this comment.
Pull request overview
This PR updates Boost.Build (B2) configuration for Boost.Geometry to avoid running C++14 feature checks at the global project level (which affected unrelated builds like --with-headers install), and instead applies the C++14 requirements only to buildable targets. It also ensures buildable targets request C++14 explicitly via <cxxstd>14, and fixes an implicit header dependency by adding a missing standard include.
Changes:
- Removed global
cxx14_constexpr/cxx14_return_type_deductionrequirements frombuild.jam, and moved include path propagation to theboost_geometryalias. - Added
<cxxstd>14plus the C++14 feature checks to the buildable target projects (tests, examples, index, extensions, doc examples). - Added a missing
#include <array>wherestd::arrayis used.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| build.jam | Removes global C++14 feature checks and moves <include>include to the boost_geometry alias usage-requirements to avoid impacting unrelated builds. |
| test/Jamfile | Applies <cxxstd>14 and C++14 feature checks to the test project only. |
| example/Jamfile | Applies <cxxstd>14 and C++14 feature checks to the examples project only. |
| doc/src/examples/Jamfile | Applies <cxxstd>14 and C++14 feature checks to the doc examples project only. |
| index/Jamfile | Applies <cxxstd>14 and C++14 feature checks to the index project only. |
| extensions/Jamfile | Applies <cxxstd>14 and C++14 feature checks to the extensions project only. |
| include/boost/geometry/srs/projections/code.hpp | Adds explicit <array> include required by std::array usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
barendgehrels
left a comment
There was a problem hiding this comment.
Thanks! Looks good to me. I won't test locally (never use b2 anymore).
Also good you have the commit for extensions separately
This PR aims to solve #1460 . The cxx14 requirements are moved from build.jam to the respective buildable targets. Because I lack deeper insight into the B2 conventions in boost, I copied this pattern from boostorg/gil. In addition this PR also sets the target C++ version via 14 for all buildable targets. This fixes the tests not building on my machine without adding a cxx version, probably due to https://github.com/boostorg/boost/blob/2813c94a3eefd1adbf623703f9c4d8e818f5398f/Jamroot#L256 . It's two commits to separate out the change to extensions for release picking.
The added include of array in code.hpp is due to this breaking the CI header target, I suspect because GCC otherwise defaults to a higher C++ version where the include from comes indirectly through some other include chain but of course it should be explicit where it's used anyway so this was an oversight in my original work.