ab23cc7f
fix: make install on a Mac names the native target, which is the only one that builds
a73x 2026-09-04 10:16
Commit message
Makefile
| Old | New | ||
|---|---|---|---|
| @@ -6,10 +6,19 @@ ZIG ?= $(CURDIR)/deps/zig/zig | |||
| 6 | # deps/mac-sdk.sh). The shim dir goes FIRST on PATH for every recipe here, | 6 | # deps/mac-sdk.sh). The shim dir goes FIRST on PATH for every recipe here, |
| 7 | # and `mac-sdk` builds it; both are no-ops on Linux and on a Mac whose SDK | 7 | # and `mac-sdk` builds it; both are no-ops on Linux and on a Mac whose SDK |
| 8 | # is linkable. MUX_TARGET follows the host: a Mac installs a Mac binary. | 8 | # is linkable. MUX_TARGET follows the host: a Mac installs a Mac binary. |
| 9 | # | ||
| 10 | # `native` and NOT `aarch64-macos`, which names the same machine and does | ||
| 11 | # not build. zig 0.15.2 looks for the macOS SDK — by running `xcrun | ||
| 12 | # --show-sdk-path`, which is exactly what the shim above answers — only for | ||
| 13 | # a NATIVE target; an explicitly named one is a cross-compile and gets no | ||
| 14 | # system include path at all, so `@cImport` of <util.h> (forkpty's header, | ||
| 15 | # which lives in the SDK) fails with "file not found" and `make install` on | ||
| 16 | # a Mac cannot produce a binary. Found by test/xos.sh, which is the first | ||
| 17 | # thing in the tree to run `make install` on Darwin. | ||
| 9 | UNAME_S := $(shell uname -s) | 18 | UNAME_S := $(shell uname -s) |
| 10 | ifeq ($(UNAME_S),Darwin) | 19 | ifeq ($(UNAME_S),Darwin) |
| 11 | export PATH := $(CURDIR)/deps/mac-sdk/bin:/opt/homebrew/bin:$(PATH) | 20 | export PATH := $(CURDIR)/deps/mac-sdk/bin:/opt/homebrew/bin:$(PATH) |
| 12 | MUX_TARGET ?= aarch64-macos | 21 | MUX_TARGET ?= native |
| 13 | endif | 22 | endif |
| 14 | MUX_TARGET ?= x86_64-linux-musl | 23 | MUX_TARGET ?= x86_64-linux-musl |
| 15 | 24 | ||
test/xos.sh
| Old | New | ||
|---|---|---|---|
| @@ -207,8 +207,14 @@ ok push "$MAC:$REPO on $BRANCH at $(git rev-parse --short HEAD), pushed=$PUSHED" | |||
| 207 | # handoff's appended PATH finds it. The shim PATH is required for the link | 207 | # handoff's appended PATH finds it. The shim PATH is required for the link |
| 208 | # and Homebrew is not on a non-interactive PATH, so both are spelled here. | 208 | # and Homebrew is not on a non-interactive PATH, so both are spelled here. |
| 209 | leg | 209 | leg |
| 210 | # XDG_CACHE_HOME back to the Mac's own for these two: zig's GLOBAL package | ||
| 211 | # cache lives under it, and building into a fresh one re-fetches ghostty and | ||
| 212 | # the rest of the package set on every run — minutes, for isolation this leg | ||
| 213 | # does not need. What the prelude isolates is mux's own cache directory, and | ||
| 214 | # no mux runs here. | ||
| 210 | BOUT=$(mssh 2400 <<H | 215 | BOUT=$(mssh 2400 <<H |
| 211 | cd \$HOME/$REPO || { echo "RC_BUILD=90"; exit 0; } | 216 | cd \$HOME/$REPO || { echo "RC_BUILD=90"; exit 0; } |
| 217 | unset XDG_CACHE_HOME | ||
| 212 | export PATH=\$HOME/$REPO/deps/mac-sdk/bin:/opt/homebrew/bin:\$PATH | 218 | export PATH=\$HOME/$REPO/deps/mac-sdk/bin:/opt/homebrew/bin:\$PATH |
| 213 | make build >/tmp/xos-build.log 2>&1; echo "RC_BUILD=\$?" | 219 | make build >/tmp/xos-build.log 2>&1; echo "RC_BUILD=\$?" |
| 214 | make install >/tmp/xos-install.log 2>&1; echo "RC_INSTALL=\$?" | 220 | make install >/tmp/xos-install.log 2>&1; echo "RC_INSTALL=\$?" |