Skip to content

Commit edf2155

Browse files
nodeceCopilot
andauthored
feat: migrate native-io implementation from C to Rust (#4738)
* feat: migrate native-io implementation from C to Rust * fix: use Apache Commons SystemUtils for OS name and architecture retrieval * feat: add support for pure Rust native-io builds with conditional activation * chore: update Rust and Zig toolchain versions * chore: extract native build setup action Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: add shell to native build action Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 6dc5925 commit edf2155

17 files changed

Lines changed: 1185 additions & 542 deletions

File tree

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
20+
name: setup native build
21+
description: sets up Rust, Zig, and cargo-zigbuild for native builds
22+
runs:
23+
using: composite
24+
steps:
25+
- name: Set up Rust
26+
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8
27+
with:
28+
# Cross-compilation targets: Linux amd64 and arm64 (glibc)
29+
targets: >-
30+
x86_64-unknown-linux-gnu,
31+
aarch64-unknown-linux-gnu
32+
33+
- name: Set up Zig
34+
uses: mlugg/setup-zig@d1434d08867e3ee9daa34448df10607b98908d29
35+
36+
- name: Install cargo-zigbuild
37+
run: cargo install --locked cargo-zigbuild
38+
shell: bash

.github/workflows/bk-ci.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ jobs:
8282
distribution: 'temurin'
8383
java-version: 17
8484

85+
- name: Setup native build
86+
if: steps.check_changes.outputs.docs_only != 'true'
87+
uses: ./.github/actions/setup-native-build
88+
8589
- name: Validate pull request
8690
if: steps.check_changes.outputs.docs_only != 'true'
8791
run: |
@@ -161,6 +165,9 @@ jobs:
161165
distribution: 'temurin'
162166
java-version: 17
163167

168+
- name: Setup native build
169+
uses: ./.github/actions/setup-native-build
170+
164171
- name: Tune Java DNS TTL settings
165172
run: |
166173
sudo tee -a $JAVA_HOME/conf/security/java.security <<EOF
@@ -244,6 +251,9 @@ jobs:
244251
distribution: 'temurin'
245252
java-version: 17
246253

254+
- name: Setup native build
255+
uses: ./.github/actions/setup-native-build
256+
247257
- name: Tune Java DNS TTL settings
248258
run: |
249259
sudo tee -a $JAVA_HOME/conf/security/java.security <<EOF
@@ -341,6 +351,9 @@ jobs:
341351
distribution: 'temurin'
342352
java-version: 17
343353

354+
- name: Setup native build
355+
uses: ./.github/actions/setup-native-build
356+
344357
- name: Restore released versions cache
345358
uses: actions/cache/restore@v4
346359
with:
@@ -437,6 +450,9 @@ jobs:
437450
distribution: 'temurin'
438451
java-version: 17
439452

453+
- name: Setup native build
454+
uses: ./.github/actions/setup-native-build
455+
440456
- name: mvn package
441457
run: mvn -B -nsu clean package -DskipTests
442458

@@ -471,6 +487,9 @@ jobs:
471487
distribution: 'temurin'
472488
java-version: 17
473489

490+
- name: Setup native build
491+
uses: ./.github/actions/setup-native-build
492+
474493
- name: mvn package
475494
run: mvn -B -nsu clean package -DskipTests
476495

@@ -514,6 +533,9 @@ jobs:
514533
distribution: 'temurin'
515534
java-version: ${{ matrix.jdk_version }}
516535

536+
- name: Setup native build
537+
uses: ./.github/actions/setup-native-build
538+
517539
- name: Build with Maven
518540
run: mvn clean package -B -nsu -DskipBookKeeperServerTests
519541

.github/workflows/bk-streamstorage-python.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ jobs:
7373
with:
7474
distribution: 'temurin'
7575
java-version: 17
76+
- name: Setup native build
77+
uses: ./.github/actions/setup-native-build
7678
- name: Build
7779
run: mvn -q -T 1C -B -nsu clean install -DskipTests -Dcheckstyle.skip -Dspotbugs.skip -Drat.skip -Dmaven.javadoc.skip
7880
- name: Pick ubuntu mirror for the docker image build
@@ -83,5 +85,3 @@ jobs:
8385
run: ./stream/clients/python/docker/build-local-image.sh
8486
- name: Test
8587
run: ./stream/clients/python/scripts/docker_integration_tests.sh
86-
87-

.github/workflows/codeql.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ jobs:
8585
distribution: 'temurin'
8686
java-version: 17
8787

88+
- name: Setup native build
89+
if: steps.check_changes.outputs.docs_only != 'true'
90+
uses: ./.github/actions/setup-native-build
91+
8892
- name: Validate pull request
8993
if: steps.check_changes.outputs.docs_only != 'true'
9094
run: |

.github/workflows/java21-daily-build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ jobs:
4242
with:
4343
distribution: 'temurin'
4444
java-version: 21
45+
- name: Setup native build
46+
uses: ./.github/actions/setup-native-build
4547
- name: Build with Maven
4648
run: mvn -B clean install
4749
- name: Aggregates all test reports to ./test-reports and ./surefire-reports directories If failure

.github/workflows/windows-daily-build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ jobs:
4343
with:
4444
distribution: 'temurin'
4545
java-version: 21
46+
- name: Setup native build
47+
uses: ./.github/actions/setup-native-build
4648
- name: Build with Maven
4749
run: mvn -B clean install
4850
- name: Aggregates all test reports to ./test-reports and ./surefire-reports directories If failure

0 commit comments

Comments
 (0)