From 8cc1949be08060a4c55460726ac9261c73c6b018 Mon Sep 17 00:00:00 2001 From: Dylan Simon Date: Fri, 28 May 2021 13:11:47 -0400 Subject: [PATCH] [jenkins] add sanitize platform build --- Dockerfile | 4 ++-- Jenkinsfile | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 99350f0b..10db7447 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,8 +9,8 @@ COPY --chown=build . $SRC/$APPNAME WORKDIR $BUILD/$APPNAME RUN chown build . USER build -ARG BUILD_DOC=0 ARG BUILD_ID -RUN cmake $SRC/$APPNAME -DTRIQS_ROOT=${INSTALL} -DBuild_Documentation=${BUILD_DOC} -DBuild_Deps=Always && make -j2 || make -j1 VERBOSE=1 +ARG CMAKE_ARGS +RUN cmake $SRC/$APPNAME -DTRIQS_ROOT=${INSTALL} -DBuild_Deps=Always $CMAKE_ARGS && make -j2 || make -j1 VERBOSE=1 USER root RUN make install diff --git a/Jenkinsfile b/Jenkinsfile index d48d2d95..75a55903 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -25,7 +25,7 @@ def platforms = [:] /****************** linux builds (in docker) */ /* Each platform must have a cooresponding Dockerfile.PLATFORM in triqs/packaging */ -def dockerPlatforms = ["ubuntu-clang", "ubuntu-gcc"] +def dockerPlatforms = ["ubuntu-clang", "ubuntu-gcc", "sanitize"] /* .each is currently broken in jenkins */ for (int i = 0; i < dockerPlatforms.size(); i++) { def platform = dockerPlatforms[i] @@ -38,7 +38,12 @@ for (int i = 0; i < dockerPlatforms.size(); i++) { mv -f Dockerfile.jenkins Dockerfile """ /* build and tag */ - def img = docker.build("flatironinstitute/${dockerName}:${env.BRANCH_NAME}-${env.STAGE_NAME}", "--build-arg APPNAME=${projectName} --build-arg BUILD_DOC=${platform==documentationPlatform} --build-arg BUILD_ID=${env.BUILD_TAG} .") + def args = '' + if (platform == documentationPlatform) + args = '-DBuild_Documentation=1' + else if (platform == "sanitize") + args = '-DASAN=ON -DUBSAN=ON' + def img = docker.build("flatironinstitute/${dockerName}:${env.BRANCH_NAME}-${env.STAGE_NAME}", "--build-arg APPNAME=${projectName} --build-arg BUILD_ID=${env.BUILD_TAG} --build-arg CMAKE_ARGS='${args}' .") catchError(buildResult: 'UNSTABLE', stageResult: 'UNSTABLE') { img.inside() { sh "make -C \$BUILD/${projectName} test CTEST_OUTPUT_ON_FAILURE=1"