You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(boost-ext.ut): close macOS Clang 20.1.7 SIGSEGV via master's explicit template instantiations
CI on PR #142 showed workspace (linux) and workspace (windows) green, but
workspace (macos) failed with exit 139 (SIGSEGV) immediately at `Running
bin/ut` — the test binary never reached the 'Suite ...' console output.
Root cause: the verbatim v2.3.1 ut.cppm leaves the member templates the
`cfg::runner<reporter_junit<printer>>` dispatches to
(`reporter_junit<>::on<...>`, `test::operator=<>`, `expect<bool>`)
only implicitly instantiable; on Apple-Clang 20.1.7 + `-fmodules` the
implicit path through the module BMI fails to emit them into the consuming
executable, so `cfg` static init calling
`reporter_junit::on(events::run_begin)` →
`std::unordered_map::operator[]("global")` lands in an
un-instantiated slot and segfaults.
Upstream fixed this on `master` AFTER v2.3.1 by appending eight
explicit template instantiations to ut.cppm; reproduce that block
byte-for-byte in our `generated_files` cppm after `#include "ut.hpp"`.
This is the same forward-port shape as marzer.tomlplusplus carrying a
one-line cut from upstream master — once a >2.3.1 release ships it,
switch `sources` to `*/include/boost/ut.cppm` and drop
`generated_files` (this block comes back verbatim).
`export import std;` is KEPT (with the existing `using std::size_t;`
GCC shim): trialed dropping it to mirror nlohmann.json / marzer.tomlplusplus
but GCC 16.1 then surfaces a cascade of `-Wtemplate-body` errors in
ut.hpp:3288 (`std::empty`), :3282 (`call_steps_` member lookup),
:3322 (`literals::operator""_test` using-decl resolution), and more —
GCC's two-phase lookup in the module purview is stricter than Clang's and
genuinely needs the std module to be import-visible.
Local verification, clean state (`rm -rf tests/examples/boost-ext.ut/{target,.mcpp,mcpp.lock,compile_commands.json}`):
* mcpp xpkg parse pkgs/b/boost-ext.ut.lua -> parse OK
* mcpp test -p boost-ext.ut (gcc 16.1.0, x86_64-windows-gnu)
-> 'all tests passed (3 asserts in 2 tests)' / 'test result ok. 1 passed'
* mcpp test -p boost-ext.ut (llvm 22.1.8, x86_64-windows-msvc)
-> 'all tests passed (3 asserts in 2 tests)' / 'test result ok. 1 passed'
Both Windows default toolchains stay green — dev 3 is a no-op redundancy
on GCC / Clang-on-MSVC and a real fix on Clang-on-Darwin; macOS CI result
will be confirmed by the next push to PR #142.
Design notes in .agents/docs/2026-08-02-add-boost-ext-ut-plan.md §2.3 / §2.4 / §6.
0 commit comments