@@ -46,7 +46,9 @@ before_script:
46
46
TARGET : " Xtensa;RISCV"
47
47
USE_LINKER : " ld"
48
48
CROSS_BUILD_MINGW : " OFF"
49
+ BUILD_TARGET_LIBS : " OFF"
49
50
RUN_CORE_TESTS : " OFF"
51
+ RUN_PKG_TESTS : " OFF"
50
52
RUN_TARGET_LIB_TESTS : " OFF"
51
53
PACK_TOOLCHAIN : " ON"
52
54
PACK_STANDALONE_LIBS : " ON"
@@ -59,6 +61,7 @@ before_script:
59
61
[ ! -f "${BUILD_DIR}/tests.log" ] || grep -i "internal compiler error\|Killed" ${BUILD_DIR}/tests.log || true
60
62
[ ! -f "${BUILD_DIR}/compiler-rt-tests.log" ] || grep -i "internal compiler error\|Killed" ${BUILD_DIR}/compiler-rt-tests.log || true
61
63
[ ! -f "${BUILD_DIR}/lld-tests.log" ] || grep -i "internal compiler error\|Killed" ${BUILD_DIR}/lld-tests.log || true
64
+ [ ! -f "${BUILD_DIR}/pkg-tests.log" ] || grep -i "internal compiler error\|Killed" ${BUILD_DIR}/pkg-tests.log || true
62
65
fi
63
66
script :
64
67
- *get_toolchain_build_scripts
@@ -72,7 +75,7 @@ before_script:
72
75
# Re-use core tools built in another job.
73
76
# LLVM-xxx
74
77
- >
75
- if [ "${PACK_TARGET_LIBS}" == "ON" ]; then
78
+ if [ "${PACK_TARGET_LIBS}" == "ON" ] || [ "${BUILD_TARGET_LIBS}" == "ON" ] ; then
76
79
echo "Enable target libraries build"
77
80
export USE_LIBC="newlib";
78
81
export USE_LIBCXX="libstdcxx";
@@ -134,6 +137,15 @@ before_script:
134
137
chmod o+w ${BUILD_PATH}/compiler-rt-tests.log;
135
138
runuser -u test_runner -- ninja -C ${BUILD_PATH} check-compiler-rt 2>&1 > ${BUILD_PATH}/compiler-rt-tests.log;
136
139
fi
140
+ if [[ "${RUN_PKG_TESTS}" == "ON" ]]; then
141
+ echo "Run package tests";
142
+ # to avoid test failure "fatal: detected dubious ownership in repository at '/builds/llvm-project'"
143
+ chown -R test_runner $LLVM_PROJECT_PATH;
144
+ touch ${BUILD_PATH}/pkg-tests.log;
145
+ chmod o+w ${BUILD_PATH}/pkg-tests.log;
146
+ runuser -u test_runner -- ninja -C ${BUILD_PATH} check-package-llvm-toolchain 2>&1 > ${BUILD_PATH}/pkg-tests.log;
147
+ chown -R ${CUR_USER} $LLVM_PROJECT_PATH;
148
+ fi
137
149
chown -R ${CUR_USER} ${BUILD_PATH};
138
150
fi
139
151
# pack distro
@@ -167,7 +179,11 @@ before_script:
167
179
ARCHIVE_NAME=$(basename ${DISTRO_PACK_PATH})
168
180
echo "${ARCHIVE_NAME}" > ${PWD}/${DIST_DIR}/target_libs_arch_name
169
181
fi
182
+ - ls -l ${PWD}/${DIST_DIR}
170
183
184
+ # some Clang/LLVM unit tests fail if we build Clang for RISCV+Xtensa only
185
+ # this job is intended to run unit tests only, so it builds Clang with all backends
186
+ # TODO: LLVM-326 and LLVM-401
171
187
build_and_test :
172
188
tags : [ "amd64", "build" ]
173
189
stage : test_build
@@ -209,40 +225,26 @@ build_and_test:
209
225
- runuser -u test_runner -- ninja -C ${BUILD_PATH} check-lld 2>&1 > ${BUILD_PATH}/lld-tests.log;
210
226
- chown -R ${CUR_USER} ${BUILD_PATH};
211
227
212
- test_xesppie :
213
- stage : test
214
- dependencies :
215
- - pack_x86_64-linux-gnu
216
- when : manual
217
- allow_failure : true
218
- only :
219
- - tags
220
- script :
221
- - cd ${DIST_DIR}/
222
- - ls -l
223
- - DISTRO_PACK_FILE=$(cat dist_name_x86_64-linux-gnu)
224
- - tar -xf ${DISTRO_PACK_FILE}
225
- - ls -l
226
- - cd esp-clang
227
- - ls -l
228
- - pwd
229
- - export CC="$(pwd)/bin/clang"
230
- - export OBJDUMP="$(pwd)/bin/llvm-objdump"
231
- - git clone -q --depth=1 "${GITLAB_SSH_SERVER}/idf/esp-compiler-tests.git"
232
- - cd esp-compiler-tests/build-only/xesppie
233
- - ./test_xesppie.py
234
-
235
228
.build_linux-gnu_template :
236
229
extends : .build_toolchain_template
237
230
variables :
238
231
USE_LINKER : " gold"
239
232
233
+ # Actually this job builds and packs distro for x86_64-linux-gnu,
234
+ # but also it runs package tests. So keep it in 'test_build' stage
240
235
build_x86_64-linux-gnu :
241
236
extends : .build_linux-gnu_template
242
- stage : build
237
+ stage : test_build
243
238
variables :
244
239
CONF_HOST : " x86_64-linux-gnu"
245
-
240
+ # Build complete distro it is necessary for running package tests
241
+ BUILD_TARGET_LIBS : " ON"
242
+ RUN_PKG_TESTS : " ON"
243
+
244
+ # Target libs are built in build_x86_64-linux-gnu, but due to artifacts
245
+ # size limit we have to produce target libs archive in this job.
246
+ # Archive with target libs from this job will be used in pack jobs
247
+ # for all platform except for x86_64-linux-gnu.
246
248
build_target_libs :
247
249
extends : .build_linux-gnu_template
248
250
stage : build
@@ -306,7 +308,7 @@ build_aarch64-apple-darwin:
306
308
paths :
307
309
- ${DIST_DIR}/
308
310
when : always
309
- expire_in : 1 day
311
+ expire_in : 3 day
310
312
variables :
311
313
PACK_TOOL : " tar cJf"
312
314
UNPACK_TOOL : " tar xJf"
@@ -328,15 +330,6 @@ build_aarch64-apple-darwin:
328
330
- rm -rf ${DISTRO_PACK_DIR}
329
331
- ls -l
330
332
331
- pack_x86_64-linux-gnu :
332
- extends : .pack_template
333
- needs :
334
- # needs target libs archive from native build job
335
- - job : " build_target_libs"
336
- - job : " build_x86_64-linux-gnu"
337
- variables :
338
- CONF_HOST : " x86_64-linux-gnu"
339
-
340
333
pack_x86_64-w64-mingw32 :
341
334
extends : .pack_template
342
335
needs :
@@ -449,7 +442,7 @@ test_esp_dsp:
449
442
matrix :
450
443
- CHIP : esp32p4
451
444
needs :
452
- - job : " pack_x86_64 -linux-gnu"
445
+ - job : " build_x86_64 -linux-gnu"
453
446
variables :
454
447
# use IDF 'master' from docker image
455
448
TEST_APP_IDF_CUSTOM_BRANCH : " "
@@ -467,6 +460,28 @@ test_esp_dsp:
467
460
- idf.py set-target ${CHIP} 2>&1 | tee ${BUILD_LOG}
468
461
- idf.py build 2>&1 | tee -a ${BUILD_LOG}
469
462
463
+ test_xesppie :
464
+ stage : test
465
+ dependencies :
466
+ - build_x86_64-linux-gnu
467
+ allow_failure : true
468
+ only :
469
+ - tags
470
+ script :
471
+ - cd ${DIST_DIR}/
472
+ - ls -l
473
+ - DISTRO_PACK_FILE=$(cat dist_name_x86_64-linux-gnu)
474
+ - tar -xf ${DISTRO_PACK_FILE}
475
+ - ls -l
476
+ - cd esp-clang
477
+ - ls -l
478
+ - pwd
479
+ - export CC="$(pwd)/bin/clang"
480
+ - export OBJDUMP="$(pwd)/bin/llvm-objdump"
481
+ - git clone -q --depth=1 "${GITLAB_SSH_SERVER}/idf/esp-compiler-tests.git"
482
+ - cd esp-compiler-tests/build-only/xesppie
483
+ - ./test_xesppie.py
484
+
470
485
upload_to_http :
471
486
stage : private_deploy
472
487
when : manual
@@ -476,7 +491,7 @@ upload_to_http:
476
491
# force the fetch strategy to clean old archives up in dist/ dir
477
492
GIT_STRATEGY : fetch
478
493
needs :
479
- - job : pack_x86_64 -linux-gnu
494
+ - job : build_x86_64 -linux-gnu
480
495
script :
481
496
- cit_add_ssh_key "${HTTP_UPLOAD_KEY}"
482
497
# List of archives
@@ -514,7 +529,7 @@ upload_to_github:
514
529
TOOLCHAIN_SHA256_FILE : clang-${CI_COMMIT_TAG}-checksum.sha256
515
530
LIBS_SHA256_FILE : libs-clang-${CI_COMMIT_TAG}-checksum.sha256
516
531
needs :
517
- - job : pack_x86_64 -linux-gnu
532
+ - job : build_x86_64 -linux-gnu
518
533
- job : pack_arm-linux-gnueabihf
519
534
- job : pack_aarch64-linux-gnu
520
535
- job : pack_x86_64-w64-mingw32
0 commit comments