From 4cf91c4740565ef53e61cede0db95791ebf27ef8 Mon Sep 17 00:00:00 2001 From: Harry Beckwith Date: Sun, 26 Jul 2026 17:17:31 -0700 Subject: [PATCH] release: build macOS artifacts with a compiler new enough for the code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The first real release run failed on macOS: the runner ships AppleClang 15, which lacks Class Template Argument Deduction for aggregates, and src/util/overloaded.h requires it. Rather than chase whichever Xcode a runner image happens to carry, build with Homebrew's LLVM, which is current everywhere. Apple silicon also moves to macos-15. Also fixes a defect the failure led me to: the console picked its prebuilt architecture from platform.machine(), which reports the *interpreter's* architecture. A Python running under Rosetta on Apple silicon says x86_64, so an M-series Mac would have fetched an Intel node. It now asks the kernel whether the process is translated and answers for the hardware — verified on an M1 Pro, where platform.machine() says x86_64 and the corrected check says arm64. Co-Authored-By: Claude Opus 5 --- .github/workflows/release.yml | 13 +++++++++++-- contrib/vibes/bitcoin-vibes | 16 +++++++++++++++- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 718b588040eb..91986c58386b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,7 +31,7 @@ jobs: fail-fast: false matrix: include: - - os: macos-14 + - os: macos-15 label: macOS (Apple silicon) slug: macos-arm64 - os: macos-13 @@ -43,9 +43,18 @@ jobs: steps: - uses: actions/checkout@v4 + # The Xcode a runner happens to ship is too old for this codebase — + # AppleClang 15 lacks CTAD for aggregates, which src/util/overloaded.h + # requires. Homebrew's LLVM is current on every image, so build with that + # rather than depending on the runner's Xcode vintage. - name: Dependencies (macOS) if: runner.os == 'macOS' - run: brew install cmake ninja boost capnp + run: | + brew install cmake ninja boost capnp llvm + PREFIX=$(brew --prefix llvm) + echo "CC=$PREFIX/bin/clang" >> "$GITHUB_ENV" + echo "CXX=$PREFIX/bin/clang++" >> "$GITHUB_ENV" + "$PREFIX/bin/clang++" --version | head -1 - name: Dependencies (Linux) if: runner.os == 'Linux' diff --git a/contrib/vibes/bitcoin-vibes b/contrib/vibes/bitcoin-vibes index a0e163f7e30b..64e5d8580651 100755 --- a/contrib/vibes/bitcoin-vibes +++ b/contrib/vibes/bitcoin-vibes @@ -1599,6 +1599,20 @@ class Console: ("Darwin", "x86_64"): "macos-x86_64", ("Linux", "x86_64"): "linux-x86_64"} + @staticmethod + def host_machine(): + """The machine's architecture, not the interpreter's. + + A Python built for x86_64 running under Rosetta on Apple silicon reports + x86_64, which would fetch an Intel node for an ARM Mac. Ask the kernel + whether we are translated and answer for the hardware.""" + mach = platform.machine() + if sys.platform == "darwin" and mach == "x86_64": + code, out, _ = run(["sysctl", "-n", "sysctl.proc_translated"], timeout=10) + if code == 0 and out.strip() == "1": + return "arm64" + return mach + def try_prebuilt(self, job): """Fetch a published node, but only one built from this exact commit. @@ -1607,7 +1621,7 @@ class Console: than quietly running the wrong thing.""" if os.environ.get("VIBES_NO_PREBUILT") == "1": return False - slug = self.PREBUILT_SLUGS.get((platform.system(), platform.machine())) + slug = self.PREBUILT_SLUGS.get((platform.system(), self.host_machine())) if not slug: return False _, head, _ = self.git("rev-parse", "HEAD")