From: Michael Jeanson Date: Fri, 21 Aug 2015 21:34:01 +0000 (-0400) Subject: Added babeltrace jobs X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=890bff2382ecd077d009f4315ca2233c0f6f31cd;p=lttng-ci.git Added babeltrace jobs --- diff --git a/jobs/babeltrace.yaml b/jobs/babeltrace.yaml new file mode 100644 index 0000000..333c4f4 --- /dev/null +++ b/jobs/babeltrace.yaml @@ -0,0 +1,222 @@ +- defaults: + name: babeltrace + description: | + The Babeltrace project provides trace read and write libraries, as well + as a trace converter. Plugins can be created for any trace format to + allow its conversion to/from another trace format. + + The main format expected to be converted to/from is the Common Trace + Format (CTF). The default input format of the "babeltrace" command is + CTF, and its default output format is a human-readable text log. The + "babeltrace-log" command converts from a text log to a CTF trace. + +

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: https://github.com/efficios/babeltrace.git + browser: githubweb + browser-url: https://github.com/efficios/babeltrace.git + branches: + - origin/{version} + + triggers: + - pollscm: "@hourly" + + properties: + - github: + url: https://github.com/efficios/babeltrace/ + + +## Templates +- job-template: + name: babeltrace_{version}_{buildtype} + defaults: babeltrace + + project-type: matrix + axes: + - axis: + type: slave + name: arch + values: '{obj:arch}' + - axis: + type: user-defined + name: conf + values: + - std + - static + - python_bindings + - axis: + type: user-defined + name: build + values: + - std + - oot + - dist + + builders: + - shell: + !include-raw-escape scripts/babeltrace/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 + fingerprint: true + +- job-template: + name: babeltrace_{version}_cppcheck + defaults: babeltrace + + triggers: + - pollscm: "@daily" + + builders: + - shell: | + rm -f babeltrace-cppcheck.xml + cppcheck --enable=all --xml --xml-version=2 $WORKSPACE 2> babeltrace-cppcheck.xml + + publishers: + - archive: + artifacts: 'babeltrace-cppcheck.xml' + allow-empty: false + fingerprint: true + - cppcheck: + pattern: 'babeltrace-cppcheck.xml' + - email: + recipients: 'ci-notification@lists.lttng.org' + notify-every-unstable-build: true + send-to-individuals: false + +- job-template: + name: babeltrace_{version}_scan-build + defaults: babeltrace + node: 'x86-64' + + triggers: + - pollscm: "@daily" + + builders: + - shell: + !include-raw-escape scripts/babeltrace/scan-build.sh + + publishers: + - html-publisher: + name: 'HTML Report' + dir: 'scan-build-archive/' + files: 'index.html' + +# TODO: babeltrace_{version}_coverity +#- job-template: +# name: babeltrace_{version}_coverity +# defaults: babeltrace +# node: 'x86-64' +# +# triggers: +# - pollscm: "@daily" +# +# builders: +# - shell: +# !include-raw-escape scripts/babeltrace/coverity.sh +# +# publishers: +# - html-publisher: +# name: 'HTML Report' +# dir: 'scan-build-archive/' +# files: 'index.html' + +- job-template: + name: babeltrace_{version}_pylint + defaults: babeltrace + node: 'x86-64' + + scm: [] + + triggers: + - pollscm: "@daily" + + builders: + - copyartifact: + project: babeltrace-{version}/arch=x86-64,build=std,conf=python_bindings + which-build: last-successful + stable: true + filter: 'build/**' + target: 'dependencies/babeltrace' + - shell: + !include-raw-escape scripts/babeltrace/pylint.sh + + publishers: + - archive: + artifacts: 'pep8.out,pylint.out' + fingerprint: true + - 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 + + +## Job groups +- job-group: + name: 'babeltrace_{version}_build' + buildtype: 'build' + jobs: + - 'babeltrace_{version}_{buildtype}' + +- job-group: + name: 'babeltrace_{version}_portbuild' + buildtype: 'portbuild' + jobs: + - 'babeltrace_{version}_{buildtype}' + +## Project +- project: + name: babeltrace + version: + - stable-1.2 + - master + jobs: + - 'babeltrace_{version}_build': + arch: !!python/tuple [x86-32, x86-64] + - 'babeltrace_{version}_portbuild': + arch: !!python/tuple [armhf, powerpc] + - 'babeltrace_{version}_cppcheck' + - 'babeltrace_{version}_scan-build' + - 'babeltrace_{version}_pylint' + diff --git a/scripts/babeltrace/babeltrace-master.sh b/scripts/babeltrace/babeltrace-master.sh deleted file mode 100755 index eb75863..0000000 --- a/scripts/babeltrace/babeltrace-master.sh +++ /dev/null @@ -1,105 +0,0 @@ -# Create build directory -rm -rf $WORKSPACE/build -mkdir -p $WORKSPACE/build - -PREFIX="$WORKSPACE/build" - -./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" - ;; -*) - 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 -TEST_PLAN_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 - - # Set test plan to dist tar - TEST_PLAN_PATH=$BUILD_PATH - ;; - *) - echo "Standard tree build" - $WORKSPACE/configure --prefix=$PREFIX $CONF_OPTS - ;; -esac - -make -make install - -rm -rf $WORKSPACE/tap -mkdir -p $WORKSPACE/tap - -cd $BUILD_PATH/tests - -# Run make check tests -if [ -e $TEST_PLAN_PATH/tests/tests ]; then - prove --merge --exec '' - < $TEST_PLAN_PATH/tests/tests --archive $WORKSPACE/tap/ || true -else - echo "Missing test plan" - exit 1 -fi - -# TAP plugin is having a hard time with .yml files. -rm -f $WORKSPACE/tap/meta.yml - -# And also with files without extension, so rename all result to *.tap -find $WORKSPACE/tap/ -type f -exec mv {} {}.tap \; - -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 {} \; - -if [ $build = "dist" ]; then - rm -rf $BUILD_PATH -fi diff --git a/scripts/babeltrace/babeltrace-stable-1.0.sh b/scripts/babeltrace/babeltrace-stable-1.0.sh deleted file mode 100755 index 8391abe..0000000 --- a/scripts/babeltrace/babeltrace-stable-1.0.sh +++ /dev/null @@ -1,53 +0,0 @@ -# Create build directory -rm -rf $WORKSPACE/build -mkdir -p $WORKSPACE/build - -PREFIX="$WORKSPACE/build" - -./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" - ;; -*) - echo "Standard build" - CONF_OPTS="" - ;; -esac - -./configure --prefix=$PREFIX $CONF_OPTS - -make -make install - -rm -rf $WORKSPACE/tap -mkdir -p $WORKSPACE/tap - -cd $WORKSPACE/tests - -# Run make check tests -prove --merge --exec '' - < $WORKSPACE/tests/tests --archive $WORKSPACE/tap/ || true - -# TAP plugin is having a hard time with .yml files. -rm -f $WORKSPACE/tap/meta.yml - -# And also with files without extension, so rename all result to *.tap -find $WORKSPACE/tap/ -type f -exec mv {} {}.tap \; - -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 {} \; diff --git a/scripts/babeltrace/babeltrace-stable-1.1.sh b/scripts/babeltrace/babeltrace-stable-1.1.sh deleted file mode 100755 index 8391abe..0000000 --- a/scripts/babeltrace/babeltrace-stable-1.1.sh +++ /dev/null @@ -1,53 +0,0 @@ -# Create build directory -rm -rf $WORKSPACE/build -mkdir -p $WORKSPACE/build - -PREFIX="$WORKSPACE/build" - -./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" - ;; -*) - echo "Standard build" - CONF_OPTS="" - ;; -esac - -./configure --prefix=$PREFIX $CONF_OPTS - -make -make install - -rm -rf $WORKSPACE/tap -mkdir -p $WORKSPACE/tap - -cd $WORKSPACE/tests - -# Run make check tests -prove --merge --exec '' - < $WORKSPACE/tests/tests --archive $WORKSPACE/tap/ || true - -# TAP plugin is having a hard time with .yml files. -rm -f $WORKSPACE/tap/meta.yml - -# And also with files without extension, so rename all result to *.tap -find $WORKSPACE/tap/ -type f -exec mv {} {}.tap \; - -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 {} \; diff --git a/scripts/babeltrace/babeltrace-stable-1.2.sh b/scripts/babeltrace/babeltrace-stable-1.2.sh deleted file mode 100755 index 13c4ec6..0000000 --- a/scripts/babeltrace/babeltrace-stable-1.2.sh +++ /dev/null @@ -1,101 +0,0 @@ -# Create build directory -rm -rf $WORKSPACE/build -mkdir -p $WORKSPACE/build - -PREFIX="$WORKSPACE/build" - -./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" - ;; -*) - 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 - -rm -rf $WORKSPACE/tap -mkdir -p $WORKSPACE/tap - -cd $BUILD_PATH/tests - -# Run make check tests -if [ -e $BUILD_PATH/tests/tests ]; then - prove --merge --exec '' - < $BUILD_PATH/tests/tests --archive $WORKSPACE/tap/ || true -else - echo "Missing test plan" - exit 1 -fi - -# TAP plugin is having a hard time with .yml files. -rm -f $WORKSPACE/tap/meta.yml - -# And also with files without extension, so rename all result to *.tap -find $WORKSPACE/tap/ -type f -exec mv {} {}.tap \; - -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 {} \; - -if [ $build = "dist" ]; then - rm -rf $BUILD_PATH -fi diff --git a/scripts/babeltrace/build.sh b/scripts/babeltrace/build.sh new file mode 100755 index 0000000..e9f06b1 --- /dev/null +++ b/scripts/babeltrace/build.sh @@ -0,0 +1,122 @@ +#!/bin/sh +# +# 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 . + +# Create build directory +rm -rf $WORKSPACE/build +mkdir -p $WORKSPACE/build + +PREFIX="$WORKSPACE/build" + +./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" + ;; +*) + 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 +TEST_PLAN_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 + + # Set test plan to dist tar + TEST_PLAN_PATH=$BUILD_PATH + ;; + *) + echo "Standard tree build" + $WORKSPACE/configure --prefix=$PREFIX $CONF_OPTS + ;; +esac + +make +make install + +rm -rf $WORKSPACE/tap +mkdir -p $WORKSPACE/tap + +cd $BUILD_PATH/tests + +# Run make check tests +if [ -e $TEST_PLAN_PATH/tests/tests ]; then + prove --merge --exec '' - < $TEST_PLAN_PATH/tests/tests --archive $WORKSPACE/tap/ || true +else + echo "Missing test plan" + exit 1 +fi + +# TAP plugin is having a hard time with .yml files. +rm -f $WORKSPACE/tap/meta.yml + +# And also with files without extension, so rename all result to *.tap +find $WORKSPACE/tap/ -type f -exec mv {} {}.tap \; + +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 {} \; + +if [ $build = "dist" ]; then + rm -rf $BUILD_PATH +fi diff --git a/scripts/babeltrace/pylint.sh b/scripts/babeltrace/pylint.sh new file mode 100644 index 0000000..0971938 --- /dev/null +++ b/scripts/babeltrace/pylint.sh @@ -0,0 +1,36 @@ +#!/bin/sh +# +# Copyright (C) 2015 - 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 . + +BABELTRACE_DIR="dependencies/babeltrace/build" +BINDINGS_DIR="$BABELTRACE_DIR/lib/python3.4/dist-packages/babeltrace" + +PYENV_HOME="$WORKSPACE/.pyenv/" + +# Delete previously built virtualenv +if [ -d $PYENV_HOME ]; then + rm -rf $PYENV_HOME +fi + +# Create virtualenv and install necessary packages +virtualenv --system-site-packages -p python3 $PYENV_HOME +. $PYENV_HOME/bin/activate +pip install --quiet pylint +pip install --quiet pep8 + +pep8 --exclude="nativebt.py" $BINDINGS_DIR | tee pep8.out + +pylint -f parseable --ignore="nativebt.py" $BINDINGS_DIR | tee pylint.out diff --git a/scripts/babeltrace/scan-build.sh b/scripts/babeltrace/scan-build.sh new file mode 100644 index 0000000..ed80c0e --- /dev/null +++ b/scripts/babeltrace/scan-build.sh @@ -0,0 +1,66 @@ +#!/bin/sh +# +# 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 . + + +# do not exit immediately if any command fails +set +e + +# 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 + +export CFLAGS="-O0 -g -DDEBUG" +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 +SCAN_BUILD_REPORT=$( find ${SCAN_BUILD_TMPDIR} -maxdepth 1 -not -empty -not -name `basename ${SCAN_BUILD_TMPDIR}` ) +rc=$? + +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}