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
4 changes: 2 additions & 2 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ 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.85.1" > rust-toolchain
run: cd test-workspace && echo "1.92.0" > 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
Expand All @@ -60,7 +60,7 @@ jobs:
- name: Generate standalone contract
run: cargo generate --path . standalone-contract --name test-contract
- name: Lock Rust version
run: cd test-contract && echo "1.85.1" > rust-toolchain
run: cd test-contract && echo "1.92.0" > rust-toolchain
- name: Run all checks
run: cd test-contract && make build test check clippy
- name: Reproducible build runs
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ The templates provided here, use the same conventions as `ckb-native-build-sampl

When using this set of templates, we always recommend to use locally installed native versions of LLVM & Rust to build and test your scripts. However, reproducible build is an important part of CKB scripts, which would require locked versions of LLVM & Rust to work. It might not be an easy task when using locally installed versions of compilers.

For the time being, we have prepared a script that does reproducible build via [a docker container image](https://github.com/cryptape/llvm-n-rust). We do want to mention that docker is not necessarily THE way to do reproducible build, nor is it the best way to do reproducible build. There might well be other ways that are better, such as chroot or Nix. It's just that historically, docker has been used in CKB script's build process, and adding a script leveraging docker here, provides an easy solution into the issue.
For the time being, we have prepared a script that does reproducible build via [a docker container image](https://github.com/nervosnetwork/llvm-n-rust). We do want to mention that docker is not necessarily THE way to do reproducible build, nor is it the best way to do reproducible build. There might well be other ways that are better, such as chroot or Nix. It's just that historically, docker has been used in CKB script's build process, and adding a script leveraging docker here, provides an easy solution into the issue.

To do reproducible build, you can use the included script with varying commands:

Expand Down
2 changes: 1 addition & 1 deletion atomics-contract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2024"

[dependencies]
ckb-std = { version = "1.0", default-features = false, features = ["allocator", "calc-hash", "ckb-types", "libc"] }
ckb-std = { version = "1.1", default-features = false, features = ["allocator", "calc-hash", "ckb-types", "libc"] }
log = { version = "0.4.20", default-features = false }

[build-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion contract-without-simulator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ version = "0.1.0"
edition = "2024"

[dependencies]
ckb-std = "1.0"
ckb-std = "1.1"
2 changes: 1 addition & 1 deletion contract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2024"

[dependencies]
ckb-std = "1.0"
ckb-std = "1.1"

[features]
library = []
Expand Down
2 changes: 1 addition & 1 deletion native-simulator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2024"

[dependencies]
{{project-name | append: "@@SIMULATOR_PLACEHOLDER@@" | remove: "-sim@@SIMULATOR_PLACEHOLDER@@"}} = { path = "../../contracts/{{project-name | append: "@@SIMULATOR_PLACEHOLDER@@" | remove: "-sim@@SIMULATOR_PLACEHOLDER@@"}}", features = ["native-simulator"] }
ckb-std = { version = "1.0", features = ["native-simulator"] }
ckb-std = { version = "1.1", features = ["native-simulator"] }
ctor = "0.6"

[lib]
Expand Down
2 changes: 1 addition & 1 deletion stack-reorder-contract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2024"

[dependencies]
ckb-std = "1.0"
ckb-std = "1.1"

[build-dependencies]
cc = "1.0"
4 changes: 2 additions & 2 deletions standalone-contract/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ version = "0.1.0"
edition = "2024"

[dependencies]
ckb-std = "1.0"
ckb-std = "1.1"

[dev-dependencies]
ckb-testtool = "1.0"
ckb-testtool = "1.1"
serde_json = "1.0"
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:20250617
DOCKER_IMAGE="${DOCKER_IMAGE:-docker.io/cryptape/llvm-n-rust@sha256:d6d1f9a6656039273210de91913c828f5b4aa4a3282d2c93ed19bcb7bbf728fe}"
# docker pull nervos/llvm-n-rust:20260325
DOCKER_IMAGE="${DOCKER_IMAGE:-docker.io/nervos/llvm-n-rust@sha256:cfe226cbb93955b72209eac9db2d99b9405b03871972ea2998c7059dc4dd920f}"
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/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:20250617
DOCKER_IMAGE="${DOCKER_IMAGE:-docker.io/cryptape/llvm-n-rust@sha256:d6d1f9a6656039273210de91913c828f5b4aa4a3282d2c93ed19bcb7bbf728fe}"
# docker pull nervos/llvm-n-rust:20260325
DOCKER_IMAGE="${DOCKER_IMAGE:-docker.io/nervos/llvm-n-rust@sha256:cfe226cbb93955b72209eac9db2d99b9405b03871972ea2998c7059dc4dd920f}"
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 workspace/tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ edition = "2024"
native-simulator = [ "ckb-testtool/native-simulator" ]

[dependencies]
ckb-testtool = "1.0"
ckb-testtool = "1.1"
serde_json = "1.0"
4 changes: 2 additions & 2 deletions x64-simulator-crate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ version = "0.1.0"
edition = "2024"

[dependencies]
ckb-std = "1.0"
ckb-std = "1.1"

# Supporting native tests powered by ckb-x64-simulator
[target.'cfg(all(target_arch = "x86_64", unix))'.dependencies.ckb-std]
version = "1.0"
features = ["native-simulator"]

[target.'cfg(all(target_arch = "x86_64", unix))'.dev-dependencies]
ckb-testtool = "1.0"
ckb-testtool = "1.1"
rusty-fork = "0.3.0"
rand = "0.8.5"
serde_json = "1.0"
Expand Down
Loading