Skip to content

Commit e90674f

Browse files
committed
CI macOS 27: wrap a bootstrap mcpp that predates the float macro fix
The raw clang steps now build import std on macOS 27 (run 35142520288). The self-host step failed because the bootstrap, 2026.9.16.1, predates the fix. setup-macos-llvm wraps a bootstrap older than 2026.9.17.1 on macOS 27 or later and passes the same two words through CCC_OVERRIDE_OPTIONS; the freshly built binary runs unwrapped, and the wrapper retires with the bootstrap pin.
1 parent 10224fb commit e90674f

2 files changed

Lines changed: 39 additions & 0 deletions

File tree

‎.agents/docs/2026-09-17-655-implementation-plan.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,18 @@ two words. Every release since #234 passed such an element as one argument, so
294294
the syntax gained one exception (SPEC-004 §8 rule 8): an element that begins
295295
with `-D` or `/D` and contains a space is one word, verbatim.
296296

297+
The second macOS 27 run (`10224fb8`) confirmed the fix at the compiler: the raw
298+
clang steps print `C++23 import std works on macOS via xlings LLVM!`. It then
299+
failed where the job builds mcpp with the bootstrap binary, 2026.9.16.1, which
300+
predates the fix and so cannot build its std module on macOS 27. The
301+
`setup-macos-llvm` action wraps a bootstrap older than 2026.9.17.1 on macOS 27
302+
or later: the wrapper passes the same two words to clang through
303+
`CCC_OVERRIDE_OPTIONS` (quiet form, measured on clang 22.1.8: both definitions
304+
arrive exactly and nothing is written to stderr). The binary the job builds
305+
runs unwrapped, so the unit tests, the second self-host build and the e2e suite
306+
measure the engine's own fix; e2e 252 keeps its real old-client leg through the
307+
wrapper. The wrapper retires when the bootstrap pin reaches 2026.9.17.1.
308+
297309
## 8. Residuals
298310

299311
- `ldflags`, `dialect_cxxflags` and `std-module-flags` keep their current

‎.github/actions/setup-macos-llvm/action.yml‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,33 @@ runs:
7575
# `xlings install mcpp` resolved 0.0.105 here on a cold cache — below
7676
# the index floor, which makes every descriptor read return nothing.
7777
MCPP=$(bash "$GITHUB_WORKSPACE/.github/tools/install_pinned_mcpp.sh" "$GITHUB_WORKSPACE")
78+
79+
# A BOOTSTRAP OLDER THAN THE macOS 27 FIX, ON macOS 27, IS WRAPPED.
80+
#
81+
# The 27.0 SDK leaves INFINITY and NAN to <float.h> once modules are on,
82+
# and mcpp states them itself from 2026.9.17.1 (hostflags.cppm,
83+
# apple_float_macro_words). A released mcpp older than that cannot
84+
# build its std module here, so it could not build the source that
85+
# carries the fix. The wrapper hands clang the same two words through
86+
# CCC_OVERRIDE_OPTIONS (a leading `#` keeps clang quiet) for the
87+
# bootstrap binary only; the binary this job builds runs unwrapped, so
88+
# the fix is what every later step measures. It retires itself: once the
89+
# bootstrap pin is 2026.9.17.1 or later, nothing is wrapped.
90+
major=$(sw_vers -productVersion | cut -d. -f1)
91+
boot=$("$MCPP" --version 2>/dev/null | awk '{print $2}')
92+
if [ "$major" -ge 27 ] && [ -n "$boot" ] \
93+
&& [ "$(printf '%s\n' "$boot" 2026.9.17.1 | sort -V | head -1)" = "$boot" ] \
94+
&& [ "$boot" != 2026.9.17.1 ]; then
95+
wrapper="$RUNNER_TEMP/mcpp-bootstrap-macos27"
96+
{
97+
echo '#!/bin/sh'
98+
echo "CCC_OVERRIDE_OPTIONS='# +-DINFINITY=HUGE_VALF +-DNAN=__builtin_nanf(\"0x7fc00000\")' exec \"$MCPP\" \"\$@\""
99+
} > "$wrapper"
100+
chmod +x "$wrapper"
101+
echo "bootstrap mcpp $boot on macOS $major: wrapped ($wrapper)"
102+
cat "$wrapper"
103+
MCPP="$wrapper"
104+
fi
78105
echo "MCPP=$MCPP" >> "$GITHUB_ENV"
79106
echo "XLINGS_BIN=$HOME/.xlings/subos/default/bin/xlings" >> "$GITHUB_ENV"
80107

0 commit comments

Comments
 (0)