Skip to content

Commit

Permalink
Merge pull request #51 from stepfunc/feature/aarch64
Browse files Browse the repository at this point in the history
Add AArch64 support to Java and .NET.
  • Loading branch information
emgre committed Oct 6, 2021
2 parents 309dc64 + c5bea96 commit 0b3fb9a
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 10 deletions.
64 changes: 61 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
run: cargo-license --avoid-dev-deps --avoid-build-deps -j > ../dependencies.json
- name: Generate dependencies.txt
working-directory: complicense
run: cargo run -- --import ../rodbus/dependencies.json --config ../rodbus/deps-config.json --token ${{ github.token }} > ../rodbus/dependencies.txt
run: cargo run -- --import ../rodbus/dependencies.json --config ../rodbus/deps-config.json --token ${{ github.token }} > ../rodbus/dependencies.txt
- name: Upload dependencies info
uses: actions/upload-artifact@v2
with:
Expand Down Expand Up @@ -194,6 +194,65 @@ jobs:
with:
name: ffi-modules
path: ffi/bindings/java/rodbus/src/main/resources
# Build bindings on Linux AArch64
bindings-aarch64:
needs: lock
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: aarch64-unknown-linux-gnu
override: true
- name: Caching
uses: Swatinem/rust-cache@v1
- name: Download Cargo.lock
uses: actions/download-artifact@v2
with:
name: dependencies
- name: Build
uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target aarch64-unknown-linux-gnu
- name: C bindings
uses: actions-rs/cargo@v1
with:
use-cross: true
command: run
args: --release --target aarch64-unknown-linux-gnu --bin rodbus-bindings -- --c --no-tests
- name: .NET bindings
uses: actions-rs/cargo@v1
with:
use-cross: true
command: run
args: --release --target aarch64-unknown-linux-gnu --bin rodbus-bindings -- --dotnet --no-tests
- name: Java bindings
uses: actions-rs/cargo@v1
with:
use-cross: true
command: run
args: --release --target aarch64-unknown-linux-gnu --bin rodbus-bindings -- --java --no-tests
- name: Upload compiled FFI modules
uses: actions/upload-artifact@v2
with:
name: ffi-modules
path: ffi/bindings/c/generated/aarch64-unknown-linux-gnu/lib
- name: Upload C bindings
uses: actions/upload-artifact@v2
with:
name: c-bindings
path: ffi/bindings/c/generated
- name: Upload compiled Java bindings
uses: actions/upload-artifact@v2
with:
name: ffi-modules
path: ffi/bindings/java/rodbus/src/main/resources
# Cross-compilation for ARM devices and produce C bindings
cross:
needs: lock
Expand All @@ -204,7 +263,6 @@ jobs:
- arm-unknown-linux-gnueabi # ARMv6 Linux (kernel 3.2, glibc 2.17)
- arm-unknown-linux-gnueabihf # ARMv6 Linux, hardfloat (kernel 3.2, glibc 2.17)
- armv7-unknown-linux-gnueabihf # ARMv7 Linux, hardfloat (kernel 3.2, glibc 2.17)
- aarch64-unknown-linux-gnu # ARM64 Linux (kernel 4.2, glibc 2.17+)
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down Expand Up @@ -244,7 +302,7 @@ jobs:
path: ffi/bindings/c/generated
# Package all the generated bindings
packaging:
needs: [lock, bindings, cross]
needs: [lock, bindings, bindings-aarch64, cross]
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
### Next ###
* Add Linux AArch64 support in Java and .NET.
See [#51](https://github.com/stepfunc/rodbus/pull/51).

### 0.9.0 ###
* :tada: First official release
2 changes: 1 addition & 1 deletion ffi/rodbus-bindings/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ repository = "https://github.com/stepfunc/rodbus"
readme = "../README.md"

[dependencies]
ci-script = { git = "https://github.com/grid-io/oo_bindgen.git", tag = "0.1.2" }
ci-script = { git = "https://github.com/stepfunc/oo_bindgen.git", tag = "0.1.3" }
rodbus-schema = { path = "../rodbus-schema" }
rodbus-ffi = { path = "../rodbus-ffi" }
2 changes: 1 addition & 1 deletion ffi/rodbus-ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ num_cpus = "1"

[build-dependencies]
rodbus-schema = { path = "../rodbus-schema" }
rust-oo-bindgen = { git = "https://github.com/grid-io/oo_bindgen.git", tag = "0.1.2" }
rust-oo-bindgen = { git = "https://github.com/stepfunc/oo_bindgen.git", tag = "0.1.3" }
2 changes: 1 addition & 1 deletion ffi/rodbus-schema/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ repository = "https://github.com/stepfunc/rodbus"
readme = "../README.md"

[dependencies]
oo-bindgen = { git = "https://github.com/grid-io/oo_bindgen.git", tag = "0.1.2" }
oo-bindgen = { git = "https://github.com/stepfunc/oo_bindgen.git", tag = "0.1.3" }
rodbus = { path = "../../rodbus" }
7 changes: 3 additions & 4 deletions guide/docs/languages/java.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ slug: /java

import useBaseUrl from '@docusaurus/useBaseUrl';

The Java bindings are distributed as a JAR targeting Java 8. Native libraries for Windows and Linux are embedded in the JAR's `resources` directory. The
The Java bindings are distributed as a JAR targeting Java 8. Native libraries for Windows x64, Linux x64 and Linux AArch64 are embedded in the JAR's `resources` directory. The
correct native library will automatically load during static initialization. These native libraries wrap the underlying C API with a thin layer of
[JNI](https://docs.oracle.com/javase/8/docs/technotes/guides/jni/).

Expand All @@ -25,12 +25,11 @@ Release artifacts are published to Maven central. Add this dependency to incorpo

## Dependencies

In addition to the Rust dependencies, the Java bindings depend on these two open source projects:
In addition to the Rust dependencies, the Java bindings depend on this open source project:

* [joou-java-6](https://github.com/jOOQ/jOOU) - Apache 2.0 - Java Object Oriented Unsigned (JOOU) integer classes
* [commons-lang3](https://github.com/apache/commons-lang) - Apache 2.0 - Java utility classes

These libraries are not distributed by Step Function I/O directly. They are only declared as a dependency for the package manager to retrieve.
This library is not distributed by Step Function I/O directly. It is only declared as a dependency for the package manager to retrieve.

## Unsigned Integers

Expand Down

0 comments on commit 0b3fb9a

Please sign in to comment.