jjb: 32-64 integration pipeline
[lttng-ci.git] / scripts / integration / 32-64 / build.sh
CommitLineData
946bf6a7
JR
1#!/bin/bash
2# shellcheck disable=SC2103
3#
4# Copyright (C) 2022 Jonathan Rajotte-Julien <jonathan.rajotte-julien@efficios.com>
5#
6# This program is free software: you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation, either version 3 of the License, or
9# (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program. If not, see <http://www.gnu.org/licenses/>.
18
19set -eux
20
21BASEDIR_64="$WORKSPACE/deps-64/build"
22BASEDIR_32="$WORKSPACE/deps-32/build"
23export CPPFLAGS="-I$BASEDIR_64/include"
24export LDFLAGS="-L$BASEDIR_64/lib"
25export CFLAGS="-g -O0"
26export CXXFLAGS="-g -O0"
27export PKG_CONFIG_PATH="$BASEDIR_64/lib/pkgconfig"
28export LD_LIBRARY_PATH="$BASEDIR_64/lib:$BASEDIR_32/lib"
29export PATH="$PATH:$BASEDIR_64/bin"
30export BABELTRACE_PLUGIN_PATH="$BASEDIR_64/lib/babeltrace2/plugins/"
31export LIBBABELTRACE2_PLUGIN_PROVIDER_DIR="$BASEDIR_64/lib/babeltrace2/plugin-providers/"
32PREFIX="/build"
33export JAVA_HOME="/usr/lib/jvm/default-java"
34DEPS_JAVA="$WORKSPACE/deps-64/build/share/java"
35export CLASSPATH="$DEPS_JAVA/lttng-ust-agent-all.jar:/usr/share/java/log4j-api.jar:/usr/share/java/log4j-core.jar:/usr/share/java/log4j-1.2.jar"
36export PYTHON2="python2"
37export PYTHON3="python3"
38P2_VERSION=$($PYTHON2 -c "import sys;print(sys.version[:3])")
39P3_VERSION=$($PYTHON3 -c "import sys;print(sys.version[:3])")
40DEPS_PYTHON2="$WORKSPACE/deps-64/build/lib/python$P2_VERSION/site-packages"
41DEPS_PYTHON3="$WORKSPACE/deps-64/build/lib/python$P3_VERSION/site-packages"
42export PYTHONPATH="$DEPS_PYTHON2:$DEPS_PYTHON3"
43export LTTNG_CONSUMERD32_BIN="$BASEDIR_32/lib/lttng/libexec/lttng-consumerd"
44export LTTNG_CONSUMERD32_LIBDIR="$BASEDIR_32/lib"
45export LTTNG_CONSUMERD64_BIN="$BASEDIR_64/lib/lttng/libexec/lttng-consumerd"
46export LTTNG_CONSUMERD64_LIBDIR="$BASEDIR_64/lib/"
47
48# Stable 2.12 and 2.13 still look for "babeltrace"
49ln -s "$BASEDIR_64/bin/babeltrace2" "$BASEDIR_64/bin/babeltrace"
50
51echo "# Setup endpoint
52host_base = obj.internal.efficios.com
53host_bucket = obj.internal.efficios.com
54bucket_location = us-east-1
55use_https = True
56
57# Setup access keys
58access_key = jenkins
59secret_key = echo123456
60
61# Enable S3 v4 signature APIs
62signature_v2 = False" > "$WORKSPACE/.s3cfg"
63
64
65mkdir artefact
66pushd artefact
67s3cmd -c "$WORKSPACE/.s3cfg" get "s3://jenkins/32-64-bit-integration/$ARTIFACT_ID"
68tar -xvf "$ARTIFACT_ID"
69popd
70
71cp -r artefact/sources/* ./
72cp -r artefact/deps/* ./
73
74pushd src/lttng-modules
75make -j"$(nproc)" V=1
76make modules_install
77depmod -a
78popd
79
80pushd src/lttng-tools
81
82./bootstrap
83./configure --prefix="$PREFIX" --enable-test-java-agent-all --enable-test-python-agent-all
84popd
85
86# Deativate health test, simply because there is little value for this integration testing
87# and because de ld_preloaded object is for both lttng-sessiond/consumer leading to difficult ld_preloading
88# Deactivate clock plugin test since the app must load the correct biness so and the sessiond its bitness so,
89# this is simply not feasible from outside the script. There is little value for this test in this testing context.
90pushd src/lttng-tools/tests/regression
91sed -i '/tools\/health\/test_thread_ok/d' Makefile.am
92sed -i '/ust\/clock-override\/test_clock_override/d' Makefile.am
93popd
94
95pushd src/lttng-tools/
96make -j"$(nproc)" V=1
97popd
98
99case "$TEST_TYPE" in
100 "canary")
101 ;;
102 "32bit-sessiond")
103 pushd src/lttng-tools/src/bin/lttng-sessiond
104 rm lttng-sessiond
105 ln -s "$BASEDIR_32/bin/lttng-sessiond" lttng-sessiond
106 popd
107
108 cp -rv "$WORKSPACE/artefact/testing-overlay/sessiond/"* ./
109 ;;
110 "32bit-relayd")
111 pushd src/lttng-tools/src/bin/lttng-relayd
112 rm lttng-relayd
113 ln -s "$BASEDIR_32/bin/lttng-relayd" lttng-relayd
114 popd
115 ;;
116 "32bit-cli")
117 pushd src/lttng-tools/src/bin/lttng
118 rm lttng
119 ln -s "$BASEDIR_32/bin/lttng" lttng
120 popd
121 ;;
122 *)
123 exit 1
124esac
125failed_test=0
126pushd src/lttng-tools/tests
127make --keep-going check || failed_test=1
128popd
129
130exit $failed_test
This page took 0.026324 seconds and 4 git commands to generate.