Skip to content

Commit c241eaa

Browse files
authored
doc: By default we now recommend using LLVM 18 (#22)
* doc: By default we now recommend using LLVM 18 * Switch to LLVM 18 in CI * Work around ubuntu quirks for now * Lock rust toolchain version in CI * Install riscv64 target for the specified toolchain
1 parent 654384d commit c241eaa

File tree

2 files changed

+24
-18
lines changed

2 files changed

+24
-18
lines changed

.github/workflows/rust.yml

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@ jobs:
1616

1717
steps:
1818
- uses: actions/checkout@v3
19-
- name: Install llvm 16
20-
run: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 16 && rm llvm.sh
21-
- name: Install riscv64 target
22-
run: rustup target add riscv64imac-unknown-none-elf
19+
- name: Install llvm 18
20+
run: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 18 && rm llvm.sh
2321
- name: Install cargo generate
2422
run: cargo install cargo-generate
2523
- name: Generate workspace
@@ -35,14 +33,22 @@ jobs:
3533
run: cd test-workspace &&
3634
git submodule add https://github.com/nervosnetwork/ckb-c-stdlib deps/ckb-c-stdlib &&
3735
git submodule add https://github.com/xxuejie/lib-dummy-atomics deps/lib-dummy-atomics
36+
- name: Lock Rust version
37+
run: cd test-workspace && echo "1.75.0" > rust-toolchain
38+
- name: Install riscv64 target
39+
run: cd test-workspace && rustup target add riscv64imac-unknown-none-elf
40+
# TODO: Ubuntu 24.04 ships a clang package with clang, clang-18 and llvm-ar-18, while fedora ships a clang package with
41+
# clang, clang-19 and llvm-ar. We will need to deal with this quirk between different distros.
3842
- name: Run all checks
39-
run: cd test-workspace && make build test check clippy
43+
run: cd test-workspace && CLANG=clang-18 make build test check clippy
4044
- name: Reproducible build runs
4145
run: cd test-workspace && ./scripts/reproducible_build_docker --update && ./scripts/reproducible_build_docker --no-clean
4246
- name: Generate standalone contract
4347
run: cargo generate --path . standalone-contract --name test-contract
48+
- name: Lock Rust version
49+
run: cd test-contract && echo "1.75.0" > rust-toolchain
4450
- name: Run all checks
45-
run: cd test-contract && make build test check clippy
51+
run: cd test-contract && CLANG=clang-18 make build test check clippy
4652
- name: Reproducible build runs
4753
run: cd test-contract && ./scripts/reproducible_build_docker --update && ./scripts/reproducible_build_docker --no-clean
4854

@@ -87,8 +93,8 @@ jobs:
8793
steps:
8894
- name: Install dependencies
8995
run: apt-get update && apt-get -y install curl git build-essential pkg-config libssl-dev lsb-release wget software-properties-common gnupg
90-
- name: Install llvm 16
91-
run: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 16 && rm llvm.sh
96+
- name: Install llvm 18
97+
run: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 18 && rm llvm.sh
9298
- uses: actions-rust-lang/setup-rust-toolchain@v1
9399
with:
94100
components: clippy
@@ -206,8 +212,8 @@ jobs:
206212
- uses: actions/checkout@v3
207213
with:
208214
submodules: true
209-
- name: Install llvm 16
210-
run: brew install llvm@16
215+
- name: Install llvm 18
216+
run: brew install llvm@18
211217
- name: Install riscv64 target
212218
run: rustup target add riscv64imac-unknown-none-elf
213219
- name: Install cargo generate
@@ -250,8 +256,8 @@ jobs:
250256
# submodules: true
251257
# - name: Setup Docker on macOS
252258
# run: brew install docker colima && colima start
253-
# - name: Install llvm 16
254-
# run: brew install llvm@16
259+
# - name: Install llvm 18
260+
# run: brew install llvm@18
255261
# - name: Install riscv64 target
256262
# run: rustup target add riscv64imac-unknown-none-elf
257263
# - name: Install cargo generate
@@ -288,7 +294,7 @@ jobs:
288294
shell: pwsh
289295
# https://github.com/ScoopInstaller/Install#for-admin
290296
#
291-
# Note that on Windows we cannot choose LLVM 16 here, we have to settle on latest stable LLVM
297+
# Note that on Windows we cannot choose LLVM 18 here, we have to settle on latest stable LLVM
292298
run: |
293299
iex "& {$(irm get.scoop.sh)} -RunAsAdmin"
294300
scoop install llvm yasm
@@ -331,7 +337,7 @@ jobs:
331337
usesh: true
332338
prepare: |
333339
set -ex
334-
pkg install -y llvm16 git gmake bash
340+
pkg install -y llvm18 git gmake bash
335341
curl https://sh.rustup.rs -sSf | sh -s -- -y
336342
. $HOME/.cargo/env
337343
rustup target add riscv64imac-unknown-none-elf

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ This repository keeps a series of CKB script templates that can be inflated via
1919

2020
The following dependencies are required for the templates:
2121

22-
* `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.
22+
* `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.
2323
* `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`
24-
* `Clang`: make sure you have clang 16+ installed, sample installtion steps for selected platforms are:
25-
+ Debian / Ubuntu: `wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 16 && rm llvm.sh`
24+
* `Clang`: make sure you have clang 18+ installed, sample installtion steps for selected platforms are:
25+
+ Debian / Ubuntu: `wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 18 && rm llvm.sh`
2626
+ Fedora 39+: `sudo dnf -y install clang`
2727
+ Archlinux: `sudo pacman --noconfirm -Syu clang`
28-
+ macOS: `brew install llvm@16`
28+
+ macOS: `brew install llvm@18`
2929
+ Windows(with [Scoop](scoop install llvm yasm)): `scoop install llvm yasm`
3030
* `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)
3131

0 commit comments

Comments
 (0)