From 0ff49d741cb7f1541e822722e0c2a34d14d9b289 Mon Sep 17 00:00:00 2001 From: "Bobby R. Bruce" Date: Fri, 13 Nov 2020 17:22:58 -0800 Subject: [PATCH] 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 Reviewed-by: Bobby R. Bruce Maintainer: Bobby R. Bruce --- tests/jenkins/presubmit.sh | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/tests/jenkins/presubmit.sh b/tests/jenkins/presubmit.sh index 68a73205a..8e76d981d 100755 --- a/tests/jenkins/presubmit.sh +++ b/tests/jenkins/presubmit.sh @@ -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 -- 2.30.2