Skip to content

Commit

Permalink
bindings/java: Link Linux libraries against glibc 2.17 using `cargo-z…
Browse files Browse the repository at this point in the history
…igbuild` (#158)
  • Loading branch information
unexge committed Feb 23, 2024
1 parent 0e05383 commit a8c0588
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions .github/workflows/publish-java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ jobs:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
extension: so
build_cmd: zigbuild
glibc: "2.17"
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
extension: so
build_cmd: zigbuild
glibc: "2.17"
- target: x86_64-apple-darwin
os: macos-latest
extension: dylib
Expand All @@ -38,15 +42,13 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- if: ${{ matrix.target == 'aarch64-unknown-linux-gnu' }}
run: |
sudo apt-get update
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
# Setup for cargo
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
- run: cargo build --release --target ${{ matrix.target }} --manifest-path ./bindings/java/Cargo.toml
- if: ${{ matrix.build_cmd == 'zigbuild' }}
uses: actions/setup-python@v5
with:
python-version: "3.11"
- if: ${{ matrix.build_cmd == 'zigbuild' }}
run: pip install cargo-zigbuild
- run: cargo ${{ matrix.build_cmd || 'build' }} --release --target ${{ matrix.target }}${{ matrix.glibc && format('.{0}', matrix.glibc) || '' }} --manifest-path ./bindings/java/Cargo.toml
- run: mkdir -p native/${{ matrix.target }}
- run: mv target/${{ matrix.target }}/release/*.${{ matrix.extension }} ./native/${{ matrix.target }}/
- uses: actions/upload-artifact@v4
Expand Down

0 comments on commit a8c0588

Please sign in to comment.