Skip to content

Commit f477573

Browse files
rahlkclaude
andcommitted
ci: fix musl static-PIE link + macOS x86_64 cross-wheel smoke test
Two follow-ups surfaced by the re-tagged v2.3.7 run: - musl native link failed with 'read-only segment has dynamic relocations' on .svm_heap. The musl.cc gcc 11 toolchain defaults to static-PIE, which GraalVM's image heap can't satisfy. Add -H:NativeLinkerOption=-no-pie for the musl build to force a non-PIE static executable. (The earlier musl.cc download fix worked; this is the next error it exposed.) - macOS x86_64 wheel built fine but its smoke test failed: the runner's arm64 Python can't install an x86_64-tagged wheel. Run that leg's smoke test under Rosetta via the universal /usr/bin/python3 so the venv, pip install, and bundled binary are all x86_64. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent c298f5f commit f477573

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

.github/workflows/release-pypi.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,23 @@ jobs:
219219
ls -l "$PWD/dist"
220220
221221
- name: Smoke test wheel
222+
if: matrix.rosetta != true
222223
shell: bash
223224
env:
224225
PYTHON: ${{ runner.os == 'Linux' && '/opt/python/cp312-cp312/bin/python' || 'python3' }}
225226
run: bash .github/scripts/smoke-test.sh dist
226227

228+
# The cross-built x86_64 wheel can't be installed by the runner's arm64
229+
# Python. Run the whole smoke test under Rosetta with the universal
230+
# /usr/bin/python3, so the venv, pip install, and bundled native binary
231+
# all execute as x86_64.
232+
- name: Smoke test wheel (x86_64 via Rosetta)
233+
if: matrix.rosetta
234+
shell: bash
235+
env:
236+
PYTHON: /usr/bin/python3
237+
run: arch -x86_64 bash .github/scripts/smoke-test.sh dist
238+
227239
- name: Checksums (log only)
228240
shell: bash
229241
run: |

build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,12 @@ graalvmNative {
208208
if (System.getenv("CODEANALYZER_NATIVE_MUSL") == "true") {
209209
buildArgs.add("--static")
210210
buildArgs.add("--libc=musl")
211+
// The musl.cc gcc 11 toolchain is built with
212+
// --enable-default-pie/--enable-static-pie, so a plain `-static`
213+
// link produces a static-PIE. The linker then rejects GraalVM's
214+
// image heap ("read-only segment has dynamic relocations" on
215+
// .svm_heap). Force a classic non-PIE static executable.
216+
buildArgs.add("-H:NativeLinkerOption=-no-pie")
211217
}
212218
buildArgs.add("-H:ReflectionConfigurationFiles=$projectDir/src/main/resources/META-INF/native-image-config/reflect-config.json")
213219
buildArgs.add("-H:ResourceConfigurationFiles=$projectDir/src/main/resources/META-INF/native-image-config/resource-config.json")

0 commit comments

Comments
 (0)