tests,misc: Added gem5.fast clang compilation to Kokoro

Compilation issues in Clang and in compiling gem5.fast are normally
only caught during gem5's weekly, intensive, compilation checks:
http://jenkins.gem5.org/job/Compiler-Checks. The purpose of this change
is to have smaller checks on every commit, reducing the chance of
uncompilable code being submitted.

Change-Id: Idd8c6795ff73e21b1814281c31fc7ae39f09dcc5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/37478
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
This commit is contained in:
Bobby R. Bruce
2020-11-13 17:22:58 -08:00
parent 33254218b7
commit 0ff49d741c

View File

@@ -37,7 +37,8 @@
set -e
DOCKER_IMAGE=gcr.io/gem5-test/ubuntu-20.04_all-dependencies
DOCKER_IMAGE_ALL_DEP=gcr.io/gem5-test/ubuntu-20.04_all-dependencies
DOCKER_IMAGE_CLANG_COMPILE=gcr.io/gem5-test/clang-version-9
PRESUBMIT_STAGE2=tests/jenkins/presubmit-stage2.sh
# Move the docker base directory to tempfs.
@@ -49,7 +50,16 @@ sudo /etc/init.d/docker start
# Move the CWD to the gem5 checkout.
cd git/jenkins-gem5-prod/
# Enter a docker image which has all the tools we need, and run the actual
# presubmit tests.
# Using a docker image with all the dependencies, we run the presubmit tests.
docker run -u $UID:$GID --volume $(pwd):$(pwd) -w $(pwd) --rm \
"${DOCKER_IMAGE}" "${PRESUBMIT_STAGE2}"
"${DOCKER_IMAGE_ALL_DEP}" "${PRESUBMIT_STAGE2}"
# DOCKER_IMAGE_ALL_DEP compiles gem5.opt with GCC. We run a compilation of
# gem5.fast on the Clang compiler to ensure changes are compilable with the
# clang compiler. Due to the costs of compilation, we only compile X86
# at this point. Further compiler tests are carried out as part of our weekly
# "Compiler Checks" tests: http://jenkins.gem5.org/job/Compiler-Checks.
rm -rf build
docker run -u $UID:$GID --volume $(pwd):$(pwd) -w $(pwd) --rm \
"${DOCKER_IMAGE_CLANG_COMPILE}" /usr/bin/env python3 /usr/bin/scons \
build/X86/gem5.fast -j4