Commit | Line | Data |
---|---|---|
439ed62c MJ |
1 | #!groovy |
2 | ||
3 | pipeline { | |
4 | agent none | |
5 | ||
6 | /* Global options for the pipeline */ | |
7 | options { | |
8 | preserveStashes() | |
9 | buildDiscarder(logRotator(numToKeepStr: '5')) | |
10 | timeout(time: 2, unit: 'HOURS') | |
11 | disableConcurrentBuilds() | |
12 | timestamps() | |
13 | skipDefaultCheckout() | |
14 | } | |
15 | ||
16 | triggers { | |
17 | pollSCM('@hourly') | |
18 | } | |
19 | ||
20 | /* Top level sequential stages */ | |
21 | stages { | |
22 | ||
23 | /* First level stage */ | |
24 | stage('Prepare targets') { | |
25 | agent { label 'amd64' } | |
26 | ||
27 | stages { | |
28 | stage('Checkout sources') { | |
29 | steps { | |
30 | cleanWs() | |
31 | ||
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']]]) | |
34 | } | |
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']]]) | |
37 | } | |
38 | ||
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']]]) | |
41 | } | |
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']]]) | |
44 | } | |
45 | ||
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']]]) | |
48 | } | |
49 | } | |
50 | } | |
51 | ||
52 | stage('Generate UST 2.12 targets') { | |
53 | environment { | |
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" | |
59 | } | |
60 | ||
61 | steps { | |
62 | // Create empty include dir to make gcc '-Wmissing-include-dirs' happy | |
63 | sh 'mkdir -p "$TARGETS/$CUR_TARGET/include"' | |
64 | ||
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' | |
68 | } | |
69 | ||
70 | // Add symlink from babeltrace2 to babeltrace | |
71 | dir("$TARGETS/$CUR_TARGET/bin") { | |
72 | sh 'ln -s babeltrace2 babeltrace' | |
73 | } | |
74 | ||
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' | |
78 | } | |
79 | ||
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' | |
83 | } | |
84 | ||
85 | // Make a copy of the ust 2.12 target with only urcu 0.9 | |
86 | dir("$TARGETS") { | |
87 | sh 'cp -dpr "$CUR_TARGET" "ust-2.12-urcu-0.9"' | |
88 | } | |
89 | ||
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*' | |
93 | } | |
94 | ||
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' | |
98 | } | |
99 | ||
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"' | |
102 | ||
103 | dir("$TARGETS") { | |
104 | ||
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 | |
108 | ||
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 | |
113 | } | |
114 | } | |
115 | } | |
116 | ||
117 | stage('Generate UST 2.13 target') { | |
118 | environment { | |
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" | |
125 | } | |
126 | ||
127 | steps { | |
128 | // Create empty include dir to make gcc '-Wmissing-include-dirs' happy | |
129 | sh 'mkdir -p "$TARGETS/$CUR_TARGET/include"' | |
130 | ||
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' | |
134 | } | |
135 | ||
136 | // Add symlink from babeltrace2 to babeltrace | |
137 | dir("$TARGETS/$CUR_TARGET/bin") { | |
138 | sh 'ln -s babeltrace2 babeltrace' | |
139 | } | |
140 | ||
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' | |
144 | } | |
145 | ||
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' | |
149 | } | |
150 | ||
151 | // Archive the target | |
152 | dir("$TARGETS") { | |
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 | |
156 | } | |
157 | } | |
158 | } | |
159 | } | |
160 | } | |
161 | ||
162 | /* First level stage */ | |
163 | stage('Test tools 2.12 / 2.13 in parallel') { | |
164 | parallel { | |
165 | // Parallel stage for tools 2.12 | |
166 | stage('Test tools 2.12') { | |
167 | agent { label 'amd64' } | |
168 | ||
169 | environment { | |
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" | |
179 | } | |
180 | ||
181 | stages { | |
182 | stage('Checkout tools 2.12 sources') { | |
183 | steps { | |
184 | cleanWs() | |
185 | ||
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']]]) | |
188 | } | |
189 | } | |
190 | } | |
191 | ||
192 | stage('Unstash targets') { | |
193 | steps { | |
194 | dir("$TARGETS") { | |
195 | unstash name: "ust-2.12-urcu-0.9" | |
196 | unstash name: "ust-2.12-urcu-0.12" | |
197 | } | |
198 | } | |
199 | } | |
200 | ||
201 | stage('Build tools 2.12') { | |
202 | steps { | |
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"' | |
205 | ||
206 | // Build tools 2.12 | |
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' | |
210 | } | |
211 | ||
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"' | |
214 | ||
215 | // Rebuild the testapps with ust 2.12 urcu 0.9 | |
216 | dir("src/tools/stable-2.12/tests") { | |
217 | sh ''' | |
218 | for dir in utils/testapp regression/tools/filtering regression/ust; do | |
219 | cd $dir | |
220 | make clean | |
221 | make -j"$(nproc)" V=1 | |
222 | cd - | |
223 | done''' | |
224 | } | |
225 | ||
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"' | |
228 | ||
229 | } | |
230 | } | |
231 | ||
232 | stage('Run tools 2.12 tests') { | |
233 | steps { | |
234 | // Run the 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"' | |
239 | } | |
240 | ||
241 | // Clean target | |
242 | sh 'rm -f "$TARGETS/$CUR_TARGET"' | |
243 | } | |
244 | } | |
245 | } | |
246 | ||
247 | post { | |
248 | always { | |
0fa108e1 | 249 | recordIssues skipBlames: true, tools: [gcc(id: "gcc-ust-212")] |
439ed62c MJ |
250 | step([$class: 'TapPublisher', testResults: 'tap/**/*.log', verbose: true, failIfNoResults: true, failedTestsMarkBuildAsFailure: true, planRequired: true]) |
251 | archiveArtifacts artifacts: 'tap/**', fingerprint: false | |
252 | } | |
253 | cleanup { | |
254 | cleanWs cleanWhenFailure: false | |
255 | } | |
256 | } | |
257 | } | |
258 | ||
259 | // Parallel stage for tools 2.13 | |
260 | stage('Test tools 2.13') { | |
261 | agent { label 'amd64' } | |
262 | ||
263 | environment { | |
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" | |
273 | } | |
274 | ||
275 | stages { | |
276 | stage('Checkout tools 2.13 sources') { | |
277 | steps { | |
278 | cleanWs() | |
279 | ||
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']]]) | |
282 | } | |
283 | } | |
284 | } | |
285 | ||
286 | stage('Unstash targets') { | |
287 | steps { | |
288 | dir("$TARGETS") { | |
289 | unstash name: "ust-2.12-urcu-0.9" | |
290 | unstash name: "ust-2.13" | |
291 | } | |
292 | } | |
293 | } | |
294 | ||
295 | stage('Build tools 2.13') { | |
296 | steps { | |
297 | // Restore the ust-2.13 target | |
298 | sh 'ln -sf "$TARGETS/ust-2.13" "$TARGETS/$CUR_TARGET"' | |
299 | ||
300 | // Disable regression tests that don't apply to ust 2.12 | |
301 | dir("src/tools/stable-2.13/tests/regression") { | |
302 | sh ''' | |
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 | |
319 | ||
320 | sed -i 's/\\(tools\\/clear\\/test_kernel\\) \\\\/\\1/' Makefile.am | |
321 | sed -i 's/\\(tools\\/relayd-grouping\\/test_ust\\) \\\\/\\1/' Makefile.am | |
322 | ''' | |
323 | } | |
324 | ||
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' | |
329 | } | |
330 | ||
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"' | |
333 | ||
334 | // Rebuild the testapps with ust 2.12 | |
335 | dir("src/tools/stable-2.13/tests") { | |
336 | sh ''' | |
337 | for dir in utils/testapp regression/tools/filtering regression/ust; do | |
338 | cd $dir | |
339 | find . -name Makefile | xargs sed -i "s/-llttng-ust-common//" | |
340 | make clean | |
341 | make -j"$(nproc)" V=1 | |
342 | cd - | |
343 | done''' | |
344 | } | |
345 | ||
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/"' | |
349 | } | |
350 | } | |
351 | ||
352 | stage('Run tools 2.13 tests') { | |
353 | steps { | |
354 | // Run the regression tests | |
355 | dir("src/tools/stable-2.13/tests/regression") { | |
356 | sh 'make --keep-going check || true' | |
357 | } | |
358 | ||
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"' | |
363 | } | |
364 | ||
365 | // Clean target | |
366 | sh 'rm -f "$TARGETS/$CUR_TARGET"' | |
367 | } | |
368 | } | |
369 | } | |
370 | ||
371 | post { | |
372 | always { | |
0fa108e1 | 373 | recordIssues skipBlames: true, tools: [gcc(id: "gcc-ust-213")] |
439ed62c MJ |
374 | step([$class: 'TapPublisher', testResults: 'tap/**/*.log', verbose: true, failIfNoResults: true, failedTestsMarkBuildAsFailure: true, planRequired: true]) |
375 | archiveArtifacts artifacts: 'tap/**', fingerprint: false | |
376 | } | |
377 | cleanup { | |
378 | cleanWs cleanWhenFailure: false | |
379 | } | |
380 | } | |
381 | } | |
382 | } | |
383 | } | |
384 | } | |
385 | } |