feat(ci): add Rust x86_64-apple-darwin target installation for macOS builds

This commit is contained in:
Ivan 2026-06-03 07:43:32 -05:00
parent cacd1f6424
commit 2f5474a153
No known key found for this signature in database
GPG key ID: B84314E2D9332AE0
3 changed files with 37 additions and 0 deletions

View file

@ -475,6 +475,10 @@ jobs:
exit 1
fi
- name: Install Rust x86_64-apple-darwin target (cbor2 x64 slice)
if: matrix.label == 'macos'
run: bash scripts/ci/github-macos-rust-x64-target.sh
- name: Install project deps into x64 Python (mac universal cx_Freeze)
if: matrix.label == 'macos'
env:

View file

@ -121,6 +121,10 @@ jobs:
set -euo pipefail
arch -x86_64 /usr/local/bin/brew install codec2
- name: Install Rust x86_64-apple-darwin target (cbor2 x64 slice)
if: matrix.label == 'macos'
run: bash scripts/ci/github-macos-rust-x64-target.sh
- name: Install project deps into x64 Python (mac universal cx_Freeze)
if: matrix.label == 'macos'
env:

View file

@ -0,0 +1,29 @@
#!/usr/bin/env bash
# Rust cross-target for x86_64 macOS wheels built on Apple Silicon CI runners.
set -euo pipefail
if [[ "$(uname -s)" != "Darwin" ]]; then
exit 0
fi
if ! command -v rustup >/dev/null 2>&1; then
echo "Installing rustup (minimal stable) for macOS x86_64 cross-builds." >&2
curl -sSfL https://sh.rustup.rs -o /tmp/rustup-init.sh
sh /tmp/rustup-init.sh -y --profile minimal --default-toolchain stable
rm -f /tmp/rustup-init.sh
fi
if [[ -d "${HOME}/.cargo/bin" ]]; then
if [[ -n "${GITHUB_PATH:-}" ]]; then
echo "${HOME}/.cargo/bin" >> "${GITHUB_PATH}"
else
export PATH="${HOME}/.cargo/bin:${PATH}"
fi
fi
if [[ -f "${HOME}/.cargo/env" ]]; then
# shellcheck disable=SC1091
source "${HOME}/.cargo/env"
fi
rustup target add x86_64-apple-darwin
rustup show