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