Skip to content

Commit eb8de7d

Browse files
dfa1claude
andauthored
ci: probe glibc linux natives on musl/Alpine (#46)
* ci: probe whether the glibc linux natives load on musl/Alpine Add a non-gating (continue-on-error) musl-probe job for linux-x86_64 and linux-aarch64. The natives are built for the *-linux-gnu ABI, so this checks empirically whether they load on musl rather than guessing. The action steps (checkout, setup-java, Maven fetch, javac) run on the glibc host; only the final `java` runs inside an Alpine/musl JDK container (amazoncorretto:25-alpine), so node-based actions never run under musl. If the probe fails, the fix is to add x86_64-linux-musl / aarch64-linux-musl target triples to build-zstd.sh and ship two more native jars. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * ci: fold the musl probe into the smoke matrix Instead of a separate musl-probe job, add the two Alpine/musl legs to the smoke matrix (container + experimental flags). Steps branch on matrix.container: native legs run via JBang on the host; musl legs fetch+compile on the glibc host then run java inside an Alpine/musl JDK container. continue-on-error is per-leg (matrix.experimental), so the six native legs gate and the two musl probes don't. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 99423dc commit eb8de7d

1 file changed

Lines changed: 39 additions & 4 deletions

File tree

.github/workflows/release-smoke.yml

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,40 +46,75 @@ jobs:
4646
echo "version=$version" >> "$GITHUB_OUTPUT"
4747
4848
smoke:
49-
name: ${{ matrix.classifier }}
49+
name: ${{ matrix.classifier }}${{ matrix.container && ' (musl)' || '' }}
5050
needs: resolve
51+
# musl legs are a probe (glibc natives on Alpine, expected to fail until musl
52+
# natives ship), so they don't gate the workflow; the six native legs do.
53+
continue-on-error: ${{ matrix.experimental || false }}
5154
strategy:
5255
fail-fast: false
5356
matrix:
5457
# distribution is per-leg for clarity and easy override. Zulu ships JDK 25
55-
# for all six targets (incl. Windows/ARM64, which Temurin does not yet) and
56-
# matches publish.yml; change a single leg here if a target needs another.
58+
# for all targets (incl. Windows/ARM64, which Temurin does not yet) and
59+
# matches publish.yml. Legs with `container` run the linux native inside an
60+
# Alpine/musl JDK to probe musl support.
5761
include:
5862
- { os: ubuntu-latest, classifier: linux-x86_64, distribution: zulu }
5963
- { os: ubuntu-24.04-arm, classifier: linux-aarch64, distribution: zulu }
6064
- { os: macos-13, classifier: osx-x86_64, distribution: zulu }
6165
- { os: macos-14, classifier: osx-aarch64, distribution: zulu }
6266
- { os: windows-latest, classifier: windows-x86_64, distribution: zulu }
6367
- { os: windows-11-arm, classifier: windows-aarch64, distribution: zulu }
68+
- { os: ubuntu-latest, classifier: linux-x86_64, distribution: zulu, container: "amazoncorretto:25-alpine", experimental: true }
69+
- { os: ubuntu-24.04-arm, classifier: linux-aarch64, distribution: zulu, container: "amazoncorretto:25-alpine", experimental: true }
6470
runs-on: ${{ matrix.os }}
6571
steps:
6672
- name: Checkout (smoke sources only)
6773
uses: actions/checkout@v4
6874

69-
- name: Set up JDK 25
75+
- name: Set up JDK 25 (host)
7076
uses: actions/setup-java@v4
7177
with:
7278
distribution: ${{ matrix.distribution }}
7379
java-version: '25'
7480

81+
# --- native runner path (glibc / macOS / Windows): run via JBang on the host ---
7582
- name: Set up JBang
83+
if: ${{ !matrix.container }}
7684
uses: jbangdev/setup-jbang@main
7785

7886
- name: Smoke-test ${{ needs.resolve.outputs.version }} on ${{ matrix.classifier }}
87+
if: ${{ !matrix.container }}
7988
shell: bash
8089
env:
8190
VERSION: ${{ needs.resolve.outputs.version }}
8291
run: |
8392
jbang --java 25 \
8493
--deps "io.github.dfa1.zstd:zstd:${VERSION},io.github.dfa1.zstd:zstd-native-${{ matrix.classifier }}:${VERSION}" \
8594
.github/smoke/Smoke.java
95+
96+
# --- musl probe: fetch + compile on the glibc host, run inside an Alpine/musl
97+
# JDK container, so node-based actions never run under musl ---
98+
- name: Fetch released jars and compile the smoke (musl)
99+
if: ${{ matrix.container }}
100+
shell: bash
101+
env:
102+
VERSION: ${{ needs.resolve.outputs.version }}
103+
run: |
104+
mvn -q org.apache.maven.plugins:maven-dependency-plugin:3.8.1:copy \
105+
-Dartifact="io.github.dfa1.zstd:zstd:${VERSION}" \
106+
-DoutputDirectory=libs -Dmdep.stripVersion=true
107+
mvn -q org.apache.maven.plugins:maven-dependency-plugin:3.8.1:copy \
108+
-Dartifact="io.github.dfa1.zstd:zstd-native-${{ matrix.classifier }}:${VERSION}" \
109+
-DoutputDirectory=libs -Dmdep.stripVersion=true
110+
mkdir -p out
111+
javac -cp libs/zstd.jar -d out .github/smoke/Smoke.java
112+
113+
- name: Smoke-test ${{ needs.resolve.outputs.version }} on ${{ matrix.classifier }} (musl/Alpine)
114+
if: ${{ matrix.container }}
115+
shell: bash
116+
run: |
117+
docker run --rm -v "$PWD:/w" -w /w "${{ matrix.container }}" \
118+
java --enable-native-access=ALL-UNNAMED \
119+
-cp "libs/zstd.jar:libs/zstd-native-${{ matrix.classifier }}.jar:out" \
120+
Smoke

0 commit comments

Comments
 (0)