Skip to content

Commit 32b5f7c

Browse files
Merge pull request #7230 from cylewitruk-stacks/chore/fix-macos-release-build-maybe
chore(ci): don't build macos as native on intel runners
2 parents b66089b + d4b34ab commit 32b5f7c

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

.github/scripts/build_binaries.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,11 @@ case "${MATRIX_CPU}" in
106106
;;
107107
macos)
108108
info "Installing dependencies for $(hl "macOS arm64") build"
109-
# macOS arm64 — no extra deps, use native CPU
109+
# macOS arm64 — no extra deps; no CPU tuning because the
110+
# job cross-compiles from an Intel runner (`macos-latest-large`),
111+
# so `-C target-cpu=native` would emit x86_64 feature flags
112+
# against the aarch64 backend and fail codegen.
110113
target="aarch64-apple-darwin"
111-
target_cpu="native"
112114
;;
113115
*)
114116
error "Unsupported arch $(hl "${MATRIX_ARCH}") for cpu $(hl "${MATRIX_CPU}")"
@@ -203,10 +205,11 @@ case "${target}" in
203205
}
204206
;;
205207

206-
# macOS aarch64 — native CPU tuning, no cross-linker needed
208+
# macOS aarch64 — cross-compiled from an Intel runner, so no CPU tuning
209+
# and no cross-linker (the Apple toolchain handles aarch64 natively).
207210
aarch64-apple-darwin)
208-
info "Building $(hl "${target}"): ${CMD} ${bins} --target ${target} --config build.rustflags=\"\\\"-C target-cpu=${target_cpu}\\\"\""
209-
${CMD} ${bins} --target "${target}" --config build.rustflags="\"-C target-cpu=${target_cpu}\"" || {
211+
info "Building $(hl "${target}"): ${CMD} ${bins} --target ${target}"
212+
${CMD} ${bins} --target "${target}" || {
210213
error "Build failed for target $(hl "${target}")"
211214
exit 1
212215
}

0 commit comments

Comments
 (0)