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.
# 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