diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 90228f4..0695328 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -16,10 +16,8 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Install llvm 16 - run: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 16 && rm llvm.sh - - name: Install riscv64 target - run: rustup target add riscv64imac-unknown-none-elf + - name: Install llvm 18 + run: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 18 && rm llvm.sh - name: Install cargo generate run: cargo install cargo-generate - name: Generate workspace @@ -35,14 +33,22 @@ jobs: run: cd test-workspace && 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.75.0" > rust-toolchain + - name: Install riscv64 target + run: cd test-workspace && rustup target add riscv64imac-unknown-none-elf + # TODO: Ubuntu 24.04 ships a clang package with clang, clang-18 and llvm-ar-18, while fedora ships a clang package with + # clang, clang-19 and llvm-ar. We will need to deal with this quirk between different distros. - name: Run all checks - run: cd test-workspace && make build test check clippy + run: cd test-workspace && CLANG=clang-18 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.75.0" > rust-toolchain - name: Run all checks - run: cd test-contract && make build test check clippy + run: cd test-contract && CLANG=clang-18 make build test check clippy - name: Reproducible build runs run: cd test-contract && ./scripts/reproducible_build_docker --update && ./scripts/reproducible_build_docker --no-clean @@ -87,8 +93,8 @@ jobs: steps: - name: Install dependencies run: apt-get update && apt-get -y install curl git build-essential pkg-config libssl-dev lsb-release wget software-properties-common gnupg - - name: Install llvm 16 - run: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 16 && rm llvm.sh + - name: Install llvm 18 + run: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 18 && rm llvm.sh - uses: actions-rust-lang/setup-rust-toolchain@v1 with: components: clippy @@ -206,8 +212,8 @@ jobs: - uses: actions/checkout@v3 with: submodules: true - - name: Install llvm 16 - run: brew install llvm@16 + - name: Install llvm 18 + run: brew install llvm@18 - name: Install riscv64 target run: rustup target add riscv64imac-unknown-none-elf - name: Install cargo generate @@ -250,8 +256,8 @@ jobs: # submodules: true # - name: Setup Docker on macOS # run: brew install docker colima && colima start -# - name: Install llvm 16 -# run: brew install llvm@16 +# - name: Install llvm 18 +# run: brew install llvm@18 # - name: Install riscv64 target # run: rustup target add riscv64imac-unknown-none-elf # - name: Install cargo generate @@ -288,7 +294,7 @@ jobs: shell: pwsh # https://github.com/ScoopInstaller/Install#for-admin # - # Note that on Windows we cannot choose LLVM 16 here, we have to settle on latest stable LLVM + # Note that on Windows we cannot choose LLVM 18 here, we have to settle on latest stable LLVM run: | iex "& {$(irm get.scoop.sh)} -RunAsAdmin" scoop install llvm yasm @@ -331,7 +337,7 @@ jobs: usesh: true prepare: | set -ex - pkg install -y llvm16 git gmake bash + pkg install -y llvm18 git gmake bash curl https://sh.rustup.rs -sSf | sh -s -- -y . $HOME/.cargo/env rustup target add riscv64imac-unknown-none-elf diff --git a/README.md b/README.md index 52cf904..4b8dd77 100644 --- a/README.md +++ b/README.md @@ -19,13 +19,13 @@ This repository keeps a series of CKB script templates that can be inflated via The following dependencies are required for the templates: -* `git`, `make`, `sed`, `bash`, `sha256sum` and others Unix utilities. Refer to the documentation for your operating systems for how to install them. Chances are your system might already have them. +* `git`, `make`, `sed`, `bash`, `shasum` and others Unix utilities. Refer to the documentation for your operating systems for how to install them. Chances are your system might already have them. * `Rust`: latest stable Rust installed via [rustup](https://rustup.rs/) should work. Make sure you have `riscv64` target installed via: `rustup target add riscv64imac-unknown-none-elf` -* `Clang`: make sure you have clang 16+ installed, sample installtion steps for selected platforms are: - + Debian / Ubuntu: `wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 16 && rm llvm.sh` +* `Clang`: make sure you have clang 18+ installed, sample installtion steps for selected platforms are: + + Debian / Ubuntu: `wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 18 && rm llvm.sh` + Fedora 39+: `sudo dnf -y install clang` + Archlinux: `sudo pacman --noconfirm -Syu clang` - + macOS: `brew install llvm@16` + + macOS: `brew install llvm@18` + Windows(with [Scoop](scoop install llvm yasm)): `scoop install llvm yasm` * `cargo-generate`: You can install this via `cargo install cargo-generate`, or follow the steps [here](https://cargo-generate.github.io/cargo-generate/installation.html)