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
Add a native build mode so macOS gets tested at all (#10)
Every build these definitions have been through was Linux in Docker, because
test/build can only test via Docker. macOS is the platform this repo exists for
and it has never been built with the current flags — so `test/build native`,
which builds on the host into a throwaway prefix and runs the same post-flight
checks the containers run.
That matters most for the arithmetic assertion. The 2**64 == 0 bug was GCC
exploiting signed-overflow UB at -O3; whether Apple clang does the same was
untested, and untestable. Today's Macs all compute 2**64 correctly because none
of them is at -O3 via CFLAGS — the risk arrives with the next rebuild, not
before it, which is exactly when you want to have already checked.
Opt-in by name. PLATFORMS is untouched, so `test/build all` stays the clean-room
Docker matrix; a native build compiles against whatever the host happens to have
and proves nothing about a fresh machine.
The verify script now takes its prefix from $RUBY_PREFIX rather than hardcoding
/opt/ruby, so both paths run the same assertions — the point of the mode is that
macOS gets these and not a weaker set. test_ruby splits into docker_build and
native_build with the result reporting shared; the docker invocation itself is
unchanged.
Two details worth their comments. ruby-build is resolved once up front and a
missing one is a hard error, never a skip — a native run that can't build is a
failed run. It usually isn't on PATH, since mise invokes its own copy directly,
so mise's cache is consulted too, via `mise cache` rather than a hardcoded
~/.cache/mise: on macOS that cache lives under ~/Library/Caches, and macOS is
the whole point here. Each build also gets its own TMPDIR, because ruby-build
derives both its log path and its build directory from it and these run
concurrently — otherwise a failure tail is some neighbour's log.
Prefixes are removed as soon as they're verified rather than kept. Six Rubies is
several GB and the machines that need this are laptops.
Verified. macOS (M1 Max, Apple clang 21 under Xcode-beta): 6/6, arithmetic
assertions included, so clang does not reproduce the GCC signed-overflow
miscompile. Not a vacuous pass either — a 1.8.7 built there reports CFLAGS
"-O3 -fno-strict-overflow …", CC clang, and 2**64 correct, so the flags really
did reach the compile line. Arch native 6/6, and the Docker matrix still 12/12.
One wrinkle worth knowing: 1.8.7's freshen_automake_config shells out to
`brew install automake` on macOS, so that build inherits whatever state brew is
in. It failed once mid-upgrade with a brew rename error, unrelated to anything
here, and passed on a retry.
0 commit comments