6 /* Global options for the pipeline */
9 buildDiscarder(logRotator(numToKeepStr: '5'))
10 timeout(time: 2, unit: 'HOURS')
11 disableConcurrentBuilds()
20 /* Top level sequential stages */
23 /* First level stage */
24 stage('Prepare targets') {
25 agent { label 'amd64' }
28 stage('Checkout sources') {
32 dir("src/ust/stable-2.12-lower-urcu-dep") {
33 checkout([$class: 'GitSCM', branches: [[name: 'stable-2.12-lower-urcu-dep']], extensions: [], gitTool: 'Default', userRemoteConfigs: [[url: 'https://git.efficios.com/deliverable/lttng-ust.git']]])
35 dir("src/ust/stable-2.13") {
36 checkout([$class: 'GitSCM', branches: [[name: 'stable-2.13']], extensions: [], gitTool: 'Default', userRemoteConfigs: [[url: 'https://github.com/lttng/lttng-ust']]])
39 dir("src/urcu/stable-0.9") {
40 checkout([$class: 'GitSCM', branches: [[name: 'stable-0.9']], extensions: [], gitTool: 'Default', userRemoteConfigs: [[url: 'https://git.lttng.org/userspace-rcu']]])
42 dir("src/urcu/stable-0.12") {
43 checkout([$class: 'GitSCM', branches: [[name: 'stable-0.12']], extensions: [], gitTool: 'Default', userRemoteConfigs: [[url: 'https://github.com/urcu/userspace-rcu']]])
46 dir("src/babeltrace/stable-2.0") {
47 checkout([$class: 'GitSCM', branches: [[name: 'stable-2.0']], extensions: [], gitTool: 'Default', userRemoteConfigs: [[url: 'https://github.com/efficios/babeltrace']]])
52 stage('Generate UST 2.12 targets') {
54 TARGETS = "$WORKSPACE/targets"
55 CUR_TARGET = "current"
56 CPPFLAGS = "-I$TARGETS/$CUR_TARGET/include"
57 LDFLAGS = "-L$TARGETS/$CUR_TARGET/lib"
58 CLASSPATH = "/usr/share/java/log4j-1.2.jar"
62 // Create empty include dir to make gcc '-Wmissing-include-dirs' happy
63 sh 'mkdir -p "$TARGETS/$CUR_TARGET/include"'
65 // Build babeltrace 2.0
66 dir("src/babeltrace/stable-2.0") {
67 sh './bootstrap && ./configure --prefix="$TARGETS/$CUR_TARGET" --disable-static && make -j"$(nproc)" V=1 && make check && make install && find "$TARGETS/$CUR_TARGET" -name "*.la" -delete'
70 // Add symlink from babeltrace2 to babeltrace
71 dir("$TARGETS/$CUR_TARGET/bin") {
72 sh 'ln -s babeltrace2 babeltrace'
75 // Build liburcu 0.9 for ust 2.12
76 dir("src/urcu/stable-0.9") {
77 sh './bootstrap && ./configure --prefix="$TARGETS/$CUR_TARGET" --disable-static && make -j"$(nproc)" V=1 && make check && make install && find "$TARGETS/$CUR_TARGET" -name "*.la" -delete'
80 // Build ust 2.12 against liburcu 0.9
81 dir("src/ust/stable-2.12-lower-urcu-dep") {
82 sh './bootstrap && ./configure --prefix="$TARGETS/$CUR_TARGET" --enable-python-agent --enable-java-agent-all --enable-jni-interface && make -j"$(nproc)" V=1 && make check && make install && find "$TARGETS/$CUR_TARGET" -name "*.la" -delete'
85 // Make a copy of the ust 2.12 target with only urcu 0.9
87 sh 'cp -dpr "$CUR_TARGET" "ust-2.12-urcu-0.9"'
90 // Remove the 'dev' part of liburcu 0.9, keep only the versionned SO
91 dir("$TARGETS/$CUR_TARGET") {
92 sh 'rm -rf "$TARGETS/$CUR_TARGET/include/urcu" && rm -f "$TARGETS/$CUR_TARGET/include/"urcu*.h && rm -f "$TARGETS/$CUR_TARGET/lib/"liburcu*.so && rm -f "$TARGETS/$CUR_TARGET/lib/pkgconfig/"liburcu*'
95 // Build liburcu 0.12 for tools 2.12
96 dir("src/urcu/stable-0.12") {
97 sh './bootstrap && ./configure --prefix="$TARGETS/$CUR_TARGET" --disable-static && make -j"$(nproc)" V=1 && make check && make install && find "$TARGETS/$CUR_TARGET" -name "*.la" -delete'
100 // Copy the liburcu 0.12 runtime SO to the ust-2.12-urcu-0.9 target
101 sh 'cp -dpr "$TARGETS/$CUR_TARGET/lib/"liburcu*.so.6* "$TARGETS/ust-2.12-urcu-0.9/lib"'
105 // Archive the first ust 2.12 target with urcu 0.9 dev+runtime and 0.12 runtime
106 stash name: "ust-2.12-urcu-0.9", includes: 'ust-2.12-urcu-0.9/**'
107 archiveArtifacts artifacts: 'ust-2.12-urcu-0.9/**', fingerprint: false
109 // Archive the second ust 2.12 target with urcu 0.9 runtime and 0.12 dev+runtime
110 sh 'mv "$CUR_TARGET" "ust-2.12-urcu-0.12"'
111 stash name: "ust-2.12-urcu-0.12", includes: 'ust-2.12-urcu-0.12/**'
112 archiveArtifacts artifacts: 'ust-2.12-urcu-0.12/**', fingerprint: false
117 stage('Generate UST 2.13 target') {
119 TARGETS = "$WORKSPACE/targets"
120 CUR_TARGET = "current"
121 CPPFLAGS = "-I$TARGETS/$CUR_TARGET/include"
122 LDFLAGS = "-L$TARGETS/$CUR_TARGET/lib"
123 PKG_CONFIG_PATH = "$TARGETS/$CUR_TARGET/lib/pkgconfig"
124 CLASSPATH = "/usr/share/java/log4j-1.2.jar"
128 // Create empty include dir to make gcc '-Wmissing-include-dirs' happy
129 sh 'mkdir -p "$TARGETS/$CUR_TARGET/include"'
131 // Install babeltrace 2.0 built in the previous stage in a fresh target
132 dir("src/babeltrace/stable-2.0") {
133 sh 'make install && find "$TARGETS/$CUR_TARGET" -name "*.la" -delete'
136 // Add symlink from babeltrace2 to babeltrace
137 dir("$TARGETS/$CUR_TARGET/bin") {
138 sh 'ln -s babeltrace2 babeltrace'
141 // Install liburcu 0.12 built in the previous stage in a fresh target
142 dir("src/urcu/stable-0.12") {
143 sh 'make install && find "$TARGETS/$CUR_TARGET" -name "*.la" -delete'
146 // Build ust 2.13 against liburcu 0.12
147 dir("src/ust/stable-2.13") {
148 sh './bootstrap && ./configure --prefix="$TARGETS/$CUR_TARGET" --enable-python-agent --enable-java-agent-all --enable-jni-interface && make -j"$(nproc)" V=1 && make check && make install && find "$TARGETS/$CUR_TARGET" -name "*.la" -delete'
151 // Archive the target
153 sh 'mv "$CUR_TARGET" "ust-2.13"'
154 stash name: "ust-2.13", includes: "ust-2.13/**"
155 archiveArtifacts artifacts: 'ust-2.13/**', fingerprint: false
162 /* First level stage */
163 stage('Test tools 2.12 / 2.13 in parallel') {
165 // Parallel stage for tools 2.12
166 stage('Test tools 2.12') {
167 agent { label 'amd64' }
170 TARGETS = "$WORKSPACE/targets"
171 CUR_TARGET = "current"
172 CPPFLAGS = "-I$TARGETS/$CUR_TARGET/include"
173 LDFLAGS = "-L$TARGETS/$CUR_TARGET/lib"
174 PKG_CONFIG_PATH = "$TARGETS/$CUR_TARGET/lib/pkgconfig"
175 CLASSPATH = "/usr/share/java/log4j-1.2.jar:$TARGETS/$CUR_TARGET/share/java/*"
176 PYTHONPATH="$TARGETS/$CUR_TARGET/lib/python2.7/site-packages"
177 LD_LIBRARY_PATH="$TARGETS/$CUR_TARGET/lib"
178 PATH="$PATH:$TARGETS/$CUR_TARGET/bin"
182 stage('Checkout tools 2.12 sources') {
186 dir("src/tools/stable-2.12") {
187 checkout([$class: 'GitSCM', branches: [[name: 'stable-2.12']], extensions: [], gitTool: 'Default', userRemoteConfigs: [[url: 'https://github.com/lttng/lttng-tools']]])
192 stage('Unstash targets') {
195 unstash name: "ust-2.12-urcu-0.9"
196 unstash name: "ust-2.12-urcu-0.12"
201 stage('Build tools 2.12') {
203 // Restore the ust-2.12 target with urcu 0.12
204 sh 'ln -sf "$TARGETS/ust-2.12-urcu-0.12" "$TARGETS/$CUR_TARGET"'
207 // --disable-dependency-tracking is important to allow rebuilding only the testapps
208 dir("src/tools/stable-2.12") {
209 sh './bootstrap && ./configure --prefix="$TARGETS/$CUR_TARGET" --enable-test-java-agent-all --enable-python-bindings --disable-dependency-tracking && make -j"$(nproc)" V=1'
212 // Swap the target to ust 2.12 with urcu 0.9
213 sh 'rm -f "$TARGETS/$CUR_TARGET" && ln -sf "$TARGETS/ust-2.12-urcu-0.9" "$TARGETS/$CUR_TARGET"'
215 // Rebuild the testapps with ust 2.12 urcu 0.9
216 dir("src/tools/stable-2.12/tests") {
218 for dir in utils/testapp regression/tools/filtering regression/ust; do
221 make -j"$(nproc)" V=1
226 // Swap back the target to ust 2.12 with urcu 0.12
227 sh 'rm -f "$TARGETS/$CUR_TARGET" && ln -sf "$TARGETS/ust-2.12-urcu-0.12" "$TARGETS/$CUR_TARGET"'
232 stage('Run tools 2.12 tests') {
235 dir("src/tools/stable-2.12") {
236 sh 'make --keep-going check || true'
237 sh 'mkdir -p "$WORKSPACE/tap/ust-2.12"'
238 sh 'rsync -a --exclude "test-suite.log" --include \'*/\' --include \'*.log\' --exclude=\'*\' tests/ "$WORKSPACE/tap/ust-2.12"'
242 sh 'rm -f "$TARGETS/$CUR_TARGET"'
249 recordIssues skipBlames: true, tools: [gcc(id: "gcc-ust-2.12")]
250 step([$class: 'TapPublisher', testResults: 'tap/**/*.log', verbose: true, failIfNoResults: true, failedTestsMarkBuildAsFailure: true, planRequired: true])
251 archiveArtifacts artifacts: 'tap/**', fingerprint: false
254 cleanWs cleanWhenFailure: false
259 // Parallel stage for tools 2.13
260 stage('Test tools 2.13') {
261 agent { label 'amd64' }
264 TARGETS = "$WORKSPACE/targets"
265 CUR_TARGET = "current"
266 CPPFLAGS = "-I$TARGETS/$CUR_TARGET/include"
267 LDFLAGS = "-L$TARGETS/$CUR_TARGET/lib"
268 PKG_CONFIG_PATH = "$TARGETS/$CUR_TARGET/lib/pkgconfig"
269 CLASSPATH = "/usr/share/java/log4j-1.2.jar:$TARGETS/$CUR_TARGET/share/java/*"
270 PYTHONPATH="$TARGETS/$CUR_TARGET/lib/python2.7/site-packages"
271 LD_LIBRARY_PATH="$TARGETS/$CUR_TARGET/lib"
272 PATH="$PATH:$TARGETS/$CUR_TARGET/bin"
276 stage('Checkout tools 2.13 sources') {
280 dir("src/tools/stable-2.13") {
281 checkout([$class: 'GitSCM', branches: [[name: 'stable-2.13']], extensions: [], gitTool: 'Default', userRemoteConfigs: [[url: 'https://git.lttng.org/lttng-tools']]])
286 stage('Unstash targets') {
289 unstash name: "ust-2.12-urcu-0.9"
290 unstash name: "ust-2.13"
295 stage('Build tools 2.13') {
297 // Restore the ust-2.13 target
298 sh 'ln -sf "$TARGETS/ust-2.13" "$TARGETS/$CUR_TARGET"'
300 // Disable regression tests that don't apply to ust 2.12
301 dir("src/tools/stable-2.13/tests/regression") {
303 sed -i '/tools\\/notification\\/test_notification_ust_error/d' Makefile.am
304 sed -i '/tools\\/notification\\/test_notification_ust_capture/d' Makefile.am
305 sed -i '/tools\\/notification\\/test_notification_ust_event_rule_condition_exclusion/d' Makefile.am
306 sed -i '/tools\\/notification\\/test_notification_kernel_error/d' Makefile.am
307 sed -i '/tools\\/notification\\/test_notification_kernel_capture/d' Makefile.am
308 sed -i '/tools\\/notification\\/test_notification_kernel_instrumentation/d' Makefile.am
309 sed -i '/tools\\/notification\\/test_notification_kernel_syscall/d' Makefile.am
310 sed -i '/tools\\/notification\\/test_notification_notifier_discarded_count/d' Makefile.am
311 sed -i '/tools\\/notification\\/test_notification_kernel_userspace_probe/d' Makefile.am
312 sed -i '/tools\\/tracker\\/test_event_tracker/d' Makefile.am
313 sed -i '/tools\\/trigger\\/start-stop\\/test_start_stop/d' Makefile.am
314 sed -i '/tools\\/trigger\\/test_add_trigger_cli/d' Makefile.am
315 sed -i '/tools\\/trigger\\/test_list_triggers_cli/d' Makefile.am
316 sed -i '/tools\\/trigger\\/test_remove_trigger_cli/d' Makefile.am
317 sed -i '/tools\\/trigger\\/name\\/test_trigger_name_backwards_compat/d' Makefile.am
318 sed -i '/tools\\/trigger\\/rate-policy\\/test_ust_rate_policy/d' Makefile.am
320 sed -i 's/\\(tools\\/clear\\/test_kernel\\) \\\\/\\1/' Makefile.am
321 sed -i 's/\\(tools\\/relayd-grouping\\/test_ust\\) \\\\/\\1/' Makefile.am
325 // Build tools 2.13 with ust 2.13
326 // --disable-dependency-tracking is important to allow rebuilding only the testapps with ust 2.12
327 dir("src/tools/stable-2.13") {
328 sh './bootstrap && ./configure --prefix="$TARGETS/$CUR_TARGET" --enable-test-java-agent-all --enable-python-bindings --disable-dependency-tracking && make -j"$(nproc)" V=1'
331 // Swap the target to ust 2.12
332 sh 'rm -f "$TARGETS/$CUR_TARGET" && ln -sf "$TARGETS/ust-2.12-urcu-0.9" "$TARGETS/$CUR_TARGET"'
334 // Rebuild the testapps with ust 2.12
335 dir("src/tools/stable-2.13/tests") {
337 for dir in utils/testapp regression/tools/filtering regression/ust; do
339 find . -name Makefile | xargs sed -i "s/-llttng-ust-common//"
341 make -j"$(nproc)" V=1
346 // Add the ust 2.13 runtime to the target
347 sh 'cp -dp "$TARGETS/ust-2.13/lib/"liblttng-ust-*.so.1* "$TARGETS/$CUR_TARGET/lib/"'
348 sh 'cp -dp "$TARGETS/ust-2.13/lib/"liblttng-ust-ctl.so.5* "$TARGETS/$CUR_TARGET/lib/"'
352 stage('Run tools 2.13 tests') {
354 // Run the regression tests
355 dir("src/tools/stable-2.13/tests/regression") {
356 sh 'make --keep-going check || true'
359 // Archive the tap tests results
360 dir("src/tools/stable-2.13") {
361 sh 'mkdir -p "$WORKSPACE/tap/ust-2.13"'
362 sh 'rsync -a --exclude "test-suite.log" --include \'*/\' --include \'*.log\' --exclude=\'*\' tests/ "$WORKSPACE/tap/ust-2.13"'
366 sh 'rm -f "$TARGETS/$CUR_TARGET"'
373 recordIssues skipBlames: true, tools: [gcc(id: "gcc-ust-2.13")]
374 step([$class: 'TapPublisher', testResults: 'tap/**/*.log', verbose: true, failIfNoResults: true, failedTestsMarkBuildAsFailure: true, planRequired: true])
375 archiveArtifacts artifacts: 'tap/**', fingerprint: false
378 cleanWs cleanWhenFailure: false