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.
master
Sébastien Hinderer 2020-08-11 16:03:27 +02:00
parent 697242f4b2
commit c89c464746
5 changed files with 114 additions and 79 deletions

41
tools/ci/inria/sanitizers/Jenkinsfile vendored Normal file
View File

@ -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
)
}
}
}

View File

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

View File

@ -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
)
}
}
}

View File

@ -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
'''