From 6476f91778e56619abeb66584a9eac4ab8cf3775 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Thu, 25 Apr 2019 11:53:28 -0400 Subject: [PATCH] jjb: Add multi-version clang build to babeltrace Signed-off-by: Michael Jeanson --- jobs/babeltrace.yaml | 41 +++++++++++++++++++--- scripts/babeltrace/build.sh | 69 +++++++++++++++++++++++++++++++++---- 2 files changed, 99 insertions(+), 11 deletions(-) diff --git a/jobs/babeltrace.yaml b/jobs/babeltrace.yaml index bc843f3..0fd4372 100644 --- a/jobs/babeltrace.yaml +++ b/jobs/babeltrace.yaml @@ -69,6 +69,28 @@ name: build values: '{obj:build}' +- babeltrace_build_axes_cc: &babeltrace_build_axes_cc + name: 'babeltrace_build_axes_cc' + project-type: matrix + node: 'master' # Applies only to matrix flyweight task + axes: + - axis: + type: slave + name: arch + values: '{obj:arch}' + - axis: + type: user-defined + name: conf + values: '{obj:conf}' + - axis: + type: user-defined + name: build + values: '{obj:build}' + - axis: + type: user-defined + name: cc + values: '{obj:cc}' + - babeltrace_build_builders_defaults: &babeltrace_build_builders_defaults name: 'babeltrace_build_builders_defaults' builders: @@ -219,6 +241,14 @@ <<: *babeltrace_build_builders_defaults <<: *babeltrace_build_publishers_prod +- job-template: + name: babeltrace_{version}_{cctype} + defaults: babeltrace + + <<: *babeltrace_build_axes_cc + <<: *babeltrace_build_builders_defaults + <<: *babeltrace_build_publishers_prod + - job-template: name: babeltrace_{version}_winbuild defaults: babeltrace @@ -461,11 +491,6 @@ arch: !!python/tuple [amd64] build: !!python/tuple [std, oot, dist] conf: !!python/tuple [std, static, python-bindings] - - 'babeltrace_{version}_{buildtype}': - buildtype: clangbuild - arch: !!python/tuple [amd64] - build: !!python/tuple [clang] - conf: !!python/tuple [std, static] - 'babeltrace_{version}_{buildtype}': buildtype: portbuild arch: !!python/tuple [armhf, arm64, powerpc, ppc64el, i386] @@ -495,6 +520,12 @@ - stable-1.5 - stable-2.0 - master + - 'babeltrace_{version}_{cctype}': + cctype: clangbuild + arch: !!python/tuple [amd64] + build: !!python/tuple [std] + conf: !!python/tuple [std, static] + cc: !!python/tuple [clang-3.9, clang-4.0, clang-6.0, clang-7] - 'babeltrace_{version}_winbuild': arch: !!python/tuple [cygwin, cygwin64, msys2-mingw32, msys2-mingw64] build: !!python/tuple [std] diff --git a/scripts/babeltrace/build.sh b/scripts/babeltrace/build.sh index 85f4a5d..cf49063 100755 --- a/scripts/babeltrace/build.sh +++ b/scripts/babeltrace/build.sh @@ -73,6 +73,7 @@ verne() { arch=${arch:-} conf=${conf:-} build=${build:-} +cc=${cc:-} SRCDIR="$WORKSPACE/src/babeltrace" @@ -86,6 +87,68 @@ mkdir -p "$PREFIX" "$TMPDIR" export TMPDIR export CFLAGS="-g -O2" +# Set compiler variables +case "$cc" in +gcc) + export CC=gcc + export CXX=g++ + ;; +gcc-4.8) + export CC=gcc-4.8 + export CXX=g++-4.8 + ;; +gcc-5) + export CC=gcc-5 + export CXX=g++-5 + ;; +gcc-6) + export CC=gcc-6 + export CXX=g++-6 + ;; +gcc-7) + export CC=gcc-7 + export CXX=g++-7 + ;; +gcc-8) + export CC=gcc-8 + export CXX=g++-8 + ;; +clang) + export CC=clang + export CXX=clang++ + ;; +clang-3.9) + export CC=clang-3.9 + export CXX=clang++-3.9 + ;; +clang-4.0) + export CC=clang-4.0 + export CXX=clang++-4.0 + ;; +clang-5.0) + export CC=clang-5.0 + export CXX=clang++-5.0 + ;; +clang-6.0) + export CC=clang-6.0 + export CXX=clang++-6.0 + ;; +clang-7) + export CC=clang-7 + export CXX=clang++-7 + ;; +*) + if [ "x$cc" != "x" ]; then + export CC="$cc" + fi + ;; +esac + +if [ "x$CC" != "x" ]; then + echo "Selected compiler:" + "$CC" -v +fi + # Set platform variables case "$arch" in sol10-i386) @@ -195,12 +258,6 @@ case "$build" in "$BUILD_PATH/configure" --prefix="$PREFIX" $CONF_OPTS ;; - clang) - echo "LLVM clang build" - export CC=clang - clang -v - "$SRCDIR/configure" --prefix="$PREFIX" $CONF_OPTS - ;; *) echo "Standard in-tree build" "$SRCDIR/configure" --prefix="$PREFIX" $CONF_OPTS -- 2.34.1