Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Update ckb-* to v1.1
  • Loading branch information
joii2020 committed Jun 12, 2026
commit d9c7879aad6c8cae600aecc384c5cbc82537d254
1,215 changes: 827 additions & 388 deletions examples/ckb-rust-script/Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/ckb-rust-script/contracts/carrot/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2021"

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

[features]
library = []
Expand Down
2 changes: 1 addition & 1 deletion examples/ckb-rust-script/contracts/carrot/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ TOP := $(cur_dir)
CUSTOM_RUSTFLAGS := -C debug-assertions
# RUSTFLAGS that are less likely to be tweaked by developers. Most likely
# one would want to keep the default values here.
FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs,-a $(CUSTOM_RUSTFLAGS)
FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs -C passes=lower-atomic $(CUSTOM_RUSTFLAGS)
# Additional cargo args to append here. For example, one can use
# make test CARGO_ARGS="-- --nocapture" so as to inspect data emitted to
# stdout in unit tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ version = "0.1.0"
edition = "2021"

[dependencies]
ckb-std = "0.17.0"
ckb-std = "1.1"
ckb-crypto-interface = { path = "../../crate/ckb-crypto-interface" }
ckb-script-ipc-common = "1.0.3"
ckb-script-ipc-common = "1.1"

[features]
library = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ TOP := $(cur_dir)
CUSTOM_RUSTFLAGS := -C debug-assertions
# RUSTFLAGS that are less likely to be tweaked by developers. Most likely
# one would want to keep the default values here.
FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs,-a $(CUSTOM_RUSTFLAGS)
FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs -C passes=lower-atomic $(CUSTOM_RUSTFLAGS)
# Additional cargo args to append here. For example, one can use
# make test CARGO_ARGS="-- --nocapture" so as to inspect data emitted to
# stdout in unit tests
Expand Down
2 changes: 1 addition & 1 deletion examples/ckb-rust-script/contracts/empty/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ TOP := $(cur_dir)
CUSTOM_RUSTFLAGS := -C debug-assertions
# RUSTFLAGS that are less likely to be tweaked by developers. Most likely
# one would want to keep the default values here.
FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs,-a $(CUSTOM_RUSTFLAGS)
FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs -C passes=lower-atomic $(CUSTOM_RUSTFLAGS)
# Additional cargo args to append here. For example, one can use
# make test CARGO_ARGS="-- --nocapture" so as to inspect data emitted to
# stdout in unit tests
Expand Down
2 changes: 1 addition & 1 deletion examples/ckb-rust-script/contracts/error/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2021"

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

[features]
library = []
Expand Down
2 changes: 1 addition & 1 deletion examples/ckb-rust-script/contracts/error/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ TOP := $(cur_dir)
CUSTOM_RUSTFLAGS := -C debug-assertions
# RUSTFLAGS that are less likely to be tweaked by developers. Most likely
# one would want to keep the default values here.
FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs,-a $(CUSTOM_RUSTFLAGS)
FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs -C passes=lower-atomic $(CUSTOM_RUSTFLAGS)
# Additional cargo args to append here. For example, one can use
# make test CARGO_ARGS="-- --nocapture" so as to inspect data emitted to
# stdout in unit tests
Expand Down
2 changes: 1 addition & 1 deletion examples/ckb-rust-script/contracts/group_exec/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2021"

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

[features]
library = []
Expand Down
2 changes: 1 addition & 1 deletion examples/ckb-rust-script/contracts/group_exec/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ TOP := $(cur_dir)
CUSTOM_RUSTFLAGS := -C debug-assertions
# RUSTFLAGS that are less likely to be tweaked by developers. Most likely
# one would want to keep the default values here.
FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs,-a $(CUSTOM_RUSTFLAGS)
FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs -C passes=lower-atomic $(CUSTOM_RUSTFLAGS)
# Additional cargo args to append here. For example, one can use
# make test CARGO_ARGS="-- --nocapture" so as to inspect data emitted to
# stdout in unit tests
Expand Down
2 changes: 1 addition & 1 deletion examples/ckb-rust-script/contracts/hello-world/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2021"

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

[features]
library = []
Expand Down
2 changes: 1 addition & 1 deletion examples/ckb-rust-script/contracts/hello-world/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ TOP := $(cur_dir)
CUSTOM_RUSTFLAGS := -C debug-assertions
# RUSTFLAGS that are less likely to be tweaked by developers. Most likely
# one would want to keep the default values here.
FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs,-a $(CUSTOM_RUSTFLAGS)
FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs -C passes=lower-atomic $(CUSTOM_RUSTFLAGS)
# Additional cargo args to append here. For example, one can use
# make test CARGO_ARGS="-- --nocapture" so as to inspect data emitted to
# stdout in unit tests
Expand Down
4 changes: 2 additions & 2 deletions examples/ckb-rust-script/contracts/ipc-child/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ version = "0.1.0"
edition = "2021"

[dependencies]
ckb-std = { version = "0.17.0", features = ["allocator", "ckb-types", "dummy-atomic", "log"] }
ckb-std = { version = "1.1", features = ["allocator", "ckb-types", "dummy-atomic", "log"] }
ipc-interface = { path = "../../crate/ipc-interface/" }
ckb-script-ipc-common = "1.0.3"
ckb-script-ipc-common = "1.1"

[features]
library = []
Expand Down
2 changes: 1 addition & 1 deletion examples/ckb-rust-script/contracts/ipc-child/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ TOP := $(cur_dir)
CUSTOM_RUSTFLAGS := -C debug-assertions
# RUSTFLAGS that are less likely to be tweaked by developers. Most likely
# one would want to keep the default values here.
FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs,-a $(CUSTOM_RUSTFLAGS)
FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs -C passes=lower-atomic $(CUSTOM_RUSTFLAGS)
# Additional cargo args to append here. For example, one can use
# make test CARGO_ARGS="-- --nocapture" so as to inspect data emitted to
# stdout in unit tests
Expand Down
4 changes: 2 additions & 2 deletions examples/ckb-rust-script/contracts/ipc-parent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ version = "0.1.0"
edition = "2021"

[dependencies]
ckb-std = { version = "0.17.0", features = ["allocator", "ckb-types", "dummy-atomic", "log"] }
ckb-std = { version = "1.1", features = ["allocator", "ckb-types", "dummy-atomic", "log"] }
ipc-interface = { path = "../../crate/ipc-interface/" }
ckb-script-ipc-common = "1.0.3"
ckb-script-ipc-common = "1.1"

[features]
library = []
Expand Down
2 changes: 1 addition & 1 deletion examples/ckb-rust-script/contracts/ipc-parent/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ TOP := $(cur_dir)
CUSTOM_RUSTFLAGS := -C debug-assertions
# RUSTFLAGS that are less likely to be tweaked by developers. Most likely
# one would want to keep the default values here.
FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs,-a $(CUSTOM_RUSTFLAGS)
FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs -C passes=lower-atomic $(CUSTOM_RUSTFLAGS)
# Additional cargo args to append here. For example, one can use
# make test CARGO_ARGS="-- --nocapture" so as to inspect data emitted to
# stdout in unit tests
Expand Down
2 changes: 1 addition & 1 deletion examples/ckb-rust-script/contracts/log/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2021"

[dependencies]
ckb-std = {version = "0.17.0", features = ["log"] }
ckb-std = {version = "1.1", features = ["log"] }

[features]
library = []
Expand Down
2 changes: 1 addition & 1 deletion examples/ckb-rust-script/contracts/log/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ TOP := $(cur_dir)
CUSTOM_RUSTFLAGS := -C debug-assertions
# RUSTFLAGS that are less likely to be tweaked by developers. Most likely
# one would want to keep the default values here.
FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs,-a $(CUSTOM_RUSTFLAGS)
FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs -C passes=lower-atomic $(CUSTOM_RUSTFLAGS)
# Additional cargo args to append here. For example, one can use
# make test CARGO_ARGS="-- --nocapture" so as to inspect data emitted to
# stdout in unit tests
Expand Down
2 changes: 1 addition & 1 deletion examples/ckb-rust-script/contracts/script-hash/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2021"

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

[features]
library = []
Expand Down
2 changes: 1 addition & 1 deletion examples/ckb-rust-script/contracts/script-hash/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ TOP := $(cur_dir)
CUSTOM_RUSTFLAGS := -C debug-assertions
# RUSTFLAGS that are less likely to be tweaked by developers. Most likely
# one would want to keep the default values here.
FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs,-a $(CUSTOM_RUSTFLAGS)
FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs -C passes=lower-atomic $(CUSTOM_RUSTFLAGS)
# Additional cargo args to append here. For example, one can use
# make test CARGO_ARGS="-- --nocapture" so as to inspect data emitted to
# stdout in unit tests
Expand Down
4 changes: 2 additions & 2 deletions examples/ckb-rust-script/contracts/simple-lock/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ version = "0.1.0"
edition = "2021"

[dependencies]
ckb-std = "0.17.0"
ckb-hash = {version = "0.202.0", default-features = false, features = ["ckb-contract"] }
ckb-std = "1.1"
ckb-hash = {version = "1.1", default-features = false, features = ["ckb-contract"] }

[features]
library = []
Expand Down
2 changes: 1 addition & 1 deletion examples/ckb-rust-script/contracts/simple-lock/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ TOP := $(cur_dir)
CUSTOM_RUSTFLAGS := -C debug-assertions
# RUSTFLAGS that are less likely to be tweaked by developers. Most likely
# one would want to keep the default values here.
FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs,-a $(CUSTOM_RUSTFLAGS)
FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs -C passes=lower-atomic $(CUSTOM_RUSTFLAGS)
# Additional cargo args to append here. For example, one can use
# make test CARGO_ARGS="-- --nocapture" so as to inspect data emitted to
# stdout in unit tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2021"

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

[features]
library = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ TOP := $(cur_dir)
CUSTOM_RUSTFLAGS := -C debug-assertions
# RUSTFLAGS that are less likely to be tweaked by developers. Most likely
# one would want to keep the default values here.
FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs,-a $(CUSTOM_RUSTFLAGS)
FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs -C passes=lower-atomic $(CUSTOM_RUSTFLAGS)
# Additional cargo args to append here. For example, one can use
# make test CARGO_ARGS="-- --nocapture" so as to inspect data emitted to
# stdout in unit tests
Expand Down
2 changes: 1 addition & 1 deletion examples/ckb-rust-script/contracts/spawn-child/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2021"

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

[features]
library = []
Expand Down
2 changes: 1 addition & 1 deletion examples/ckb-rust-script/contracts/spawn-child/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ TOP := $(cur_dir)
CUSTOM_RUSTFLAGS := -C debug-assertions
# RUSTFLAGS that are less likely to be tweaked by developers. Most likely
# one would want to keep the default values here.
FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs,-a $(CUSTOM_RUSTFLAGS)
FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs -C passes=lower-atomic $(CUSTOM_RUSTFLAGS)
# Additional cargo args to append here. For example, one can use
# make test CARGO_ARGS="-- --nocapture" so as to inspect data emitted to
# stdout in unit tests
Expand Down
2 changes: 1 addition & 1 deletion examples/ckb-rust-script/contracts/spawn-parent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2021"

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

[features]
library = []
Expand Down
2 changes: 1 addition & 1 deletion examples/ckb-rust-script/contracts/spawn-parent/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ TOP := $(cur_dir)
CUSTOM_RUSTFLAGS := -C debug-assertions
# RUSTFLAGS that are less likely to be tweaked by developers. Most likely
# one would want to keep the default values here.
FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs,-a $(CUSTOM_RUSTFLAGS)
FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs -C passes=lower-atomic $(CUSTOM_RUSTFLAGS)
# Additional cargo args to append here. For example, one can use
# make test CARGO_ARGS="-- --nocapture" so as to inspect data emitted to
# stdout in unit tests
Expand Down
2 changes: 1 addition & 1 deletion examples/ckb-rust-script/contracts/sudt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2021"

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

[features]
library = []
Expand Down
2 changes: 1 addition & 1 deletion examples/ckb-rust-script/contracts/sudt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ TOP := $(cur_dir)
CUSTOM_RUSTFLAGS := -C debug-assertions
# RUSTFLAGS that are less likely to be tweaked by developers. Most likely
# one would want to keep the default values here.
FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs,-a $(CUSTOM_RUSTFLAGS)
FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs -C passes=lower-atomic $(CUSTOM_RUSTFLAGS)
# Additional cargo args to append here. For example, one can use
# make test CARGO_ARGS="-- --nocapture" so as to inspect data emitted to
# stdout in unit tests
Expand Down
2 changes: 1 addition & 1 deletion examples/ckb-rust-script/contracts/tx-hash/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2021"

[dependencies]
ckb-std = "0.17.0"
ckb-std = "1.1"
blake2b-ref = "0.3.1"

[features]
Expand Down
2 changes: 1 addition & 1 deletion examples/ckb-rust-script/contracts/tx-hash/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ TOP := $(cur_dir)
CUSTOM_RUSTFLAGS := -C debug-assertions
# RUSTFLAGS that are less likely to be tweaked by developers. Most likely
# one would want to keep the default values here.
FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs,-a $(CUSTOM_RUSTFLAGS)
FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs -C passes=lower-atomic $(CUSTOM_RUSTFLAGS)
# Additional cargo args to append here. For example, one can use
# make test CARGO_ARGS="-- --nocapture" so as to inspect data emitted to
# stdout in unit tests
Expand Down
2 changes: 1 addition & 1 deletion examples/ckb-rust-script/contracts/type-id/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
edition = "2021"

[dependencies]
ckb-std = { version = "0.17.0", features = [ "type-id" ] }
ckb-std = { version = "1.1", features = [ "type-id" ] }

[features]
library = []
Expand Down
2 changes: 1 addition & 1 deletion examples/ckb-rust-script/contracts/type-id/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ TOP := $(cur_dir)
CUSTOM_RUSTFLAGS := -C debug-assertions
# RUSTFLAGS that are less likely to be tweaked by developers. Most likely
# one would want to keep the default values here.
FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs,-a $(CUSTOM_RUSTFLAGS)
FULL_RUSTFLAGS := -C target-feature=+zba,+zbb,+zbc,+zbs -C passes=lower-atomic $(CUSTOM_RUSTFLAGS)
# Additional cargo args to append here. For example, one can use
# make test CARGO_ARGS="-- --nocapture" so as to inspect data emitted to
# stdout in unit tests
Expand Down
2 changes: 1 addition & 1 deletion examples/ckb-rust-script/contracts/type-id/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use ckb_std::error::SysError;
use ckb_std::high_level::load_script_hash;

fn ckb_main() -> Result<(), SysError> {
ckb_std::type_id::check_type_id(32)?;
ckb_std::type_id::check_type_id(32, 32)?;

debug!("Script Hash: {:02x?}", load_script_hash()?);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ version = "0.1.0"
edition = "2024"

[dependencies]
ckb-script-ipc-common = "1.0.3"
ckb-script-ipc = "1.0.3"
ckb-script-ipc-common = "1.1"
ckb-script-ipc = "1.1"
serde = { version = "1.0", default-features = false, features = ["derive"] }
4 changes: 2 additions & 2 deletions examples/ckb-rust-script/crate/ipc-interface/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ version = "0.1.0"
edition = "2024"

[dependencies]
ckb-script-ipc-common = "1.0.3"
ckb-script-ipc = "1.0.3"
ckb-script-ipc-common = "1.1"
ckb-script-ipc = "1.1"
serde = { version = "1.0", default-features = false, features = ["derive"] }
1 change: 1 addition & 0 deletions examples/ckb-rust-script/rust-toolchain
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.95.0
10 changes: 5 additions & 5 deletions examples/ckb-rust-script/scripts/find_clang
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ fi
# at the end.
SEARCH_TARGET="${SEARCH_TARGET:-llvm-strip}"

CANDIDATES=("${SEARCH_TARGET}" "${SEARCH_TARGET}-19" "${SEARCH_TARGET}-18" "${SEARCH_TARGET}-17" "${SEARCH_TARGET}-16")
CANDIDATES=("${SEARCH_TARGET}" "${SEARCH_TARGET}-19" "${SEARCH_TARGET}-20" "${SEARCH_TARGET}-21" "${SEARCH_TARGET}-22")

BREW_PREFIX=$(brew --prefix 2> /dev/null)
if [[ -n "${BREW_PREFIX}" ]]; then
CANDIDATES+=(
"${BREW_PREFIX}/opt/llvm/bin/${SEARCH_TARGET}"
"${BREW_PREFIX}/opt/llvm@19/bin/${SEARCH_TARGET}"
"${BREW_PREFIX}/opt/llvm@18/bin/${SEARCH_TARGET}"
"${BREW_PREFIX}/opt/llvm@17/bin/${SEARCH_TARGET}"
"${BREW_PREFIX}/opt/llvm@16/bin/${SEARCH_TARGET}"
"${BREW_PREFIX}/opt/llvm@20/bin/${SEARCH_TARGET}"
"${BREW_PREFIX}/opt/llvm@21/bin/${SEARCH_TARGET}"
"${BREW_PREFIX}/opt/llvm@22/bin/${SEARCH_TARGET}"
)
fi

Expand All @@ -35,4 +35,4 @@ for candidate in ${CANDIDATES[@]}; do
done

>&2 echo "Cannot find clang of version 16+!"
exit 1
exit 1
16 changes: 11 additions & 5 deletions examples/ckb-rust-script/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 nervos/llvm-n-rust:20260610
DOCKER_IMAGE="${DOCKER_IMAGE:-docker.io/nervos/llvm-n-rust@sha256:c1abd0c0542222b3e6c3e87361636fe2f3e08b9a3126e5bb1df10880aa0f23ca}"
CHECKSUM_FILE_PATH="${CHECKSUM_FILE_PATH:-checksums.txt}"

# We are parsing command line arguments based on tips from:
Expand Down Expand Up @@ -55,12 +55,18 @@ else
TASKS+=" build "
fi

$DOCKER run --rm $DOCKER_RUN_ARGS -v `pwd`:/code $DOCKER_IMAGE make $TASKS
DOCKER_IMAGE_PLATFORM=linux/amd64
if [[ "$(grep -E '^ID=' /etc/os-release 2>/dev/null | cut -d= -f2 | tr -d '"')" == "ubuntu" ]] && [[ "$(uname -m)" == "aarch64" ]]; then
echo "Ubuntu ARM64 detected. Using docker image with linux/arm64 platform. Note: This may produce different binaries than the default linux/amd64."
DOCKER_IMAGE_PLATFORM=linux/arm64
fi

$DOCKER run --platform=${DOCKER_IMAGE_PLATFORM} --rm $DOCKER_RUN_ARGS -v `pwd`:/code $DOCKER_IMAGE make $TASKS
# Reset file ownerships for all files docker might touch
$DOCKER run --rm $DOCKER_RUN_ARGS -e UID=`id -u` -e GID=`id -g` -v `pwd`:/code $DOCKER_IMAGE bash -c 'chown -R -f $UID:$GID checksums.txt build target'
$DOCKER run --platform=${DOCKER_IMAGE_PLATFORM} --rm $DOCKER_RUN_ARGS -e UID=`id -u` -e GID=`id -g` -v `pwd`:/code $DOCKER_IMAGE bash -c 'chown -R -f $UID:$GID checksums.txt build target'

if [[ "${UPDATE}" = "yes" ]]; then
echo "${CHECKSUM_FILE_PATH} file is updated with latest binary hashes!"
else
shasum -a 256 -c ${CHECKSUM_FILE_PATH}
fi
fi
Loading