diff options
author | Sébastien Hinderer <Sebastien.Hinderer@inria.fr> | 2020-08-11 16:03:27 +0200 |
---|---|---|
committer | Sébastien Hinderer <Sebastien.Hinderer@inria.fr> | 2020-08-11 16:03:27 +0200 |
commit | c89c464746709f8373dc7e7a57e8200d79f64e50 (patch) | |
tree | 2e3d86df1b7fc97aa47783f2b7e5da38795ec514 /tools | |
parent | 697242f4b2ae91ca40ab6ee1ea5327bb8fec6d1a (diff) | |
download | ocaml-c89c464746709f8373dc7e7a57e8200d79f64e50.tar.gz |
Split Inria CI's extra-checks job, take #1
This job did actually do two different things:
1. Check that the compiler can be built without the world.opt target
2. Run sanitizers
This commit thus splits the extra-checks job into two separate
ones that are defined as Jenkins pipeline jobs named sanitizers and
step-by-step-build.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/ci/inria/sanitizers/Jenkinsfile | 41 | ||||
-rw-r--r-- | tools/ci/inria/sanitizers/lsan-suppr.txt (renamed from tools/ci/inria/lsan-suppr.txt) | 0 | ||||
-rwxr-xr-x | tools/ci/inria/sanitizers/script (renamed from tools/ci/inria/extra-checks) | 82 | ||||
-rw-r--r-- | tools/ci/inria/step-by-step-build/Jenkinsfile | 44 | ||||
-rwxr-xr-x | tools/ci/inria/step-by-step-build/script | 26 |
5 files changed, 114 insertions, 79 deletions
diff --git a/tools/ci/inria/sanitizers/Jenkinsfile b/tools/ci/inria/sanitizers/Jenkinsfile new file mode 100644 index 0000000000..77dc0e140a --- /dev/null +++ b/tools/ci/inria/sanitizers/Jenkinsfile @@ -0,0 +1,41 @@ +/**************************************************************************/ +/* */ +/* OCaml */ +/* */ +/* Sebastien Hinderer, INRIA Paris */ +/* */ +/* Copyright 2020 Institut National de Recherche en Informatique et */ +/* en Automatique. */ +/* */ +/* All rights reserved. This file is distributed under the terms of */ +/* the GNU Lesser General Public License version 2.1, with the */ +/* special exception on linking described in the file LICENSE. */ +/* */ +/**************************************************************************/ + +/* Pipeline for the sanitizers job on Inria's CI */ + +pipeline { + agent { label 'ocaml-linux-64' } + stages { + stage('Compiling and testing OCaml with sanitizers') { + steps { + sh 'tools/ci/inria/sanitizers/script' + } + } + } + post { + always { + emailext ( + to: 'ocaml-ci-notifications@inria.fr', + subject: 'Job $JOB_NAME $BUILD_STATUS (build #$BUILD_NUMBER)', + body: 'Changes since the last successful build:\n\n' + + '${CHANGES, format="%r %a %m"}\n\n' + + 'See the attached build log or check console output here:\n' + + '$BUILD_URL\n', + /* recipientProviders: [[$class: 'DevelopersRecipientProvider']], */ + attachLog: true + ) + } + } +} diff --git a/tools/ci/inria/lsan-suppr.txt b/tools/ci/inria/sanitizers/lsan-suppr.txt index 160e7fc68b..160e7fc68b 100644 --- a/tools/ci/inria/lsan-suppr.txt +++ b/tools/ci/inria/sanitizers/lsan-suppr.txt diff --git a/tools/ci/inria/extra-checks b/tools/ci/inria/sanitizers/script index 7997dd037d..5f8e5b6e7a 100755 --- a/tools/ci/inria/extra-checks +++ b/tools/ci/inria/sanitizers/script @@ -24,29 +24,8 @@ export OCAMLTEST_SKIP_TESTS="tests/afl-instrumentation/afltest.ml \ tests/runtime-errors/stackoverflow.ml" -# To know the slave's architecture, this script looks at the OCAML_ARCH -# environment variable. For a given node NODE, this variable can be defined -# in Jenkins at the following address: -# https://ci.inria.fr/ocaml/computer/NODE/configure - -# Other environment variables that are honored: -# OCAML_JOBS number of jobs to run in parallel (make -j) - -# Command-line arguments: -# -jNN pass "-jNN" option to make for parallel builds - -error () { - echo "$1" >&2 - exit 3 -} - -arch_error() { - configure_url="https://ci.inria.fr/ocaml/computer/${NODE_NAME}/configure" - msg="Unknown architecture. Make sure the OCAML_ARCH environment" - msg="$msg variable has been defined." - msg="$msg\nSee ${configure_url}" - error "$msg" -} +jobs=-j8 +make=make ######################################################################### @@ -56,39 +35,6 @@ set -x # stop on error set -e -# be considerate towards other potential users of the test machine -case "${OCAML_ARCH}" in - bsd|macos|linux) renice 10 $$ ;; -esac - -# set up variables - -make=make -jobs='' - -case "${OCAML_ARCH}" in - bsd) make=gmake ;; - macos) ;; - linux) ;; - cygwin|cygwin64|mingw|mingw64|msvc|msvc64) - error "Don't run this test under Windows";; - *) arch_error;; -esac - -case "${OCAML_JOBS}" in - [1-9]|[1-9][0-9]) jobs="-j${OCAML_JOBS}" ;; -esac - -# parse optional command-line arguments - -while [ $# -gt 0 ]; do - case $1 in - -j[1-9]|-j[1-9][0-9]) jobs="$1";; - *) error "unknown option $1";; - esac - shift -done - # Tell gcc to use only ASCII in its diagnostic outputs. export LC_ALL=C @@ -108,28 +54,6 @@ export TSAN_SYMBOLIZER_PATH="$ASAN_SYMBOLIZER_PATH" ######################################################################### -# Cleanup repository -git clean -q -f -d -x - -######################################################################### - -echo "======== old school build ==========" - -instdir="$HOME/ocaml-tmp-install-$$" -./configure --prefix "$instdir" --disable-dependency-generation - -# Build the system without using world.opt -make $jobs world -make $jobs opt -make $jobs opt.opt -make install - -rm -rf "$instdir" - -# It's a build system test only, so we don't bother testing the compiler - -######################################################################### - echo "======== clang 9, address sanitizer, UB sanitizer ==========" git clean -q -f -d -x @@ -166,7 +90,7 @@ sanitizers="-fsanitize=address -fsanitize-trap=$ubsan" # 2- add an exception for ocamlyacc, which doesn't free memory OCAMLRUNPARAM="c=1" \ -LSAN_OPTIONS="suppressions=$(pwd)/tools/ci/inria/lsan-suppr.txt" \ +LSAN_OPTIONS="suppressions=$(pwd)/tools/ci/inria/sanitizers/lsan-suppr.txt" \ make $jobs # Run the testsuite. diff --git a/tools/ci/inria/step-by-step-build/Jenkinsfile b/tools/ci/inria/step-by-step-build/Jenkinsfile new file mode 100644 index 0000000000..b2b0d499de --- /dev/null +++ b/tools/ci/inria/step-by-step-build/Jenkinsfile @@ -0,0 +1,44 @@ +/**************************************************************************/ +/* */ +/* OCaml */ +/* */ +/* Sebastien Hinderer, INRIA Paris */ +/* */ +/* Copyright 2020 Institut National de Recherche en Informatique et */ +/* en Automatique. */ +/* */ +/* All rights reserved. This file is distributed under the terms of */ +/* the GNU Lesser General Public License version 2.1, with the */ +/* special exception on linking described in the file LICENSE. */ +/* */ +/**************************************************************************/ + +/* Pipeline for the step-by-step-build job on Inria's CI */ + +/* Build OCaml the legacy way (without using the world.opt target) */ + +pipeline { + agent { label 'ocaml-linux-64' } + stages { + stage('Building the OCaml compiler step by step ' + + + '(without using the world.opt target)') { + steps { + sh 'tools/ci/inria/step-by-step-build/script' + } + } + } + post { + always { + emailext ( + to: 'ocaml-ci-notifications@inria.fr', + subject: 'Job $JOB_NAME $BUILD_STATUS (build #$BUILD_NUMBER)', + body: 'Changes since the last successful build:\n\n' + + '${CHANGES, format="%r %a %m"}\n\n' + + 'See the attached build log or check console output here:\n' + + '$BUILD_URL\n', + /* recipientProviders: [[$class: 'DevelopersRecipientProvider']], */ + attachLog: true + ) + } + } +} diff --git a/tools/ci/inria/step-by-step-build/script b/tools/ci/inria/step-by-step-build/script new file mode 100755 index 0000000000..52d498d6f0 --- /dev/null +++ b/tools/ci/inria/step-by-step-build/script @@ -0,0 +1,26 @@ +#!/bin/sh +#************************************************************************** +#* * +#* OCaml * +#* * +#* Sebastien Hinderer projet Cambium, INRIA Paris * +#* * +#* Copyright 2020 Institut National de Recherche en Informatique et * +#* en Automatique. * +#* * +#* All rights reserved. This file is distributed under the terms of * +#* the GNU Lesser General Public License version 2.1, with the * +#* special exception on linking described in the file LICENSE. * +#* * +#************************************************************************** + +jobs=8 +instdir="$HOME/ocaml-tmp-install-$$" +./configure --prefix "$instdir" --disable-dependency-generation +make $jobs world +make $jobs opt +make $jobs opt.opt +make install +rm -rf "$instdir" +# It's a build system test only, so we don't bother testing the compiler + ''' |