Repository navigation
216 lines (185 loc) · 7.89 KB
/
Copy pathci.yml
File metadata and controls
216 lines (185 loc) · 7.89 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
name: CI
on:
push:
branches:
- master
pull_request:
permissions:
contents: read
env:
# Enable backtraces for easier debugging
RUST_BACKTRACE: 1
# For the run-make tests.
LLVM_BIN_DIR: /usr/bin
jobs:
build:
runs-on: ${{ matrix.os.image }}
# Above 3 times the longest job, so that a hang cannot run until GitHub's 6-hour limit.
timeout-minutes: 90
strategy:
fail-fast: false
matrix:
os:
- { image: ubuntu-26.04, asset_name_suffix: "" }
- { image: ubuntu-26.04-arm, asset_name_suffix: "-aarch64" }
libgccjit_version:
- { gcc: "gcc-15" }
- { gcc: "gcc-15-without-int128" }
commands: [
"--std-tests --alloc-tests",
# FIXME: re-enable asm tests when GCC can emit in the right syntax.
# "--asm-tests",
"--test-libcore --test-libcore-doctests",
"--test-successful-rustc --nb-parts 2 --current-part 0",
"--test-successful-rustc --nb-parts 2 --current-part 1",
"--librsvg-tests",
"--projects --nb-parts 3 --current-part 0",
"--projects --nb-parts 3 --current-part 1",
"--projects --nb-parts 3 --current-part 2",
"--gcc-asm-tests --test-release-libcore",
]
# The checks that don't depend on the test command only run in the fastest job.
include:
- commands: "--std-tests --alloc-tests"
run_checks: true
# No need to run the tests without 128-bit integers on more than one platform.
exclude:
- os: { image: ubuntu-26.04-arm, asset_name_suffix: "-aarch64" }
libgccjit_version: { gcc: "gcc-15-without-int128" }
# FIXME: re-enable when the AES, SHA, RDMA and CRC intrinsics are supported on Aarch64.
- os: { image: ubuntu-26.04-arm, asset_name_suffix: "-aarch64" }
commands: "--librsvg-tests"
steps:
- uses: actions/checkout@v7
# `rustup show` installs from rust-toolchain.toml
- name: Setup rust toolchain
run: rustup show
- name: Setup rust cache
uses: Swatinem/rust-cache@v2
- name: Add apt mirrors
uses: ./.github/actions/apt-mirrors
- name: Install packages
# `llvm-tools` is needed to install the `FileCheck` binary which is used for asm tests.
timeout-minutes: 20
run: |
sudo apt-get update
sudo apt-get install ninja-build ripgrep llvm-tools llvm
- name: Install the libraries needed to build librsvg
if: ${{ contains(matrix.commands, '--librsvg-tests') }}
timeout-minutes: 20
run: sudo apt-get install libcairo2-dev libpango1.0-dev libfontconfig1-dev libfreetype-dev libharfbuzz-dev libxml2-dev libglib2.0-dev
- name: Download artifact
run: curl -LO https://github.com/rust-lang/gcc/releases/latest/download/${{ matrix.libgccjit_version.gcc }}${{ matrix.os.asset_name_suffix }}.deb
- name: Setup path to libgccjit
run: |
sudo dpkg --force-overwrite -i ${{ matrix.libgccjit_version.gcc }}${{ matrix.os.asset_name_suffix }}.deb
echo 'gcc-path = "/usr/lib/"' > config.toml
# Some run-make tests fail if we use our forked GCC because it doesn't
# bundle libstdc++, so we switch to gcc-14 to have a GCC that has
# libstdc++.
#
# We cannot do this on Aarch64: on x86-64, rustc links with rust-lld, which
# ignores the LTO bytecode that our GCC puts in the object files, while on
# Aarch64, it links via `cc`. Since LTO requires the same GCC version for
# the whole compilation, gcc-14 would run its own lto1 on that bytecode and
# fail with:
# lto1: fatal error: bytecode stream in file '...rcgu.o' generated with LTO
# version 17.0 instead of the expected 14.0
- name: Set default GCC to gcc-14
if: ${{ matrix.os.image == 'ubuntu-26.04' }}
run: sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-14 30
# Since we keep our GCC as the linker on Aarch64 (see above) and it is
# built without C++ support, it ships neither libubsan (needed by the tests
# compiled with `-Cllvm-args=sanitize-undefined`) nor libstdc++ (needed by
# some run-make tests). Take those from gcc-14 instead: LIBRARY_PATH is
# only used to resolve `-l` options, so the startup files still come from
# our GCC.
- name: Use the libraries from gcc-14 that our GCC doesn't bundle
if: ${{ matrix.os.image == 'ubuntu-26.04-arm' }}
run: echo "LIBRARY_PATH=$(dirname "$(gcc-14 -print-file-name=libubsan.so)")" >> $GITHUB_ENV
- name: Set env
run: |
echo "workspace="$GITHUB_WORKSPACE >> $GITHUB_ENV
#- name: Cache rust repository
## We only clone the rust repository for rustc tests
#if: ${{ contains(matrix.commands, 'rustc') }}
#uses: actions/cache@v3
#id: cache-rust-repository
#with:
#path: rust
#key: ${{ runner.os }}-packages-${{ hashFiles('rust/.git/HEAD') }}
- name: Prepare
if: ${{ matrix.run_checks }}
run: ./y.sh prepare --only-libcore
- name: Check formatting
if: ${{ matrix.run_checks }}
run: ./y.sh fmt --check
- name: Check todo
if: ${{ matrix.run_checks }}
run: ./y.sh check-todo
- name: Check lints
if: ${{ matrix.run_checks }}
run: ./y.sh clippy
- name: Build
if: ${{ matrix.run_checks }}
run: |
./y.sh build --sysroot
./y.sh test --cargo-tests
CARGO_TEST_FLAGS="-Zmir-preserve-ub" ./y.sh test --cargo-tests -- mir_preserve_ub_empty_switch
# The lock-free 128-bit atomics need native 128-bit integers.
if [ "${{ matrix.libgccjit_version.gcc }}" != "gcc-15-without-int128" ]; then
CARGO_TEST_FLAGS="-Ctarget-feature=+cmpxchg16b" ./y.sh test --cargo-tests -- atomic_u128
fi
- name: Run y.sh cargo build
if: ${{ matrix.run_checks }}
run: |
CARGO_PROFILE_DEV_LTO=no ./y.sh cargo build --manifest-path tests/hello-world/Cargo.toml
- name: Clean
if: ${{ matrix.run_checks }}
run: |
./y.sh clean all
- name: Prepare dependencies
run: |
git config --global user.email "user@example.com"
git config --global user.name "User"
./y.sh prepare
- name: Add more failing tests for GCC without 128-bit integers support
if: ${{ matrix.libgccjit_version.gcc == 'gcc-15-without-int128' }}
run: cat tests/failing-ui-tests-without-128bit-integers.txt >> tests/failing-ui-tests.txt
- name: Check out rust-lang/rust
if: ${{ contains(matrix.commands, '-rustc') }}
uses: ./.github/actions/checkout-rust
- name: Run tests
run: |
./y.sh test --release --clean --build-sysroot --no-builtins-tests ${{ matrix.commands }}
duplicates:
runs-on: ubuntu-26.04
steps:
- uses: actions/checkout@v7
- run: python tools/check_intrinsics_duplicates.py
build_system:
runs-on: ubuntu-26.04
steps:
- uses: actions/checkout@v7
- name: Test build system
run: |
cd build_system
cargo test
# Summary job for the merge queue.
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
success:
needs: [build, duplicates, build_system]
# We need to ensure this job does *not* get skipped if its dependencies fail,
# because a skipped job is considered a success by GitHub. So we have to
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
# when the workflow is canceled manually.
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
steps:
# Manually check the status of all dependencies. `if: failure()` does not work.
- name: Conclusion
run: |
# Print the dependent jobs to see them in the CI log
jq -C <<< '${{ toJson(needs) }}'
# Check if all jobs that we depend on (in the needs array) were successful.
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'