Commit 42b7263
authored
ci: add riscv64-linux build via cross-compilation on ubuntu-24.04 (#621)
Rework of the riscv64-linux CI build to use CMake cross-compilation on a
standard `ubuntu-24.04` runner, rather than a native RISE runner.
## What changed
**`ci/docker/Dockerfile.riscv64-linux`** (new):
- Ubuntu 24.04 base — has `crossbuild-essential-riscv64` in its package
repos
- Sets `CC=riscv64-linux-gnu-gcc` / `CXX=riscv64-linux-gnu-g++` so CMake
detects cross-compilation and causes LLVM to build a native
`llvm-tblgen` first, then cross-compile the rest of the toolchain
- Sets `CARGO_TARGET_RISCV64_UNKNOWN_LINUX_GNU_LINKER` for Rust
cross-builds
- `XDG_CACHE_HOME=/tmp/cache` avoids write permission issues in the
container
**`ci/docker-build.sh`**:
- Select `ci/docker/Dockerfile.<artifact>` if it exists, fall back to
the default `ci/docker/Dockerfile`
- Make the wasmtime volume mount conditional on
`WASI_SDK_CI_SKIP_SYSROOT != 1`
**`.github/workflows/main.yml`**:
- New `riscv64-linux` matrix entry: `os: ubuntu-24.04`, `rust_target:
riscv64-unknown-linux-gnu`
- `cross_cmake_args: -DCMAKE_SYSTEM_NAME=Linux
-DCMAKE_SYSTEM_PROCESSOR=riscv64 -DWASI_SDK_LLDB=OFF`
- `WASI_SDK_CI_SKIP_SYSROOT: 1`
- Handle `cross_cmake_args` in the cmake flags step
## Why WASI_SDK_CI_SKIP_SYSROOT
The cross-compiled clang runs on riscv64, not on the x86_64 build host,
so the wasm sysroot step is skipped.
## Why WASI_SDK_LLDB=OFF
Avoids cross-compiling libedit and libxml2 in this first iteration; can
be re-enabled as a follow-up.
Closes #607
---------
Signed-off-by: Bruno Verachten <gounthar@gmail.com>1 parent 62a1a88 commit 42b7263
4 files changed
Lines changed: 60 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
31 | 46 | | |
32 | 47 | | |
33 | 48 | | |
| |||
85 | 100 | | |
86 | 101 | | |
87 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
88 | 106 | | |
89 | 107 | | |
90 | 108 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
20 | 25 | | |
21 | 26 | | |
22 | 27 | | |
| |||
34 | 39 | | |
35 | 40 | | |
36 | 41 | | |
37 | | - | |
| 42 | + | |
38 | 43 | | |
39 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
40 | 47 | | |
41 | 48 | | |
42 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
0 commit comments