Fix ARC workspace inheritance crash and native Zig helper builds (#2283)

* Fix ARC workspace inheritance crash and native Zig helper builds

* Fix Nightly Cmd+N workspace creation crash

* Restore safe terminal config snapshots for Intel Nightly
This commit is contained in:
Austin Wang 2026-03-28 03:05:00 -07:00 committed by GitHub
parent f0c3ccc314
commit c4bc18d906
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 265 additions and 213 deletions

View file

@ -78,6 +78,16 @@ if [[ -n "$TARGET_TRIPLE" ]]; then
exit 1
;;
esac
# When the requested target matches zig's native output arch, drop -Dtarget
# so zig uses native compilation. This avoids cross-linker issues on newer
# SDKs (e.g., macOS Tahoe + zig 0.15.x). Note: zig may run under Rosetta,
# so we detect native output arch from the zig binary itself, not uname -m.
ZIG_ARCH="$(file "$(command -v zig)" 2>/dev/null | grep -oE '(arm64|x86_64)' | head -1)"
case "$TARGET_TRIPLE" in
aarch64-macos) [[ "$ZIG_ARCH" == "arm64" ]] && TARGET_TRIPLE="" ;;
x86_64-macos) [[ "$ZIG_ARCH" == "x86_64" ]] && TARGET_TRIPLE="" ;;
esac
fi
if ! command -v zig >/dev/null 2>&1; then
@ -122,8 +132,18 @@ mkdir -p "$(dirname "$OUTPUT_PATH")"
if [[ "$UNIVERSAL" == "true" ]]; then
ARM64_PREFIX="$TMP_DIR/arm64"
X86_PREFIX="$TMP_DIR/x86_64"
build_helper "$ARM64_PREFIX" "aarch64-macos"
build_helper "$X86_PREFIX" "x86_64-macos"
ZIG_ARCH="$(file "$(command -v zig)" 2>/dev/null | grep -oE '(arm64|x86_64)' | head -1)"
# Use native compilation for the matching arch to avoid cross-linker issues
if [[ "$ZIG_ARCH" == "arm64" ]]; then
build_helper "$ARM64_PREFIX" ""
build_helper "$X86_PREFIX" "x86_64-macos"
elif [[ "$ZIG_ARCH" == "x86_64" ]]; then
build_helper "$ARM64_PREFIX" "aarch64-macos"
build_helper "$X86_PREFIX" ""
else
build_helper "$ARM64_PREFIX" "aarch64-macos"
build_helper "$X86_PREFIX" "x86_64-macos"
fi
/usr/bin/lipo -create \
"$ARM64_PREFIX/bin/ghostty" \
"$X86_PREFIX/bin/ghostty" \