Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ jobs:
git submodule add https://github.com/nervosnetwork/ckb-c-stdlib deps/ckb-c-stdlib &&
git submodule add https://github.com/xxuejie/lib-dummy-atomics deps/lib-dummy-atomics
- name: Lock Rust version
run: cd test-workspace && echo "1.81.0" > rust-toolchain
- name: Install riscv64 target
run: cd test-workspace && rustup target add riscv64imac-unknown-none-elf
run: cd test-workspace && echo "1.85.1" > rust-toolchain
- name: Install riscv64 target & clippy
run: cd test-workspace && rustup target add riscv64imac-unknown-none-elf && rustup component add clippy
- name: Run all checks
run: cd test-workspace && make build test check clippy
- name: Reproducible build runs
run: cd test-workspace && ./scripts/reproducible_build_docker --update && ./scripts/reproducible_build_docker --no-clean
- name: Generate standalone contract
run: cargo generate --path . standalone-contract --name test-contract
- name: Lock Rust version
run: cd test-contract && echo "1.81.0" > rust-toolchain
run: cd test-contract && echo "1.85.1" > rust-toolchain
- name: Run all checks
run: cd test-contract && make build test check clippy
- name: Reproducible build runs
Expand Down Expand Up @@ -218,7 +218,7 @@ jobs:

windows-build:

runs-on: windows-2019
runs-on: windows-2022

steps:
- uses: actions/checkout@v3
Expand Down
8 changes: 4 additions & 4 deletions atomics-contract/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ fn main() {
Err(_) => "../..".to_string(),
};

println!("cargo:rerun-if-changed={}/deps/lib-dummy-atomics/atomics.c", top);
println!("cargo:rerun-if-changed={top}/deps/lib-dummy-atomics/atomics.c");

let target_arch = std::env::var("CARGO_CFG_TARGET_ARCH").unwrap();
if target_arch == "riscv64" {
Expand All @@ -14,10 +14,10 @@ fn main() {
"Clang must be used as the compiler!"
);
build
.file(format!("{}/deps/lib-dummy-atomics/atomics.c", top))
.file(format!("{top}/deps/lib-dummy-atomics/atomics.c"))
.static_flag(true)
.include(format!("{}/deps/ckb-c-stdlib", top))
.include(format!("{}/deps/ckb-c-stdlib/libc", top))
.include(format!("{top}/deps/ckb-c-stdlib"))
.include(format!("{top}/deps/ckb-c-stdlib/libc"))
.no_default_flags(true)
.flag("--target=riscv64")
.flag("-march=rv64imc_zba_zbb_zbc_zbs")
Expand Down
4 changes: 2 additions & 2 deletions c-wrapper-crate/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ fn main() {
build
.file("c.c")
.static_flag(true)
.include(format!("{}/deps/ckb-c-stdlib", top))
.include(format!("{}/deps/ckb-c-stdlib/libc", top))
.include(format!("{top}/deps/ckb-c-stdlib"))
.include(format!("{top}/deps/ckb-c-stdlib/libc"))
.no_default_flags(true)
.flag("--target=riscv64")
.flag("-march=rv64imc_zba_zbb_zbc_zbs")
Expand Down
4 changes: 2 additions & 2 deletions standalone-contract/scripts/reproducible_build_docker
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
set -ex

DOCKER="${DOCKER:-docker}"
# docker pull docker.io/cryptape/llvm-n-rust:20250117
DOCKER_IMAGE="${DOCKER_IMAGE:-docker.io/cryptape/llvm-n-rust@sha256:12e7821cb9c7cbc8988d5b1d60bcc87da4cedcf3eea32df1d8833328c5a69f88}"
# docker pull docker.io/cryptape/llvm-n-rust:20250617
DOCKER_IMAGE="${DOCKER_IMAGE:-docker.io/cryptape/llvm-n-rust@sha256:d6d1f9a6656039273210de91913c828f5b4aa4a3282d2c93ed19bcb7bbf728fe}"
CHECKSUM_FILE_PATH="${CHECKSUM_FILE_PATH:-checksums.txt}"

# We are parsing command line arguments based on tips from:
Expand Down
2 changes: 1 addition & 1 deletion standalone-contract/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ pub fn verify_and_dump_failed_tx(
let mock_tx = context.dump_tx(tx).expect("dump failed tx");
let json = serde_json::to_string_pretty(&mock_tx).expect("json");
path.push(format!("0x{:x}.json", tx.hash()));
println!("Failed tx written to {:?}", path);
println!("Failed tx written to {path:?}");
std::fs::write(path, json).expect("write");
}
result
Expand Down
2 changes: 1 addition & 1 deletion standalone-contract/src/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,5 @@ fn test_{{crate_name}}() {
let cycles = context
.verify_tx(&tx, 10_000_000)
.expect("pass verification");
println!("consume cycles: {}", cycles);
println!("consume cycles: {cycles}");
}
4 changes: 2 additions & 2 deletions workspace/scripts/reproducible_build_docker
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
set -ex

DOCKER="${DOCKER:-docker}"
# docker pull docker.io/cryptape/llvm-n-rust:20250117
DOCKER_IMAGE="${DOCKER_IMAGE:-docker.io/cryptape/llvm-n-rust@sha256:12e7821cb9c7cbc8988d5b1d60bcc87da4cedcf3eea32df1d8833328c5a69f88}"
# docker pull docker.io/cryptape/llvm-n-rust:20250617
DOCKER_IMAGE="${DOCKER_IMAGE:-docker.io/cryptape/llvm-n-rust@sha256:d6d1f9a6656039273210de91913c828f5b4aa4a3282d2c93ed19bcb7bbf728fe}"
CHECKSUM_FILE_PATH="${CHECKSUM_FILE_PATH:-checksums.txt}"

# We are parsing command line arguments based on tips from:
Expand Down
4 changes: 2 additions & 2 deletions workspace/tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl Loader {
path.push(name);
let result = fs::read(&path);
if result.is_err() {
panic!("Binary {:?} is missing!", path);
panic!("Binary {path:?} is missing!");
}
result.unwrap().into()
}
Expand All @@ -105,7 +105,7 @@ pub fn verify_and_dump_failed_tx(
let mock_tx = context.dump_tx(tx).expect("dump failed tx");
let json = serde_json::to_string_pretty(&mock_tx).expect("json");
path.push(format!("0x{:x}.json", tx.hash()));
println!("Failed tx written to {:?}", path);
println!("Failed tx written to {path:?}");
std::fs::write(path, json).expect("write");
}
result
Expand Down
2 changes: 1 addition & 1 deletion x64-simulator-crate/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ mod tests {
.unwrap()
.as_nanos() as u64,
};
println!("Seed: {}", seed);
println!("Seed: {seed}");

let mut rng = StdRng::seed_from_u64(seed);
let length = rng.gen_range(0..614400usize);
Expand Down
Loading