Repository navigation
227 lines (215 loc) · 7.67 KB
/
Copy pathlibc-fullbuild-tests.yml
File metadata and controls
227 lines (215 loc) · 7.67 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
217
218
219
220
221
222
223
224
225
226
227
# This workflow is for pre-commit testing of the LLVM-libc project.
name: LLVM-libc Pre-commit Fullbuild Tests
permissions:
contents: read
on:
pull_request:
paths:
- 'libc/**'
- '.github/workflows/libc-fullbuild-tests.yml'
jobs:
libc-fullbuild:
if: github.repository_owner == 'llvm'
timeout-minutes: 60
name: libc-fullbuild on ${{ matrix.name }}
runs-on: ${{ matrix.os }}
container:
image: ${{ (startsWith(matrix.os, 'ubuntu-24.04-arm') &&
'ghcr.io/llvm/arm64v8/libc-ubuntu-24.04:latest@sha256:138636a45bb70f7b51a858b282e66291cb3c5c85371afee09032a5e09b263395') ||
'ghcr.io/llvm/libc-ubuntu-24.04:latest@sha256:a902fb53bdad5e4a4bb6c11b6584e717a7b3d6e886f1ea58e11f95e46226249c'}}
# We need to enable privileged containers so that certain libc tests
# have the necessary permissions (like SYS_TIME). There are no security
# implications as we are already running in an isolated VM.
options: >-
--privileged
strategy:
fail-fast: false
matrix:
# Build basic linux configuration with Debug/Release/MinSizeRel and all
# other configurations in Debug only.
include:
- name: linux-x86_64-Debug
os: ubuntu-24.04
build_type: Debug
c_compiler: clang-23
cpp_compiler: clang++-23
target: x86_64-unknown-linux-llvm
include_scudo: ON
testing: BUILD
- name: linux-x86_64-Release
os: ubuntu-24.04
build_type: Release
c_compiler: clang-23
cpp_compiler: clang++-23
target: x86_64-unknown-linux-llvm
include_scudo: ON
build_fuzzing_tests: ON
- name: linux-x86_64-MinSizeRel
os: ubuntu-24.04
build_type: MinSizeRel
c_compiler: clang-23
cpp_compiler: clang++-23
target: x86_64-unknown-linux-llvm
include_scudo: ON
testing: BUILD
- name: linux-aarch64-clang
os: ubuntu-24.04-arm
build_type: Release
c_compiler: clang-23
cpp_compiler: clang++-23
target: aarch64-unknown-linux-llvm
include_scudo: ON
- name: uefi-x86_64-clang
os: ubuntu-24.04
build_type: MinSizeRel
c_compiler: clang-23
cpp_compiler: clang++-23
target: x86_64-unknown-uefi-llvm
testing: SKIP
- name: baremetal-armv6m
os: ubuntu-24.04
build_type: MinSizeRel
c_compiler: clang-23
cpp_compiler: clang++-23
target: armv6m-none-eabi
testing: SKIP
- name: baremetal-armv7m
os: ubuntu-24.04
build_type: MinSizeRel
c_compiler: clang-23
cpp_compiler: clang++-23
target: armv7m-none-eabi
testing: SKIP
- name: baremetal-armv7em
os: ubuntu-24.04
build_type: MinSizeRel
c_compiler: clang-23
cpp_compiler: clang++-23
target: armv7em-none-eabi
testing: SKIP
- name: baremetal-armv8m
os: ubuntu-24.04
build_type: MinSizeRel
c_compiler: clang-23
cpp_compiler: clang++-23
target: armv8m.main-none-eabi
testing: SKIP
- name: baremetal-armv8.1m
os: ubuntu-24.04
build_type: MinSizeRel
c_compiler: clang-23
cpp_compiler: clang++-23
target: armv8.1m.main-none-eabi
testing: SKIP
- name: baremetal-riscv32
os: ubuntu-24.04
build_type: MinSizeRel
c_compiler: clang-23
cpp_compiler: clang++-23
target: riscv32-unknown-elf
testing: SKIP
- name: amd-gpu
os: ubuntu-24.04
build_type: Release
c_compiler: clang-23
cpp_compiler: clang++-23
target: amdgcn-amd-amdhsa
testing: SKIP
# TODO: add back gcc build when it is fixed
# - c_compiler: gcc
# cpp_compiler: g++
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
# Libc's build is relatively small comparing with other components of LLVM.
# A fresh fullbuild takes about 190MiB of uncompressed disk space, which can
# be compressed into ~40MiB. Limiting the cache size to 1G should be enough.
# Prefer sccache as it is more modern.
# Do not use direct GHAC access even though it is supported by sccache. GHAC rejects
# frequent small object writes.
- name: Setup ccache
uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23
with:
max-size: 1G
key: libc_fullbuild_v3_${{ matrix.target }}_${{ matrix.build_type }}_${{ matrix.c_compiler }}
variant: sccache
# Configure libc fullbuild with scudo.
- name: Configure CMake
run: |
export RUNTIMES="libc"
export CMAKE_FLAGS="
-G Ninja
-S /__w/llvm-project/llvm-project/runtimes
-B build
-DCMAKE_ASM_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DCMAKE_C_COMPILER_LAUNCHER=sccache
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
-DLLVM_USE_LINKER=lld-23
-DCMAKE_INSTALL_PREFIX=/__w/llvm-project/llvm-project/install
-DLIBC_COMPILE_OPTIONS_NATIVE=''
"
if [[ "${{ matrix.testing }}" != "SKIP" ]]; then
export CMAKE_FLAGS="$CMAKE_FLAGS
-DLIBC_TEST_SKIP_DEATH_TESTS=ON
-DLIBC_TEST_SKIP_SHARED_TESTS=ON
"
fi
if [[ "${{ matrix.include_scudo }}" == "ON" || "${{ matrix.build_fuzzing_tests }}" == "ON" ]]; then
export RUNTIMES="$RUNTIMES;compiler-rt"
fi
if [[ "${{ matrix.include_scudo }}" == "ON" ]]; then
export CMAKE_FLAGS="$CMAKE_FLAGS
-DLLVM_LIBC_INCLUDE_SCUDO=ON
-DCOMPILER_RT_BUILD_SCUDO_STANDALONE_WITH_LLVM_LIBC=ON
-DCOMPILER_RT_BUILD_GWP_ASAN=OFF
-DCOMPILER_RT_SCUDO_STANDALONE_BUILD_SHARED=OFF"
fi
case "${{ matrix.name }}" in
baremetal-* )
cmake $CMAKE_FLAGS \
-C /__w/llvm-project/llvm-project/libc/cmake/caches/${{ matrix.target }}.cmake
;;
*-gpu | uefi-* )
cmake \
-DLLVM_DEFAULT_TARGET_TRIPLE=${{ matrix.target }} \
-DLIBC_TARGET_TRIPLE=${{ matrix.target }} \
-DLLVM_ENABLE_RUNTIMES="$RUNTIMES" \
-DLLVM_LIBC_FULL_BUILD=ON \
$CMAKE_FLAGS
;;
* )
cmake \
-DLLVM_ENABLE_RUNTIMES="$RUNTIMES" \
-DLLVM_LIBC_FULL_BUILD=ON \
$CMAKE_FLAGS
;;
esac
- name: Build
shell: bash
run: |
TARGETS="install"
if [[ "${{ matrix.build_fuzzing_tests }}" == "ON" ]]; then
TARGETS="$TARGETS libc-fuzzer"
fi
cmake \
--build build \
--parallel \
--target $TARGETS
- name: Build Test
if: ${{ matrix.testing != 'SKIP' }}
run: >
cmake
--build build
--parallel
--target check-libc-build
- name: Run Test
if: ${{ matrix.testing != 'SKIP' && matrix.testing != 'BUILD' }}
run: >
cmake
--build build
--parallel
--target check-libc