Skip to content

Commit d62d54d

Browse files
authored
fix: Java builds with GLIBC 2.31+ compatibility (#4331)
Fixes #3744 --------- Signed-off-by: Andrew Duffy <[email protected]>
1 parent 66926a2 commit d62d54d

File tree

2 files changed

+47
-6
lines changed

2 files changed

+47
-6
lines changed

.github/workflows/publish.yml

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
publish-rust:
1212
runs-on: ubuntu-latest
1313
timeout-minutes: 120
14-
needs: [prepare-python, prepare-java]
14+
needs: [prepare-python, prepare-java-macos, prepare-java-linux]
1515
steps:
1616
- uses: actions/checkout@v5
1717
with:
@@ -125,20 +125,45 @@ jobs:
125125
verbose: true
126126
skip-existing: true # Idempotent releases
127127

128-
prepare-java:
128+
prepare-java-macos:
129+
runs-on: "macos-latest"
130+
steps:
131+
- uses: actions/checkout@v5
132+
with:
133+
fetch-depth: 0
134+
- uses: actions/setup-java@v5
135+
with:
136+
distribution: "corretto"
137+
java-version: "17"
138+
- uses: ./.github/actions/setup-rust
139+
- run: cargo build --release --package vortex-jni
140+
- uses: actions/upload-artifact@v4
141+
with:
142+
name: "libvortex_jni_aarch64-apple-darwin.zip"
143+
path: "target/release/libvortex_jni.dylib"
144+
retention-days: 1
145+
if-no-files-found: error
146+
147+
prepare-java-linux:
129148
runs-on: ${{ matrix.target.runs-on }}
149+
container:
150+
image: "ubuntu:20.04"
130151
timeout-minutes: 120
131152
strategy:
132153
fail-fast: false
133154
matrix:
134155
target:
135-
- { os: macos, runs-on: "macos-latest", target: aarch64-apple-darwin }
136156
- { os: ubuntu, runs-on: "ubuntu-24.04-arm", target: aarch64-unknown-linux-gnu }
137-
- { os: ubuntu, runs-on: "ubuntu-latest", target: x86_64-unknown-linux-gnu }
157+
- { os: ubuntu, runs-on: "ubuntu-24.04", target: x86_64-unknown-linux-gnu }
138158
steps:
139159
- uses: actions/checkout@v5
140160
with:
141161
fetch-depth: 0
162+
- run: |
163+
apt update
164+
apt install -y wget curl build-essential
165+
- name: Print GLIBC version
166+
run: ldd --version
142167
- uses: actions/setup-java@v5
143168
with:
144169
distribution: "corretto"
@@ -150,12 +175,12 @@ jobs:
150175
- uses: actions/upload-artifact@v4
151176
with:
152177
name: "libvortex_jni_${{ matrix.target.target }}.zip"
153-
path: "target/release/libvortex_jni.${{ (matrix.target.os == 'macos' && 'dylib') || 'so' }}"
178+
path: "target/release/libvortex_jni.so"
154179
retention-days: 1
155180
if-no-files-found: error
156181

157182
publish-java:
158-
needs: [prepare-java]
183+
needs: [prepare-java-macos, prepare-java-linux]
159184
runs-on: ubuntu-latest
160185
timeout-minutes: 120
161186
env:

docs/api/java/index.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,22 @@ Installation
2323

2424
The Java API can be included in your project using Gradle or Maven. Please refer to the main documentation for detailed installation instructions.
2525

26+
27+
Compatibility
28+
-------------
29+
30+
The Java bindings are supported on the following architectures:
31+
32+
* x86_64 Linux
33+
* ARM64 Linux
34+
* Apple Silicon macOS
35+
36+
They support any Linux distribution with a GLIBC version >= 2.31. This includes
37+
38+
* Amazon Linux 2022 or newer
39+
* Ubuntu 20.04 or newer
40+
41+
2642
Usage Example
2743
-------------
2844

0 commit comments

Comments
 (0)