From b4005bbf43fd72200b510910629c618ccd324508 Mon Sep 17 00:00:00 2001 From: Michael Jeanson Date: Thu, 3 Sep 2015 19:34:29 -0400 Subject: [PATCH] ReAdded lttng-tools jobs --- jobs/lttng-tools.yaml | 385 ++++++++++++++++++ scripts/lttng-tools/build.sh | 177 ++++++++ scripts/lttng-tools/lttng-tools-master.sh | 158 ------- scripts/lttng-tools/lttng-tools-stable-2.5.sh | 158 ------- scripts/lttng-tools/lttng-tools-stable-2.6.sh | 158 ------- scripts/lttng-tools/pylint.sh | 1 + scripts/lttng-tools/scan-build.sh | 77 ++++ 7 files changed, 640 insertions(+), 474 deletions(-) create mode 100644 jobs/lttng-tools.yaml mode change 100644 => 100755 scripts/lttng-tools/build.sh delete mode 100755 scripts/lttng-tools/lttng-tools-master.sh delete mode 100755 scripts/lttng-tools/lttng-tools-stable-2.5.sh delete mode 100755 scripts/lttng-tools/lttng-tools-stable-2.6.sh mode change 100644 => 100755 scripts/lttng-tools/pylint.sh mode change 100644 => 100755 scripts/lttng-tools/scan-build.sh diff --git a/jobs/lttng-tools.yaml b/jobs/lttng-tools.yaml new file mode 100644 index 0000000..e1c4a2b --- /dev/null +++ b/jobs/lttng-tools.yaml @@ -0,0 +1,385 @@ +- defaults: + name: lttng-tools + description: | + The lttng-tools project provides a session daemon (lttng-sessiond) + that acts as a tracing registry, the "lttng" command line for tracing + control, a lttng-ctl library for tracing control and a lttng-relayd + for network streaming. + +

Job is managed by Jenkins Job Builder.

+ + project-type: freestyle + + logrotate: + daysToKeep: -1 + numToKeep: 2 + artifactDaysToKeep: -1 + artifactNumToKeep: -1 + + wrappers: + - workspace-cleanup + - timestamps + - ansicolor + + scm: + - git: + url: git://github.com/lttng/lttng-tools.git + browser: githubweb + browser-url: https://github.com/lttng/lttng-tools + branches: + - origin/{version} + + triggers: + - pollscm: + cron: "@hourly" + + properties: + - github: + url: https://github.com/lttng/lttng-tools + + +## Templates +- job-template: + name: lttng-tools_{version}_{buildtype} + defaults: lttng-tools + + project-type: matrix + node: 'x86-32 || x86-64' # Applies only to matrix flyweight task + execution-strategy: + combination-filter: | + (build=="std") || (liburcu_version=="master") + axes: + - axis: + type: slave + name: arch + values: '{obj:arch}' + - axis: + type: user-defined + name: conf + values: + - std + #- static + - no_ust + - python_bindings + - java_agents + - axis: + type: user-defined + name: liburcu_version + values: '{obj:urcuversion}' + - axis: + type: user-defined + name: babeltrace_version + values: '{obj:babelversion}' + - axis: + type: user-defined + name: build + values: '{obj:build}' + + builders: + - conditional-step: + condition-kind: regex-match + label: '$conf' + regex: (std|static) + on-evaluation-failure: run + steps: + - copyartifact: + project: liburcu_${{liburcu_version}}_{buildtype}/arch=${{arch}},conf=${{conf}},build=std + which-build: last-successful + stable: true + filter: 'build/**' + target: 'deps/liburcu' + do-not-fingerprint: true + - copyartifact: + project: babeltrace_${{babeltrace_version}}_{buildtype}/arch=${{arch}},conf=${{conf}},build=std + which-build: last-successful + stable: true + filter: 'build/**' + target: 'deps/babeltrace' + do-not-fingerprint: true + - copyartifact: + project: lttng-ust_{version}_{buildtype}/liburcu_version=${{liburcu_version}},arch=${{arch}},conf=${{conf}},build=std + which-build: last-successful + stable: true + filter: 'build/**' + target: 'deps/lttng-ust' + do-not-fingerprint: true + - conditional-step: + condition-kind: regex-match + label: '$conf' + regex: (python_bindings|no_ust) + on-evaluation-failure: run + steps: + - copyartifact: + project: liburcu_${{liburcu_version}}_{buildtype}/arch=${{arch}},conf=std,build=std + which-build: last-successful + stable: true + filter: 'build/**' + target: 'deps/liburcu' + do-not-fingerprint: true + - copyartifact: + project: babeltrace_${{babeltrace_version}}_{buildtype}/arch=${{arch}},conf=std,build=std + which-build: last-successful + stable: true + filter: 'build/**' + target: 'deps/babeltrace' + do-not-fingerprint: true + - copyartifact: + project: lttng-ust_{version}_{buildtype}/liburcu_version=${{liburcu_version}},arch=${{arch}},conf=std,build=std + which-build: last-successful + stable: true + filter: 'build/**' + target: 'deps/lttng-ust' + do-not-fingerprint: true + - conditional-step: + condition-kind: regex-match + label: '$conf' + regex: (java_agents) + on-evaluation-failure: run + steps: + - copyartifact: + project: liburcu_${{liburcu_version}}_{buildtype}/arch=${{arch}},conf=std,build=std + which-build: last-successful + stable: true + filter: 'build/**' + target: 'deps/liburcu' + do-not-fingerprint: true + - copyartifact: + project: babeltrace_${{babeltrace_version}}_{buildtype}/arch=${{arch}},conf=std,build=std + which-build: last-successful + stable: true + filter: 'build/**' + target: 'deps/babeltrace' + do-not-fingerprint: true + - copyartifact: + project: lttng-ust_{version}_{buildtype}/liburcu_version=${{liburcu_version}},arch=${{arch}},conf=java-agent,build=std + which-build: last-successful + stable: true + filter: 'build/**' + target: 'deps/lttng-ust' + do-not-fingerprint: true + - shell: + !include-raw-escape scripts/lttng-tools/build.sh + + # TODO: Scan for open tasks + publishers: + - tap: + results: 'tap/**/*.tap' + failed-tests-mark-build-as-failure: true + - warnings: + console-log-parsers: + - 'GNU Make + GNU C Compiler (gcc)' + #total-thresholds: + # failed: + # total-all: 0 + # total-high: 0 + # total-normal: 0 + # total-low: 0 + - archive: + artifacts: 'build/**' + allow-empty: false + - workspace-cleanup + + +- job-template: + name: lttng-tools_{version}_cppcheck + defaults: lttng-tools + + triggers: + - pollscm: + cron: "@daily" + + builders: + - shell: | + rm -f lttng-tools-cppcheck.xml + cppcheck --enable=all --xml --xml-version=2 $WORKSPACE 2> lttng-tools-cppcheck.xml + + publishers: + - archive: + artifacts: 'lttng-tools-cppcheck.xml' + allow-empty: false + - cppcheck: + pattern: 'lttng-tools-cppcheck.xml' + - email: + recipients: 'ci-notification@lists.lttng.org' + notify-every-unstable-build: true + send-to-individuals: false + +- job-template: + name: lttng-tools_{version}_scan-build + defaults: lttng-tools + node: 'x86-64' + + triggers: + - pollscm: + cron: "@daily" + + builders: + - copyartifact: + project: liburcu_{urcuversion}_build/arch=x86-64,conf=std,build=std + which-build: last-successful + stable: true + filter: 'build/**' + target: 'deps/liburcu' + do-not-fingerprint: true + - copyartifact: + project: lttng-ust_{version}_build/liburcu_version={urcuversion},arch=x86-64,conf=std,build=std + which-build: last-successful + stable: true + filter: 'build/**' + target: 'deps/lttng-ust' + do-not-fingerprint: true + - shell: + !include-raw-escape scripts/lttng-tools/scan-build.sh + + publishers: + - html-publisher: + name: 'HTML Report' + dir: 'scan-build-archive/' + files: 'index.html' + +- job-template: + name: lttng-tools_{version}_coverity + defaults: lttng-tools + node: 'x86-64' + + triggers: + - pollscm: + cron: "@daily" + + wrappers: + - workspace-cleanup + - timestamps + - ansicolor: + colormap: xterm + - credentials-binding: + - username-password-separated: + credential-id: lttng-tools_coverity_token + username: COVERITY_SCAN_PROJECT_NAME + password: COVERITY_SCAN_TOKEN + + builders: + - copyartifact: + project: liburcu_master_build/arch=x86-64,conf=std,build=std + which-build: last-successful + stable: true + filter: 'build/**' + target: 'deps/liburcu' + do-not-fingerprint: true + - copyartifact: + project: lttng-ust_{version}_build/liburcu_version={version},arch=x86-64,conf=std,build=std + which-build: last-successful + stable: true + filter: 'build/**' + target: 'deps/lttng-ust' + do-not-fingerprint: true + - shell: + !include-raw-escape scripts/common/coverity.sh + + publishers: + - workspace-cleanup + +# TODO +- job-template: + name: lttng-tools_{version}_pylint + defaults: lttng-tools + node: 'x86-64' + + scm: [] + + triggers: + - pollscm: + cron: "@daily" + + builders: + - copyartifact: + project: lttng-tools-{version}/arch=x86-64,build=std,conf=python-agent + which-build: last-successful + stable: true + filter: 'build/**' + target: 'deps/lttng-tools' + do-not-fingerprint: true + - shell: + !include-raw-escape scripts/lttng-tools/pylint.sh + + publishers: + - archive: + artifacts: 'pep8.out,pylint.out' + - violations: + pep8: + pattern: pep8.out + min: 10 + max: 999 + unstable: 999 + pylint: + pattern: pylint.out + min: 10 + max: 999 + unstable: 999 + - email: + recipients: 'ci-notification@lists.lttng.org' + notify-every-unstable-build: true + send-to-individuals: false + + +## Project +- project: + name: lttng-tools + version: + !include jobs/inc/lttng-tools-versions.yaml.inc + jobs: + - 'lttng-tools_{version}_{buildtype}': + buildtype: build + version: master + arch: !!python/tuple [x86-32, x86-64] + build: !!python/tuple [std, oot, dist] + urcuversion: !!python/tuple [master] + babelversion: !!python/tuple [master] + - 'lttng-tools_{version}_{buildtype}': + buildtype: portbuild + version: master + arch: !!python/tuple [armhf, powerpc] + build: !!python/tuple [std] + urcuversion: !!python/tuple [master] + babelversion: !!python/tuple [master] + - 'lttng-tools_{version}_{buildtype}': + buildtype: build + version: stable-2.7 + arch: !!python/tuple [x86-32, x86-64] + build: !!python/tuple [std, oot, dist] + urcuversion: !!python/tuple [stable-0.8] + babelversion: !!python/tuple [stable-1.2] + - 'lttng-tools_{version}_{buildtype}': + buildtype: portbuild + version: stable-2.7 + arch: !!python/tuple [armhf, powerpc] + build: !!python/tuple [std] + urcuversion: !!python/tuple [stable-0.8] + babelversion: !!python/tuple [stable-1.2] + - 'lttng-tools_{version}_{buildtype}': + buildtype: build + version: stable-2.6 + arch: !!python/tuple [x86-32, x86-64] + build: !!python/tuple [std, oot, dist] + urcuversion: !!python/tuple [stable-0.8] + babelversion: !!python/tuple [stable-1.2] + - 'lttng-tools_{version}_{buildtype}': + buildtype: portbuild + version: stable-2.6 + arch: !!python/tuple [armhf, powerpc] + build: !!python/tuple [std] + urcuversion: !!python/tuple [stable-0.8] + babelversion: !!python/tuple [stable-1.2] + - 'lttng-tools_{version}_cppcheck' + - 'lttng-tools_{version}_scan-build': + version: master + urcuversion: master + - 'lttng-tools_{version}_scan-build': + version: stable-2.7 + urcuversion: stable-0.8 + - 'lttng-tools_{version}_scan-build': + version: stable-2.6 + urcuversion: stable-0.8 + #- 'lttng-tools_{version}_pylint' + - 'lttng-tools_{version}_coverity': + version: master + diff --git a/scripts/lttng-tools/build.sh b/scripts/lttng-tools/build.sh old mode 100644 new mode 100755 index e69de29..b8f6576 --- a/scripts/lttng-tools/build.sh +++ b/scripts/lttng-tools/build.sh @@ -0,0 +1,177 @@ +#!/bin/sh -xue +# +# Copyright (C) 2015 - Jonathan Rajotte-Julien +# Michael Jeanson +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +# Create build directory +rm -rf $WORKSPACE/build +mkdir -p $WORKSPACE/build + +# liburcu +URCU_INCS="$WORKSPACE/deps/liburcu/build/include/" +URCU_LIBS="$WORKSPACE/deps/liburcu/build/lib/" + +# lttng-ust +UST_INCS="$WORKSPACE/deps/lttng-ust/build/include/" +UST_LIBS="$WORKSPACE/deps/lttng-ust/build/lib/" + +# babeltrace +BABEL_INCS="$WORKSPACE/deps/babeltrace/build/include/" +BABEL_LIBS="$WORKSPACE/deps/babeltrace/build/lib/" +BABEL_BINS="$WORKSPACE/deps/babeltrace/build/bin/" + +PREFIX="$WORKSPACE/build" + +if [ "$conf" = "no_ust" ] +then + export CPPFLAGS="-I$URCU_INCS" + export LDFLAGS="-L$URCU_LIBS" + export LD_LIBRARY_PATH="$URCU_LIBS:$BABEL_LIBS:${LD_LIBRARY_PATH:-}" +else + export CPPFLAGS="-I$URCU_INCS -I$UST_INCS" + export LDFLAGS="-L$URCU_LIBS -L$UST_LIBS" + export LD_LIBRARY_PATH="$URCU_LIBS:$UST_LIBS:$BABEL_LIBS:${LD_LIBRARY_PATH:-}" +fi + +./bootstrap + +CONF_OPTS="" +case "$conf" in +static) + echo "Static build" + CONF_OPTS="--enable-static --disable-shared" + ;; +python_bindings) + echo "Build with python bindings" + # We only support bindings built with Python 3 + export PYTHON="python3" + export PYTHON_CONFIG="/usr/bin/python3-config" + CONF_OPTS="--enable-python-bindings" + ;; +no_ust) + echo "Build without UST support" + CONF_OPTS="--disable-lttng-ust" + ;; +*) + echo "Standard build" + CONF_OPTS="" + ;; +esac + +# Build type +# oot : out-of-tree build +# dist: build via make dist +# * : normal tree build +# +# Make sure to move to the build_path and configure +# before continuing + +BUILD_PATH=$WORKSPACE +case "$build" in + oot) + echo "Out of tree build" + BUILD_PATH=$WORKSPACE/oot + mkdir -p $BUILD_PATH + cd $BUILD_PATH + $WORKSPACE/configure --prefix=$PREFIX $CONF_OPTS + ;; + dist) + echo "Distribution out of tree build" + BUILD_PATH=`mktemp -d` + + # Initial configure and generate tarball + ./configure + make dist + + mkdir -p $BUILD_PATH + cp *.tar.* $BUILD_PATH/ + cd $BUILD_PATH + + # Ignore level 1 of tar + tar xvf *.tar.* --strip 1 + + $BUILD_PATH/configure --prefix=$PREFIX $CONF_OPTS + ;; + *) + BUILD_PATH=$WORKSPACE + echo "Standard tree build" + $WORKSPACE/configure --prefix=$PREFIX $CONF_OPTS + ;; +esac + + +make +make install + +# Run tests +# Allow core dumps +ulimit -c unlimited + +chmod +x $BABEL_BINS/babeltrace +export PATH="$PATH:$BABEL_BINS" + +rm -rf $WORKSPACE/tap +mkdir -p $WORKSPACE/tap +mkdir -p $WORKSPACE/tap/unit +mkdir -p $WORKSPACE/tap/fast_regression +mkdir -p $WORKSPACE/tap/with_bindings_regression + +cd $BUILD_PATH/tests + +if [ "$conf" = "std" ] +then + prove --merge --exec '' - < $BUILD_PATH/tests/unit_tests --archive $WORKSPACE/tap/unit/ || true + prove --merge --exec '' - < $BUILD_PATH/tests/fast_regression --archive $WORKSPACE/tap/fast_regression/ || true +fi + +if [ "$conf" = "no_ust" ] +then + # Regression is disabled for now, we need to adjust the testsuite for no ust builds. + echo "Testsuite disabled. See job configuration for more info." +fi + +if [ "$conf" = "python_bindings" ] +then + # Disabled due to race conditions in tests + echo "Testsuite disabled. See job configuration for more info." + prove --merge --exec '' - < $BUILD_PATH/tests/unit_tests --archive $WORKSPACE/tap/unit/ || true + prove --merge --exec '' - < $BUILD_PATH/tests/fast_regression --archive $WORKSPACE/tap/fast_regression/ || true + prove --merge --exec '' - < $BUILD_PATH/tests/with_bindings_regression --archive $WORKSPACE/tap/with_bindings_regression/ || true +fi + +# TAP plugin is having a hard time with .yml files. +rm -f $WORKSPACE/tap/unit/meta.yml +rm -f $WORKSPACE/tap/fast_regression/meta.yml +rm -f $WORKSPACE/tap/with_bindings_regression/meta.yml + +# And also with files without extension, so rename all result to *.tap +find $WORKSPACE/tap/unit/ -type f -exec mv {} {}.tap \; +find $WORKSPACE/tap/fast_regression/ -type f -exec mv {} {}.tap \; +find $WORKSPACE/tap/with_bindings_regression/ -type f -exec mv {} {}.tap \; + +# Cleanup +make clean + +# Cleanup rpath and libtool .la files +find $WORKSPACE/build/bin -executable -type f -exec chrpath --delete {} \; +find $WORKSPACE/build/lib -name "*.so" -exec chrpath --delete {} \; +find $WORKSPACE/build/lib -name "*.la" -exec rm -f {} \; + +# Clean temp dir for dist build +if [ $build = "dist" ]; then + rm -rf $BUILD_PATH +fi diff --git a/scripts/lttng-tools/lttng-tools-master.sh b/scripts/lttng-tools/lttng-tools-master.sh deleted file mode 100755 index 853c9db..0000000 --- a/scripts/lttng-tools/lttng-tools-master.sh +++ /dev/null @@ -1,158 +0,0 @@ -# Create build directory -rm -rf $WORKSPACE/build -mkdir -p $WORKSPACE/build - -# liburcu -URCU_INCS="$WORKSPACE/dependencies/liburcu/build/include/" -URCU_LIBS="$WORKSPACE/dependencies/liburcu/build/lib/" - -# lttng-ust -UST_INCS="$WORKSPACE/dependencies/lttng-ust/build/include/" -UST_LIBS="$WORKSPACE/dependencies/lttng-ust/build/lib/" - -# babeltrace -BABEL_INCS="$WORKSPACE/dependencies/babeltrace/build/include/" -BABEL_LIBS="$WORKSPACE/dependencies/babeltrace/build/lib/" - -PREFIX="$WORKSPACE/build" - -if [ "$conf" = "no_ust" ] -then - export CPPFLAGS="-I$URCU_INCS" - export LDFLAGS="-L$URCU_LIBS" - export LD_LIBRARY_PATH="$URCU_LIBS:$BABEL_LIBS:$LD_LIBRARY_PATH" -else - export CPPFLAGS="-I$URCU_INCS -I$UST_INCS" - export LDFLAGS="-L$URCU_LIBS -L$UST_LIBS" - export LD_LIBRARY_PATH="$URCU_LIBS:$UST_LIBS:$BABEL_LIBS:$LD_LIBRARY_PATH" -fi - -./bootstrap - -CONF_OPTS="" -case "$conf" in -# Currently disabled, ust doesn't seem to be built right for static linking. -#static) -# echo "Static build" -# CONF_OPTS="--enable-static --disable-shared" -# ;; -python_bindings) - echo "Build with python bindings" - # We only support bindings built with Python 3 - export PYTHON="python3" - export PYTHON_CONFIG="/usr/bin/python3-config" - CONF_OPTS="--enable-python-bindings" - ;; -no_ust) - echo "Build without UST support" - CONF_OPTS="--disable-lttng-ust" - ;; -*) - echo "Standard build" - CONF_OPTS="" - ;; -esac - -# Build type -# oot : out-of-tree build -# dist: build via make dist -# * : normal tree build -# -# Make sure to move to the build_path and configure -# before continuing - -BUILD_PATH=$WORKSPACE -case "$build" in - oot) - echo "Out of tree build" - BUILD_PATH=$WORKSPACE/oot - mkdir -p $BUILD_PATH - cd $BUILD_PATH - $WORKSPACE/configure --prefix=$PREFIX $CONF_OPTS - ;; - dist) - echo "Distribution out of tree build" - BUILD_PATH=`mktemp -d` - - # Initial configure and generate tarball - ./configure - make dist - - mkdir -p $BUILD_PATH - cp *.tar.* $BUILD_PATH/ - cd $BUILD_PATH - - # Ignore level 1 of tar - tar xvf *.tar.* --strip 1 - - $BUILD_PATH/configure --prefix=$PREFIX $CONF_OPTS - ;; - *) - BUILD_PATH=$WORKSPACE - echo "Standard tree build" - $WORKSPACE/configure --prefix=$PREFIX $CONF_OPTS - ;; -esac - - -make -make install - -# Run tests -# Allow core dumps -ulimit -c unlimited - -chmod +x $WORKSPACE/dependencies/babeltrace/build/bin/babeltrace -export PATH="$PATH:$WORKSPACE/dependencies/babeltrace/build/bin" - -rm -rf $WORKSPACE/tap -mkdir -p $WORKSPACE/tap -mkdir -p $WORKSPACE/tap/unit -mkdir -p $WORKSPACE/tap/fast_regression -mkdir -p $WORKSPACE/tap/with_bindings_regression - -cd $BUILD_PATH/tests - -if [ "$conf" = "std" ] -then - prove --merge --exec '' - < $BUILD_PATH/tests/unit_tests --archive $WORKSPACE/tap/unit/ || true - prove --merge --exec '' - < $BUILD_PATH/tests/fast_regression --archive $WORKSPACE/tap/fast_regression/ || true -fi - -if [ "$conf" = "no_ust" ] -then - # Regression is disabled for now, we need to adjust the testsuite for no ust builds. - echo "Testsuite disabled. See job configuration for more info." -fi - -if [ "$conf" = "python_bindings" ] -then - # Disabled due to race conditions in tests - echo "Testsuite disabled. See job configuration for more info." - prove --merge --exec '' - < $BUILD_PATH/tests/unit_tests --archive $WORKSPACE/tap/unit/ || true - prove --merge --exec '' - < $BUILD_PATH/tests/fast_regression --archive $WORKSPACE/tap/fast_regression/ || true - prove --merge --exec '' - < $BUILD_PATH/tests/with_bindings_regression --archive $WORKSPACE/tap/with_bindings_regression/ || true -fi - -# TAP plugin is having a hard time with .yml files. -rm -f $WORKSPACE/tap/unit/meta.yml -rm -f $WORKSPACE/tap/fast_regression/meta.yml -rm -f $WORKSPACE/tap/with_bindings_regression/meta.yml - -# And also with files without extension, so rename all result to *.tap -find $WORKSPACE/tap/unit/ -type f -exec mv {} {}.tap \; -find $WORKSPACE/tap/fast_regression/ -type f -exec mv {} {}.tap \; -find $WORKSPACE/tap/with_bindings_regression/ -type f -exec mv {} {}.tap \; - -# Cleanup -make clean - -# Cleanup rpath and libtool .la files -find $WORKSPACE/build/bin -executable -type f -exec chrpath --delete {} \; -find $WORKSPACE/build/lib -name "*.so" -exec chrpath --delete {} \; -find $WORKSPACE/build/lib -name "*.la" -exec rm -f {} \; - -# Clean temp dir for dist build -if [ $build = "dist" ]; then - rm -rf $BUILD_PATH -fi diff --git a/scripts/lttng-tools/lttng-tools-stable-2.5.sh b/scripts/lttng-tools/lttng-tools-stable-2.5.sh deleted file mode 100755 index 853c9db..0000000 --- a/scripts/lttng-tools/lttng-tools-stable-2.5.sh +++ /dev/null @@ -1,158 +0,0 @@ -# Create build directory -rm -rf $WORKSPACE/build -mkdir -p $WORKSPACE/build - -# liburcu -URCU_INCS="$WORKSPACE/dependencies/liburcu/build/include/" -URCU_LIBS="$WORKSPACE/dependencies/liburcu/build/lib/" - -# lttng-ust -UST_INCS="$WORKSPACE/dependencies/lttng-ust/build/include/" -UST_LIBS="$WORKSPACE/dependencies/lttng-ust/build/lib/" - -# babeltrace -BABEL_INCS="$WORKSPACE/dependencies/babeltrace/build/include/" -BABEL_LIBS="$WORKSPACE/dependencies/babeltrace/build/lib/" - -PREFIX="$WORKSPACE/build" - -if [ "$conf" = "no_ust" ] -then - export CPPFLAGS="-I$URCU_INCS" - export LDFLAGS="-L$URCU_LIBS" - export LD_LIBRARY_PATH="$URCU_LIBS:$BABEL_LIBS:$LD_LIBRARY_PATH" -else - export CPPFLAGS="-I$URCU_INCS -I$UST_INCS" - export LDFLAGS="-L$URCU_LIBS -L$UST_LIBS" - export LD_LIBRARY_PATH="$URCU_LIBS:$UST_LIBS:$BABEL_LIBS:$LD_LIBRARY_PATH" -fi - -./bootstrap - -CONF_OPTS="" -case "$conf" in -# Currently disabled, ust doesn't seem to be built right for static linking. -#static) -# echo "Static build" -# CONF_OPTS="--enable-static --disable-shared" -# ;; -python_bindings) - echo "Build with python bindings" - # We only support bindings built with Python 3 - export PYTHON="python3" - export PYTHON_CONFIG="/usr/bin/python3-config" - CONF_OPTS="--enable-python-bindings" - ;; -no_ust) - echo "Build without UST support" - CONF_OPTS="--disable-lttng-ust" - ;; -*) - echo "Standard build" - CONF_OPTS="" - ;; -esac - -# Build type -# oot : out-of-tree build -# dist: build via make dist -# * : normal tree build -# -# Make sure to move to the build_path and configure -# before continuing - -BUILD_PATH=$WORKSPACE -case "$build" in - oot) - echo "Out of tree build" - BUILD_PATH=$WORKSPACE/oot - mkdir -p $BUILD_PATH - cd $BUILD_PATH - $WORKSPACE/configure --prefix=$PREFIX $CONF_OPTS - ;; - dist) - echo "Distribution out of tree build" - BUILD_PATH=`mktemp -d` - - # Initial configure and generate tarball - ./configure - make dist - - mkdir -p $BUILD_PATH - cp *.tar.* $BUILD_PATH/ - cd $BUILD_PATH - - # Ignore level 1 of tar - tar xvf *.tar.* --strip 1 - - $BUILD_PATH/configure --prefix=$PREFIX $CONF_OPTS - ;; - *) - BUILD_PATH=$WORKSPACE - echo "Standard tree build" - $WORKSPACE/configure --prefix=$PREFIX $CONF_OPTS - ;; -esac - - -make -make install - -# Run tests -# Allow core dumps -ulimit -c unlimited - -chmod +x $WORKSPACE/dependencies/babeltrace/build/bin/babeltrace -export PATH="$PATH:$WORKSPACE/dependencies/babeltrace/build/bin" - -rm -rf $WORKSPACE/tap -mkdir -p $WORKSPACE/tap -mkdir -p $WORKSPACE/tap/unit -mkdir -p $WORKSPACE/tap/fast_regression -mkdir -p $WORKSPACE/tap/with_bindings_regression - -cd $BUILD_PATH/tests - -if [ "$conf" = "std" ] -then - prove --merge --exec '' - < $BUILD_PATH/tests/unit_tests --archive $WORKSPACE/tap/unit/ || true - prove --merge --exec '' - < $BUILD_PATH/tests/fast_regression --archive $WORKSPACE/tap/fast_regression/ || true -fi - -if [ "$conf" = "no_ust" ] -then - # Regression is disabled for now, we need to adjust the testsuite for no ust builds. - echo "Testsuite disabled. See job configuration for more info." -fi - -if [ "$conf" = "python_bindings" ] -then - # Disabled due to race conditions in tests - echo "Testsuite disabled. See job configuration for more info." - prove --merge --exec '' - < $BUILD_PATH/tests/unit_tests --archive $WORKSPACE/tap/unit/ || true - prove --merge --exec '' - < $BUILD_PATH/tests/fast_regression --archive $WORKSPACE/tap/fast_regression/ || true - prove --merge --exec '' - < $BUILD_PATH/tests/with_bindings_regression --archive $WORKSPACE/tap/with_bindings_regression/ || true -fi - -# TAP plugin is having a hard time with .yml files. -rm -f $WORKSPACE/tap/unit/meta.yml -rm -f $WORKSPACE/tap/fast_regression/meta.yml -rm -f $WORKSPACE/tap/with_bindings_regression/meta.yml - -# And also with files without extension, so rename all result to *.tap -find $WORKSPACE/tap/unit/ -type f -exec mv {} {}.tap \; -find $WORKSPACE/tap/fast_regression/ -type f -exec mv {} {}.tap \; -find $WORKSPACE/tap/with_bindings_regression/ -type f -exec mv {} {}.tap \; - -# Cleanup -make clean - -# Cleanup rpath and libtool .la files -find $WORKSPACE/build/bin -executable -type f -exec chrpath --delete {} \; -find $WORKSPACE/build/lib -name "*.so" -exec chrpath --delete {} \; -find $WORKSPACE/build/lib -name "*.la" -exec rm -f {} \; - -# Clean temp dir for dist build -if [ $build = "dist" ]; then - rm -rf $BUILD_PATH -fi diff --git a/scripts/lttng-tools/lttng-tools-stable-2.6.sh b/scripts/lttng-tools/lttng-tools-stable-2.6.sh deleted file mode 100755 index 853c9db..0000000 --- a/scripts/lttng-tools/lttng-tools-stable-2.6.sh +++ /dev/null @@ -1,158 +0,0 @@ -# Create build directory -rm -rf $WORKSPACE/build -mkdir -p $WORKSPACE/build - -# liburcu -URCU_INCS="$WORKSPACE/dependencies/liburcu/build/include/" -URCU_LIBS="$WORKSPACE/dependencies/liburcu/build/lib/" - -# lttng-ust -UST_INCS="$WORKSPACE/dependencies/lttng-ust/build/include/" -UST_LIBS="$WORKSPACE/dependencies/lttng-ust/build/lib/" - -# babeltrace -BABEL_INCS="$WORKSPACE/dependencies/babeltrace/build/include/" -BABEL_LIBS="$WORKSPACE/dependencies/babeltrace/build/lib/" - -PREFIX="$WORKSPACE/build" - -if [ "$conf" = "no_ust" ] -then - export CPPFLAGS="-I$URCU_INCS" - export LDFLAGS="-L$URCU_LIBS" - export LD_LIBRARY_PATH="$URCU_LIBS:$BABEL_LIBS:$LD_LIBRARY_PATH" -else - export CPPFLAGS="-I$URCU_INCS -I$UST_INCS" - export LDFLAGS="-L$URCU_LIBS -L$UST_LIBS" - export LD_LIBRARY_PATH="$URCU_LIBS:$UST_LIBS:$BABEL_LIBS:$LD_LIBRARY_PATH" -fi - -./bootstrap - -CONF_OPTS="" -case "$conf" in -# Currently disabled, ust doesn't seem to be built right for static linking. -#static) -# echo "Static build" -# CONF_OPTS="--enable-static --disable-shared" -# ;; -python_bindings) - echo "Build with python bindings" - # We only support bindings built with Python 3 - export PYTHON="python3" - export PYTHON_CONFIG="/usr/bin/python3-config" - CONF_OPTS="--enable-python-bindings" - ;; -no_ust) - echo "Build without UST support" - CONF_OPTS="--disable-lttng-ust" - ;; -*) - echo "Standard build" - CONF_OPTS="" - ;; -esac - -# Build type -# oot : out-of-tree build -# dist: build via make dist -# * : normal tree build -# -# Make sure to move to the build_path and configure -# before continuing - -BUILD_PATH=$WORKSPACE -case "$build" in - oot) - echo "Out of tree build" - BUILD_PATH=$WORKSPACE/oot - mkdir -p $BUILD_PATH - cd $BUILD_PATH - $WORKSPACE/configure --prefix=$PREFIX $CONF_OPTS - ;; - dist) - echo "Distribution out of tree build" - BUILD_PATH=`mktemp -d` - - # Initial configure and generate tarball - ./configure - make dist - - mkdir -p $BUILD_PATH - cp *.tar.* $BUILD_PATH/ - cd $BUILD_PATH - - # Ignore level 1 of tar - tar xvf *.tar.* --strip 1 - - $BUILD_PATH/configure --prefix=$PREFIX $CONF_OPTS - ;; - *) - BUILD_PATH=$WORKSPACE - echo "Standard tree build" - $WORKSPACE/configure --prefix=$PREFIX $CONF_OPTS - ;; -esac - - -make -make install - -# Run tests -# Allow core dumps -ulimit -c unlimited - -chmod +x $WORKSPACE/dependencies/babeltrace/build/bin/babeltrace -export PATH="$PATH:$WORKSPACE/dependencies/babeltrace/build/bin" - -rm -rf $WORKSPACE/tap -mkdir -p $WORKSPACE/tap -mkdir -p $WORKSPACE/tap/unit -mkdir -p $WORKSPACE/tap/fast_regression -mkdir -p $WORKSPACE/tap/with_bindings_regression - -cd $BUILD_PATH/tests - -if [ "$conf" = "std" ] -then - prove --merge --exec '' - < $BUILD_PATH/tests/unit_tests --archive $WORKSPACE/tap/unit/ || true - prove --merge --exec '' - < $BUILD_PATH/tests/fast_regression --archive $WORKSPACE/tap/fast_regression/ || true -fi - -if [ "$conf" = "no_ust" ] -then - # Regression is disabled for now, we need to adjust the testsuite for no ust builds. - echo "Testsuite disabled. See job configuration for more info." -fi - -if [ "$conf" = "python_bindings" ] -then - # Disabled due to race conditions in tests - echo "Testsuite disabled. See job configuration for more info." - prove --merge --exec '' - < $BUILD_PATH/tests/unit_tests --archive $WORKSPACE/tap/unit/ || true - prove --merge --exec '' - < $BUILD_PATH/tests/fast_regression --archive $WORKSPACE/tap/fast_regression/ || true - prove --merge --exec '' - < $BUILD_PATH/tests/with_bindings_regression --archive $WORKSPACE/tap/with_bindings_regression/ || true -fi - -# TAP plugin is having a hard time with .yml files. -rm -f $WORKSPACE/tap/unit/meta.yml -rm -f $WORKSPACE/tap/fast_regression/meta.yml -rm -f $WORKSPACE/tap/with_bindings_regression/meta.yml - -# And also with files without extension, so rename all result to *.tap -find $WORKSPACE/tap/unit/ -type f -exec mv {} {}.tap \; -find $WORKSPACE/tap/fast_regression/ -type f -exec mv {} {}.tap \; -find $WORKSPACE/tap/with_bindings_regression/ -type f -exec mv {} {}.tap \; - -# Cleanup -make clean - -# Cleanup rpath and libtool .la files -find $WORKSPACE/build/bin -executable -type f -exec chrpath --delete {} \; -find $WORKSPACE/build/lib -name "*.so" -exec chrpath --delete {} \; -find $WORKSPACE/build/lib -name "*.la" -exec rm -f {} \; - -# Clean temp dir for dist build -if [ $build = "dist" ]; then - rm -rf $BUILD_PATH -fi diff --git a/scripts/lttng-tools/pylint.sh b/scripts/lttng-tools/pylint.sh old mode 100644 new mode 100755 index e69de29..4640904 --- a/scripts/lttng-tools/pylint.sh +++ b/scripts/lttng-tools/pylint.sh @@ -0,0 +1 @@ +# TODO diff --git a/scripts/lttng-tools/scan-build.sh b/scripts/lttng-tools/scan-build.sh old mode 100644 new mode 100755 index e69de29..bf3c7fa --- a/scripts/lttng-tools/scan-build.sh +++ b/scripts/lttng-tools/scan-build.sh @@ -0,0 +1,77 @@ +#!/bin/sh -exu +# +# Copyright (C) 2015 - Jonathan Rajotte-Julien +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + + +# temp directory to store the scan-build report +SCAN_BUILD_TMPDIR=$( mktemp -d /tmp/scan-build.XXXXXX ) + +# directory to use for archiving the scan-build report +SCAN_BUILD_ARCHIVE="${WORKSPACE}/scan-build-archive" + +# Create build directory +rm -rf $WORKSPACE/build +mkdir -p $WORKSPACE/build + +# liburcu +URCU_INCS="$WORKSPACE/deps/liburcu/build/include/" +URCU_LIBS="$WORKSPACE/deps/liburcu/build/lib/" + +# lttng-ust +UST_INCS="$WORKSPACE/deps/lttng-ust/build/include/" +UST_LIBS="$WORKSPACE/deps/lttng-ust/build/lib/" + +export CFLAGS="-O0 -g -DDEBUG" +export CPPFLAGS="-I$URCU_INCS -I$UST_INCS" +export LDFLAGS="-L$URCU_LIBS -L$UST_LIBS" +export LD_LIBRARY_PATH="$URCU_LIBS:$UST_LIBS:${LD_LIBRARY_PATH:-}" + +PREFIX="$WORKSPACE/build" + +./bootstrap +./configure --prefix=$PREFIX +make clean +# generate the scan-build report +scan-build -k -o ${SCAN_BUILD_TMPDIR} make + +# get the directory name of the report created by scan-build +set +e +SCAN_BUILD_REPORT=$( find ${SCAN_BUILD_TMPDIR} -maxdepth 1 -not -empty -not -name `basename ${SCAN_BUILD_TMPDIR}` ) +rc=$? +set -e + +if [ -z "${SCAN_BUILD_REPORT}" ]; then + echo ">>> No new bugs identified." + echo ">>> No scan-build report has been generated" +else + echo ">>> New scan-build report generated in ${SCAN_BUILD_REPORT}" + + if [ ! -d "${SCAN_BUILD_ARCHIVE}" ]; then + echo ">>> Creating scan-build archive directory" + install -d -o jenkins -g jenkins -m 0755 "${SCAN_BUILD_ARCHIVE}" + else + echo ">>> Removing any previous scan-build reports from ${SCAN_BUILD_ARCHIVE}" + rm -f ${SCAN_BUILD_ARCHIVE}/* + fi + + echo ">>> Archiving scan-build report to ${SCAN_BUILD_ARCHIVE}" + mv ${SCAN_BUILD_REPORT}/* ${SCAN_BUILD_ARCHIVE}/ + + echo ">>> Removing any temporary files and directories" + rm -rf "${SCAN_BUILD_TMPDIR}" +fi + +exit ${rc} -- 2.34.1