Skip to content

Commit 1fae7ce

Browse files
rahlkclaude
andcommitted
ci: cross-build macOS x86_64 wheel on Apple Silicon; drop Windows
GitHub retired the Intel macos-13 hosted runners, so the macos-x86_64 leg sat queued forever and hung the whole release run. Rebuild it on a macos-14 (Apple Silicon) runner: install an x86_64 GraalVM and run native-image under Rosetta 2, which emits an x86_64 binary and x86_64 jmods (native-image has no true cross-target). Drop the Windows wheel entirely. Its build also failed (hatch_build.py looked for 'codeanalyzer' but GraalVM emits 'codeanalyzer.exe' on Windows), and Windows native-image support isn't worth maintaining here. Removes the windows matrix leg, the MSVC setup step, and the now-unused .exe binary fallback. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 07778c8 commit 1fae7ce

1 file changed

Lines changed: 42 additions & 18 deletions

File tree

.github/workflows/release-pypi.yml

Lines changed: 42 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -88,24 +88,24 @@ jobs:
8888
musl: true
8989
experimental: true
9090
# ---- macOS --------------------------------------------------------
91+
# GitHub retired the Intel (macos-13) hosted runners, so the x86_64
92+
# wheel is cross-built on Apple Silicon: we install an x86_64 GraalVM
93+
# and run native-image under Rosetta 2, which emits an x86_64 binary
94+
# and x86_64 jmods. (GraalVM native-image has no true cross-target.)
9195
- name: macos-x86_64
92-
runs-on: macos-13
96+
runs-on: macos-14
9397
arch: x64
98+
graal_arch: macos-x64
9499
wheel_platform: macosx_11_0_x86_64
95100
macos_target: "11.0"
96101
musl: false
102+
rosetta: true
97103
- name: macos-arm64
98104
runs-on: macos-14
99105
arch: arm64
100106
wheel_platform: macosx_11_0_arm64
101107
macos_target: "11.0"
102108
musl: false
103-
# ---- Windows ------------------------------------------------------
104-
- name: windows-x86_64
105-
runs-on: windows-2022
106-
arch: x64
107-
wheel_platform: win_amd64
108-
musl: false
109109

110110
steps:
111111
- name: Check out code
@@ -138,20 +138,40 @@ jobs:
138138
echo "JAVA_HOME=/opt/graalvm" >> "$GITHUB_ENV"
139139
echo "/opt/graalvm/bin" >> "$GITHUB_PATH"
140140
141-
- name: Set up GraalVM (macOS / Windows)
142-
if: runner.os != 'Linux'
141+
# Native arm64 GraalVM for the macos-arm64 leg. Skipped for the x86_64
142+
# cross-build, which installs an x86_64 GraalVM by hand below.
143+
- name: Set up GraalVM (macOS arm64)
144+
if: runner.os == 'macOS' && matrix.rosetta != true
143145
uses: graalvm/setup-graalvm@v1
144146
with:
145147
java-version: "21"
146148
distribution: graalvm-community
147149
github-token: ${{ secrets.GITHUB_TOKEN }}
148150

149-
- name: Set up MSVC (Windows)
150-
if: runner.os == 'Windows'
151-
uses: ilammy/msvc-dev-cmd@v1
151+
# macOS x86_64 cross-build: Rosetta 2 lets the x86_64 GraalVM (and the
152+
# native-image it drives) run on the Apple Silicon runner.
153+
- name: Install Rosetta 2 (macOS x86_64 cross-build)
154+
if: matrix.rosetta
155+
shell: bash
156+
run: softwareupdate --install-rosetta --agree-to-license
152157

153-
- name: Set up Python (macOS / Windows)
154-
if: runner.os != 'Linux'
158+
- name: Install GraalVM x86_64 (macOS x86_64 cross-build)
159+
if: matrix.rosetta
160+
shell: bash
161+
run: |
162+
set -euo pipefail
163+
url="https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-${GRAALVM_VERSION}/graalvm-community-jdk-${GRAALVM_VERSION}_${{ matrix.graal_arch }}_bin.tar.gz"
164+
echo "Downloading $url"
165+
mkdir -p "$RUNNER_TEMP/graalvm"
166+
# macOS tarballs nest the JDK under <top>/Contents/Home; strip the top.
167+
curl -fsSL "$url" | tar -xz -C "$RUNNER_TEMP/graalvm" --strip-components=1
168+
home="$RUNNER_TEMP/graalvm/Contents/Home"
169+
test -x "$home/bin/native-image" || "$home/bin/gu" install native-image || true
170+
echo "JAVA_HOME=$home" >> "$GITHUB_ENV"
171+
echo "$home/bin" >> "$GITHUB_PATH"
172+
173+
- name: Set up Python (macOS)
174+
if: runner.os == 'macOS'
155175
uses: actions/setup-python@v5
156176
with:
157177
python-version: "3.12"
@@ -169,7 +189,13 @@ jobs:
169189
run: |
170190
set -euo pipefail
171191
chmod +x ./gradlew || true
172-
./gradlew --no-daemon clean nativeCompile
192+
# On the x86_64 leg, run the whole build under Rosetta so the x86_64
193+
# GraalVM (JAVA_HOME) drives native-image and emits an x86_64 binary.
194+
if [ "${{ matrix.rosetta }}" = "true" ]; then
195+
arch -x86_64 ./gradlew --no-daemon clean nativeCompile
196+
else
197+
./gradlew --no-daemon clean nativeCompile
198+
fi
173199
174200
- name: Build wheel
175201
shell: bash
@@ -183,9 +209,7 @@ jobs:
183209
else
184210
PY=python3
185211
fi
186-
BIN="$PWD/build/native/nativeCompile/codeanalyzer"
187-
[ -f "$BIN" ] || BIN="$PWD/build/native/nativeCompile/codeanalyzer.exe"
188-
export CODEANALYZER_NATIVE_BINARY="$BIN"
212+
export CODEANALYZER_NATIVE_BINARY="$PWD/build/native/nativeCompile/codeanalyzer"
189213
export CODEANALYZER_JMODS_DIR="$JAVA_HOME/jmods"
190214
echo "binary: $CODEANALYZER_NATIVE_BINARY"
191215
echo "jmods: $CODEANALYZER_JMODS_DIR"

0 commit comments

Comments
 (0)