Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
Expand Down
16 changes: 15 additions & 1 deletion contrib/vibes/bitcoin-vibes
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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")
Expand Down
Loading