22
33set -euo pipefail
44
5- LINUX_VERSION=v6.9
5+ LINUX_VERSION=master
66
7- # Build rustc
8- ../x.py --stage 1 build library/std
9- BUILT_RUSTC=$( realpath ./build/x86_64-unknown-linux-gnu/stage1/bin/rustc)
7+ # Build rustc and rustdoc
8+ ../x.py --stage 1 build library rustdoc
109
11- # Install rustup so that we have cargo for installing bindgen
10+ # Install rustup so that we can use the built toolchain easily
1211curl --proto ' =https' --tlsv1.2 -sSf -o rustup.sh https://sh.rustup.rs
1312sh rustup.sh -y --default-toolchain stable --profile minimal
1413
1514source /cargo/env
1615
16+ rustup toolchain link local ./build/x86_64-unknown-linux-gnu/stage1
17+ rustup default local
18+
1719mkdir -p rfl
1820cd rfl
1921
2022# Download Linux
2123git clone --depth 1 --branch ${LINUX_VERSION} \
2224 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
2325
24- # Install bindgen
26+ # Install bindgen. It needs to be compiled with the same version
27+ # as will be used for the RfL build.
2528cargo install --locked \
2629 --version $( linux/scripts/min-tool-version.sh bindgen) bindgen-cli
2730
28- # Configure Linux
31+ # Configure Rust for Linux
2932cat << EOF > linux/kernel/configs/rfl-for-rust-ci.config
3033# CONFIG_RETHUNK is not set
3134# CONFIG_X86_KERNEL_IBT is not set
@@ -47,12 +50,12 @@ CONFIG_KUNIT=y
4750CONFIG_RUST_KERNEL_DOCTESTS=y
4851EOF
4952
50- make -C linux LLVM=1 RUSTC= ${BUILT_RUSTC} -j$(( $(nproc) + 1 )) \
53+ make -C linux LLVM=1 -j$(( $(nproc) + 1 )) \
5154 rustavailable \
5255 defconfig \
5356 rfl-for-rust-ci.config
5457
55- make -C linux LLVM=1 RUSTC= ${BUILT_RUSTC} -j$(( $(nproc) + 1 )) \
58+ make -C linux LLVM=1 -j$(( $(nproc) + 1 )) \
5659 samples/rust/rust_minimal.o \
5760 samples/rust/rust_print.o \
5861 drivers/net/phy/ax88796b_rust.o
0 commit comments