Skip to content

Commit 069f570

Browse files
committed
WIP
1 parent 1189851 commit 069f570

File tree

3 files changed

+112
-11
lines changed

3 files changed

+112
-11
lines changed
+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
FROM ubuntu:23.10
2+
3+
ARG DEBIAN_FRONTEND=noninteractive
4+
5+
RUN apt-get update && apt-get install -y --no-install-recommends \
6+
g++ \
7+
gcc-multilib \
8+
make \
9+
ninja-build \
10+
file \
11+
curl \
12+
ca-certificates \
13+
python3 \
14+
git \
15+
cmake \
16+
sudo \
17+
gdb \
18+
flex \
19+
bison \
20+
bc \
21+
llvm-17-tools \
22+
llvm-17-dev \
23+
libedit-dev \
24+
libssl-dev \
25+
pkg-config \
26+
zlib1g-dev \
27+
xz-utils \
28+
&& rm -rf /var/lib/apt/lists/*
29+
30+
COPY scripts/sccache.sh /scripts/
31+
RUN sh /scripts/sccache.sh
32+
33+
# We are disabling CI LLVM since this builder is intentionally using a host
34+
# LLVM, rather than the typical src/llvm-project LLVM.
35+
ENV NO_DOWNLOAD_CI_LLVM 1
36+
ENV EXTERNAL_LLVM 1
37+
38+
# This is not the latest LLVM version, so some components required by tests may
39+
# be missing.
40+
ENV IS_NOT_LATEST_LLVM 1
41+
42+
# Using llvm-link-shared due to libffi issues -- see #34486
43+
ENV RUST_CONFIGURE_ARGS \
44+
--build=x86_64-unknown-linux-gnu \
45+
--llvm-root=/usr/lib/llvm-17 \
46+
--enable-llvm-link-shared \
47+
--set rust.thin-lto-import-instr-limit=10
48+
49+
COPY /scripts/rfl-build.sh /tmp/rfl-build.sh
50+
ENV SCRIPT bash /tmp/rfl-build.sh

src/ci/docker/scripts/rfl-build.sh

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
LINUX_VERSION=v6.9
6+
7+
# Build rustc
8+
../x.py --stage 1 build library/std
9+
BUILT_RUSTC=$(realpath ./build/x86_64-unknown-linux-gnu/stage1/bin/rustc)
10+
11+
# Install rustup so that we have cargo for installing bindgen
12+
curl --proto '=https' --tlsv1.2 -sSf -o rustup.sh https://sh.rustup.rs
13+
sh rustup.sh -y --default-toolchain stable --profile minimal
14+
15+
mkdir -p rfl
16+
cd rfl
17+
18+
# Download Linux
19+
git clone --depth 1 --branch ${LINUX_VERSION} https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
20+
21+
# Install bindgen
22+
/cargo/bin/cargo install --locked --version $(linux/scripts/min-tool-version.sh bindgen) bindgen-cli
23+
24+
# Configure Linux
25+
cat <<EOF > linux/kernel/configs/rfl-for-rust-ci.config
26+
# CONFIG_RETHUNK is not set
27+
# CONFIG_X86_KERNEL_IBT is not set
28+
# CONFIG_GCC_PLUGINS is not set
29+
30+
CONFIG_RUST=y
31+
32+
CONFIG_SAMPLES=y
33+
CONFIG_SAMPLES_RUST=y
34+
35+
CONFIG_SAMPLE_RUST_MINIMAL=m
36+
CONFIG_SAMPLE_RUST_PRINT=y
37+
38+
CONFIG_RUST_PHYLIB_ABSTRACTIONS=y
39+
CONFIG_AX88796B_PHY=y
40+
CONFIG_AX88796B_RUST_PHY=y
41+
42+
CONFIG_KUNIT=y
43+
CONFIG_RUST_KERNEL_DOCTESTS=y
44+
EOF
45+
46+
export RUSTC=${BUILT_RUSTC}
47+
48+
make -C linux LLVM=1 -j$(($(nproc) + 1)) rustavailable defconfig rfl-for-rust-ci.config
49+
make -C linux LLVM=1 -j$(($(nproc) + 1)) samples/rust/rust_minimal.o samples/rust/rust_print.o drivers/net/phy/ax88796b_rust.o

src/ci/github-actions/jobs.yml

+13-11
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,19 @@ envs:
7575
# These jobs automatically inherit envs.pr, to avoid repeating
7676
# it in each job definition.
7777
pr:
78-
- image: mingw-check
79-
<<: *job-linux-4c
80-
- image: mingw-check-tidy
81-
continue_on_error: true
82-
<<: *job-linux-4c
83-
- image: x86_64-gnu-llvm-17
84-
env:
85-
ENABLE_GCC_CODEGEN: "1"
86-
<<: *job-linux-16c
87-
- image: x86_64-gnu-tools
88-
<<: *job-linux-16c
78+
# - image: mingw-check
79+
# <<: *job-linux-4c
80+
# - image: mingw-check-tidy
81+
# continue_on_error: true
82+
# <<: *job-linux-4c
83+
# - image: x86_64-gnu-llvm-17
84+
# env:
85+
# ENABLE_GCC_CODEGEN: "1"
86+
# <<: *job-linux-16c
87+
# - image: x86_64-gnu-tools
88+
# <<: *job-linux-16c
89+
- image: rfl
90+
<<: *job-linux-8c
8991

9092
# Jobs that run when you perform a try build (@bors try)
9193
# These jobs automatically inherit envs.try, to avoid repeating

0 commit comments

Comments
 (0)