Merge pull request #9 from zkmopro/bump-version

chore: update Rust toolchain to version 1.89.0 in README and CI confi…
This commit is contained in:
Ya-wen, Jeng 2025-08-15 09:21:20 +08:00 committed by GitHub
commit c6bdffa177
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 120 additions and 109 deletions

View File

@ -1,107 +1,107 @@
name: Build and Test
on:
push:
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
push:
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
env:
CARGO_TERM_COLOR: always
CARGO_TERM_COLOR: always
jobs:
clippy_check:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
env:
RUSTFLAGS: "-Dwarnings" # Make sure CI fails on all warnings, including Clippy lints
steps:
- uses: actions/checkout@v4
- name: Run Clippy
run: cargo clippy --all-targets --all-features
lint:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- uses: actions/checkout@v4
clippy_check:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
env:
RUSTFLAGS: "-Dwarnings" # Make sure CI fails on all warnings, including Clippy lints
steps:
- uses: actions/checkout@v5
- name: Run Clippy
run: cargo clippy --all-targets --all-features
lint:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- uses: actions/checkout@v5
- name: Check formatting
run: cargo fmt --all -- --check
build-ios:
runs-on: macos-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
strategy:
matrix:
target:
- aarch64-apple-ios
- aarch64-apple-ios-sim
- x86_64-apple-ios
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "1.81.0"
targets: ${{ matrix.target }}
- name: Build
run: cargo build --target ${{ matrix.target }}
build-android:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
strategy:
matrix:
target:
- x86_64-linux-android
- aarch64-linux-android
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "1.81.0"
targets: ${{ matrix.target }}
- name: Install Android NDK
run: cargo install cargo-ndk
- name: Build
run: cargo ndk -t ${{ matrix.target }} build
test-linux:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: "1.81.0"
override: true
- name: Run tests
run: cargo test
test-macOS:
runs-on: macos-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: "1.81.0"
override: true
- name: Run tests
run: cargo test
test-macOS-x86_64:
runs-on: macos-13
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: "1.81.0"
override: true
- name: Run tests
run: cargo test
- name: Check formatting
run: cargo fmt --all -- --check
build-ios:
runs-on: macos-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
strategy:
matrix:
target:
- aarch64-apple-ios
- aarch64-apple-ios-sim
- x86_64-apple-ios
steps:
- name: Checkout Repository
uses: actions/checkout@v5
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "1.89.0"
targets: ${{ matrix.target }}
- name: Build
run: cargo build --target ${{ matrix.target }}
build-android:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
strategy:
matrix:
target:
- x86_64-linux-android
- aarch64-linux-android
steps:
- name: Checkout Repository
uses: actions/checkout@v5
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "1.89.0"
targets: ${{ matrix.target }}
- name: Install Android NDK
run: cargo install cargo-ndk
- name: Build
run: cargo ndk -t ${{ matrix.target }} build
test-linux:
runs-on: ubuntu-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- uses: actions/checkout@v5
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: "1.89.0"
override: true
- name: Run tests
run: cargo test
test-macOS:
runs-on: macos-latest
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- uses: actions/checkout@v5
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: "1.89.0"
override: true
- name: Run tests
run: cargo test
test-macOS-x86_64:
runs-on: macos-13
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name
steps:
- uses: actions/checkout@v5
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: "1.89.0"
override: true
- name: Run tests
run: cargo test

10
Cargo.lock generated
View File

@ -25,6 +25,15 @@ dependencies = [
"shlex",
]
[[package]]
name = "chkstk_stub"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "047f6ab2f3b9bcaf23b593d1580898e4244d27eadf1a1fae99212ee5735d3d1c"
dependencies = [
"cc",
]
[[package]]
name = "fnv"
version = "1.0.7"
@ -86,6 +95,7 @@ version = "0.1.1"
dependencies = [
"anyhow",
"cc",
"chkstk_stub",
"num-bigint",
"num-traits",
]

View File

@ -9,7 +9,7 @@ This project provides a Rust adapter for compiling and linking [Rapidsnark](http
### Rust toolchain
```
cargo 1.81.0 (2dbb1af80 2024-08-20)
cargo 1.89.0 (c24e10642 2025-06-23)
```
## Usage

View File

@ -17,3 +17,4 @@ num-traits = "0.2.19"
[build-dependencies]
cc = "1.0"
chkstk_stub = "0.1"

View File

@ -9,7 +9,7 @@ This project provides a Rust adapter for compiling and linking [Rapidsnark](http
### Rust toolchain
```
cargo 1.81.0 (2dbb1af80 2024-08-20)
cargo 1.89.0 (c24e10642 2025-06-23)
```
## Usage

View File

@ -11,6 +11,9 @@ fn main() {
let out_dir = env::var("OUT_DIR").expect("OUT_DIR not set");
let arch = target.split('-').next().unwrap();
// See: https://github.com/zkmopro/chkstk_stub
chkstk_stub::build();
// Try to list contents of the target directory
let rapidsnark_path = Path::new(&out_dir).join(Path::new("rapidsnark"));
// If the rapidsnark repo is not downloaded, download it
@ -22,11 +25,11 @@ fn main() {
.arg(rapidsnark_script_path.to_str().unwrap())
.spawn();
if let Err(e) = child_process {
panic!("Failed to spawn rapidsnark download: {}", e);
panic!("Failed to spawn rapidsnark download: {e}");
}
let status = child_process.unwrap().wait();
if let Err(e) = status {
panic!("Failed to wait for rapidsnark download: {}", e);
panic!("Failed to wait for rapidsnark download: {e}");
} else if !status.unwrap().success() {
panic!("Failed to wait for rapidsnark download");
}
@ -49,7 +52,7 @@ fn main() {
);
println!("cargo:rustc-link-lib=static=rapidsnark");
println!("cargo:rustc-link-lib={}", cpp_stdlib);
println!("cargo:rustc-link-lib={cpp_stdlib}");
if target.contains("android") {
// pthread is included in libc in android
println!("cargo:rustc-link-lib=c");
@ -83,11 +86,10 @@ fn android() {
let lib_path = sysroot_libs_path.join("libc++_shared.so");
assert!(
lib_path.exists(),
"Error: Source file {:?} does not exist",
lib_path
"Error: Source file {lib_path:?} does not exist"
);
let dest_dir = Path::new(&output_path).join(env::var("CARGO_NDK_ANDROID_TARGET").unwrap());
println!("cargo:rerun-if-changed={}", dest_dir.display());
println!("cargo:rerun-if-changed={dest_dir:?}");
if !dest_dir.exists() {
fs::create_dir_all(&dest_dir).unwrap();
}

View File

@ -1,2 +0,0 @@
[toolchain]
channel = "1.81.0"