Skip to content

Commit 63c470a

Browse files
committed
ci: add aarch64-gnu-debug job
Adds a new CI job which checks that the compiler builds with `--enable-debug` and tests that `needs-force-clang-based-tests` pass (where cross-language LTO is tested).
1 parent 916e9ce commit 63c470a

File tree

3 files changed

+74
-4
lines changed

3 files changed

+74
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
FROM ubuntu:22.04
2+
3+
ARG DEBIAN_FRONTEND=noninteractive
4+
RUN apt-get update && apt-get install -y --no-install-recommends \
5+
g++ \
6+
make \
7+
ninja-build \
8+
file \
9+
curl \
10+
ca-certificates \
11+
python3 \
12+
python3-dev \
13+
libxml2-dev \
14+
libncurses-dev \
15+
libedit-dev \
16+
swig \
17+
doxygen \
18+
git \
19+
cmake \
20+
sudo \
21+
gdb \
22+
libssl-dev \
23+
pkg-config \
24+
xz-utils \
25+
lld \
26+
clang \
27+
&& rm -rf /var/lib/apt/lists/*
28+
29+
COPY scripts/sccache.sh /scripts/
30+
RUN sh /scripts/sccache.sh
31+
32+
ENV RUSTBUILD_FORCE_CLANG_BASED_TESTS 1
33+
ENV RUN_CHECK_WITH_PARALLEL_QUERIES 1
34+
35+
# llvm.use-linker conflicts with downloading CI LLVM
36+
ENV NO_DOWNLOAD_CI_LLVM 1
37+
38+
ENV RUST_CONFIGURE_ARGS \
39+
--build=aarch64-unknown-linux-gnu \
40+
--enable-debug \
41+
--enable-lld \
42+
--set llvm.use-linker=lld \
43+
--set target.aarch64-unknown-linux-gnu.linker=clang \
44+
--set target.aarch64-unknown-linux-gnu.cc=clang \
45+
--set target.aarch64-unknown-linux-gnu.cxx=clang++
46+
47+
# This job appears to be checking two separate things:
48+
# - That we can build the compiler with `--enable-debug`
49+
# (without necessarily testing the result).
50+
# - That the tests with `//@ needs-force-clang-based-tests` pass, since they
51+
# don't run by default unless RUSTBUILD_FORCE_CLANG_BASED_TESTS is set.
52+
# - FIXME(https://github.com/rust-lang/rust/pull/126155#issuecomment-2156314273):
53+
# Currently we only run the subset of tests with "clang" in their name.
54+
55+
ENV SCRIPT \
56+
python3 ../x.py --stage 2 build && \
57+
python3 ../x.py --stage 2 test tests/run-make --test-args clang

src/ci/github-actions/jobs.yml

+3
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ auto:
123123
- image: aarch64-gnu
124124
<<: *job-aarch64-linux
125125

126+
- image: aarch64-gnu-debug
127+
<<: *job-aarch64-linux
128+
126129
- image: arm-android
127130
<<: *job-linux-4c
128131

tests/run-make/cross-lang-lto-clang/rmake.rs

+14-4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@
99

1010
use run_make_support::{clang, env_var, llvm_ar, llvm_objdump, rustc, static_lib_name};
1111

12+
#[cfg(any(target_arch = "aarch64", target_arch = "arm"))]
13+
const ALWAYS_INLINED_PATTERN = "bl.*<rust_always_inlined>";
14+
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
15+
const ALWAYS_INLINED_PATTERN = "call.*rust_always_inlined";
16+
17+
#[cfg(any(target_arch = "aarch64", target_arch = "arm"))]
18+
const NEVER_INLINED_PATTERN = "bl.*<rust_never_inlined>";
19+
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
20+
const NEVER_INLINED_PATTERN = "call.*rust_never_inlined";
21+
1222
fn main() {
1323
rustc()
1424
.linker_plugin_lto("on")
@@ -31,14 +41,14 @@ fn main() {
3141
.disassemble()
3242
.input("cmain")
3343
.run()
34-
.assert_stdout_not_contains_regex("call.*rust_always_inlined");
44+
.assert_stdout_not_contains_regex(ALWAYS_INLINED_PATTERN);
3545
// As a sanity check, make sure we do find a call instruction to a
3646
// non-inlined function
3747
llvm_objdump()
3848
.disassemble()
3949
.input("cmain")
4050
.run()
41-
.assert_stdout_contains_regex("call.*rust_never_inlined");
51+
.assert_stdout_contains_regex(NEVER_INLINED_PATTERN);
4252
clang().input("clib.c").lto("thin").arg("-c").out_exe("clib.o").arg("-O2").run();
4353
llvm_ar().obj_to_ar().output_input(static_lib_name("xyz"), "clib.o").run();
4454
rustc()
@@ -53,10 +63,10 @@ fn main() {
5363
.disassemble()
5464
.input("rsmain")
5565
.run()
56-
.assert_stdout_not_contains_regex("call.*c_always_inlined");
66+
.assert_stdout_not_contains_regex(ALWAYS_INLINED_PATTERN);
5767
llvm_objdump()
5868
.disassemble()
5969
.input("rsmain")
6070
.run()
61-
.assert_stdout_contains_regex("call.*c_never_inlined");
71+
.assert_stdout_contains_regex(NEVER_INLINED_PATTERN);
6272
}

0 commit comments

Comments
 (0)