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")