[a63ad80] | 1 | #!groovy
|
---|
| 2 |
|
---|
[7a230fd] | 3 | import groovy.transform.Field
|
---|
| 4 |
|
---|
[29f4fe62] | 5 | //===========================================================================================================
|
---|
[9beae23] | 6 | // Main loop of the compilation
|
---|
[29f4fe62] | 7 | //===========================================================================================================
|
---|
[56a9ce6] | 8 |
|
---|
[85142648] | 9 | node('master') {
|
---|
| 10 | // Globals
|
---|
| 11 | BuildDir = pwd tmp: true
|
---|
| 12 | SrcDir = pwd tmp: false
|
---|
| 13 | Settings = null
|
---|
[1483a16] | 14 | Tools = null
|
---|
[4f9e706] | 15 |
|
---|
[85142648] | 16 | // Local variables
|
---|
| 17 | def err = null
|
---|
| 18 | def log_needed = false
|
---|
[5b8413b4] | 19 |
|
---|
[85142648] | 20 | currentBuild.result = "SUCCESS"
|
---|
[4f9e706] | 21 |
|
---|
[85142648] | 22 | try {
|
---|
| 23 | //Wrap build to add timestamp to command line
|
---|
| 24 | wrap([$class: 'TimestamperBuildWrapper']) {
|
---|
[0ef06b6] | 25 |
|
---|
[85142648] | 26 | Settings = prepare_build()
|
---|
[952ee7a] | 27 |
|
---|
[85142648] | 28 | node(Settings.Architecture.node) {
|
---|
| 29 | BuildDir = pwd tmp: true
|
---|
| 30 | SrcDir = pwd tmp: false
|
---|
[23a14d86] | 31 |
|
---|
[6a531ab] | 32 | Tools.Clean()
|
---|
[7aebc62] | 33 |
|
---|
[6a531ab] | 34 | Tools.Checkout()
|
---|
[fde808df] | 35 |
|
---|
[85142648] | 36 | build()
|
---|
[95fdb0a] | 37 |
|
---|
[85142648] | 38 | test()
|
---|
[95fdb0a] | 39 |
|
---|
[85142648] | 40 | benchmark()
|
---|
[95fdb0a] | 41 |
|
---|
[85142648] | 42 | build_doc()
|
---|
[7359098] | 43 |
|
---|
[85142648] | 44 | publish()
|
---|
| 45 | }
|
---|
[9beae23] | 46 |
|
---|
[85142648] | 47 | // Update the build directories when exiting the node
|
---|
| 48 | BuildDir = pwd tmp: true
|
---|
| 49 | SrcDir = pwd tmp: false
|
---|
[9beae23] | 50 | }
|
---|
[738cf8f] | 51 | }
|
---|
| 52 |
|
---|
[85142648] | 53 | //If an exception is caught we need to change the status and remember to
|
---|
| 54 | //attach the build log to the email
|
---|
| 55 | catch (Exception caughtError) {
|
---|
| 56 | //rethrow error later
|
---|
| 57 | err = caughtError
|
---|
[738cf8f] | 58 |
|
---|
[85142648] | 59 | echo err.toString()
|
---|
[e966ec0] | 60 |
|
---|
[85142648] | 61 | //An error has occured, the build log is relevent
|
---|
| 62 | log_needed = true
|
---|
[9beae23] | 63 |
|
---|
[85142648] | 64 | //Store the result of the build log
|
---|
[27b1ca1] | 65 | currentBuild.result = "${tools.StageName} FAILURE".trim()
|
---|
[85142648] | 66 | }
|
---|
[738cf8f] | 67 |
|
---|
[85142648] | 68 | finally {
|
---|
| 69 | //Send email with final results if this is not a full build
|
---|
| 70 | email(log_needed)
|
---|
[9beae23] | 71 |
|
---|
[85142648] | 72 | echo 'Build Completed'
|
---|
[734891d] | 73 |
|
---|
[85142648] | 74 | /* Must re-throw exception to propagate error */
|
---|
| 75 | if (err) {
|
---|
| 76 | throw err
|
---|
| 77 | }
|
---|
[738cf8f] | 78 | }
|
---|
| 79 | }
|
---|
[29f4fe62] | 80 | //===========================================================================================================
|
---|
[9beae23] | 81 | // Main compilation routines
|
---|
[29f4fe62] | 82 | //===========================================================================================================
|
---|
[95fdb0a] | 83 | def build() {
|
---|
[e507c11] | 84 | debug = true
|
---|
| 85 | release = Settings.RunAllTests || Settings.RunBenchmark
|
---|
[91aa5ab] | 86 | Tools.BuildStage('Build : configure', true) {
|
---|
[dcf1979] | 87 | // Configure must be run inside the tree
|
---|
| 88 | dir (SrcDir) {
|
---|
| 89 | // Generate the necessary build files
|
---|
| 90 | sh './autogen.sh'
|
---|
| 91 | }
|
---|
| 92 |
|
---|
[50f2cfc] | 93 | // Build outside of the src tree to ease cleaning
|
---|
[5b8413b4] | 94 | dir (BuildDir) {
|
---|
[50f2cfc] | 95 | //Configure the conpilation (Output is not relevant)
|
---|
| 96 | //Use the current directory as the installation target so nothing escapes the sandbox
|
---|
| 97 | //Also specify the compiler by hand
|
---|
[3fc5f010] | 98 | targets=""
|
---|
[d4510ea] | 99 | if( Settings.RunAllTests || Settings.RunBenchmark ) {
|
---|
[6bde81d] | 100 | targets="--with-target-hosts='host:debug,host:nodebug'"
|
---|
[3fc5f010] | 101 | } else {
|
---|
[6bde81d] | 102 | targets="--with-target-hosts='host:debug'"
|
---|
[3fc5f010] | 103 | }
|
---|
| 104 |
|
---|
[d21dd3cb] | 105 | ast = Settings.NewAST ? "--enable-new-ast" : "--disable-new-ast"
|
---|
| 106 |
|
---|
| 107 | sh "${SrcDir}/configure CXX=${Settings.Compiler.CXX} CC=${Settings.Compiler.CC} ${Settings.Architecture.flags} AR=gcc-ar RANLIB=gcc-ranlib ${targets} ${ast} --quiet --prefix=${BuildDir}"
|
---|
[f253e4a] | 108 |
|
---|
| 109 | // Configure libcfa
|
---|
[e70e54e] | 110 | sh 'make -j 8 --no-print-directory configure-libcfa'
|
---|
[e507c11] | 111 | }
|
---|
| 112 | }
|
---|
| 113 |
|
---|
[91aa5ab] | 114 | Tools.BuildStage('Build : cfa-cpp', true) {
|
---|
[e507c11] | 115 | // Build outside of the src tree to ease cleaning
|
---|
| 116 | dir (BuildDir) {
|
---|
| 117 | // Build driver
|
---|
| 118 | sh 'make -j 8 --no-print-directory -C driver'
|
---|
| 119 |
|
---|
| 120 | // Build translator
|
---|
| 121 | sh 'make -j 8 --no-print-directory -C src'
|
---|
| 122 | }
|
---|
| 123 | }
|
---|
[1752d0e] | 124 |
|
---|
[91aa5ab] | 125 | Tools.BuildStage('Build : libcfa(debug)', debug) {
|
---|
[e507c11] | 126 | // Build outside of the src tree to ease cleaning
|
---|
| 127 | dir (BuildDir) {
|
---|
| 128 | sh "make -j 8 --no-print-directory -C libcfa/${Settings.Architecture.name}-debug"
|
---|
| 129 | }
|
---|
| 130 | }
|
---|
| 131 |
|
---|
[91aa5ab] | 132 | Tools.BuildStage('Build : libcfa(nodebug)', release) {
|
---|
[e507c11] | 133 | // Build outside of the src tree to ease cleaning
|
---|
| 134 | dir (BuildDir) {
|
---|
| 135 | sh "make -j 8 --no-print-directory -C libcfa/${Settings.Architecture.name}-nodebug"
|
---|
[50f2cfc] | 136 | }
|
---|
[620dd2b] | 137 | }
|
---|
[aa96fba] | 138 |
|
---|
[91aa5ab] | 139 | Tools.BuildStage('Build : install', true) {
|
---|
[aa96fba] | 140 | // Build outside of the src tree to ease cleaning
|
---|
| 141 | dir (BuildDir) {
|
---|
| 142 | sh "make -j 8 --no-print-directory install"
|
---|
| 143 | }
|
---|
| 144 | }
|
---|
[95fdb0a] | 145 | }
|
---|
[24eecab] | 146 |
|
---|
[95fdb0a] | 147 | def test() {
|
---|
[4c1b9ea8] | 148 | try {
|
---|
[91aa5ab] | 149 | Tools.BuildStage('Test: short', !Settings.RunAllTests) {
|
---|
[4c1b9ea8] | 150 | dir (BuildDir) {
|
---|
[3e93c00] | 151 | //Run the tests from the tests directory
|
---|
[4c51aca] | 152 | sh "make --no-print-directory -C tests archiveerrors=${BuildDir}/tests/crashes/short"
|
---|
[3e93c00] | 153 | }
|
---|
[4c1b9ea8] | 154 | }
|
---|
| 155 |
|
---|
[91aa5ab] | 156 | Tools.BuildStage('Test: full', Settings.RunAllTests) {
|
---|
[4c1b9ea8] | 157 | dir (BuildDir) {
|
---|
| 158 | //Run the tests from the tests directory
|
---|
[4c51aca] | 159 | sh """make --no-print-directory -C tests timeouts="--timeout=600 --global-timeout=14400" all-tests debug=yes archiveerrors=${BuildDir}/tests/crashes/full-debug"""
|
---|
| 160 | sh """make --no-print-directory -C tests timeouts="--timeout=600 --global-timeout=14400" all-tests debug=no archiveerrors=${BuildDir}/tests/crashes/full-nodebug"""
|
---|
[143e6f3] | 161 | }
|
---|
[9beae23] | 162 | }
|
---|
[620dd2b] | 163 | }
|
---|
[4c1b9ea8] | 164 | catch (Exception err) {
|
---|
| 165 | echo "Archiving core dumps"
|
---|
[c95fdc9] | 166 | dir (BuildDir) {
|
---|
[62f96ae] | 167 | archiveArtifacts artifacts: "tests/crashes/**/*,lib/**/lib*.so*", fingerprint: true
|
---|
[c95fdc9] | 168 | }
|
---|
[4c1b9ea8] | 169 | throw err
|
---|
| 170 | }
|
---|
[95fdb0a] | 171 | }
|
---|
| 172 |
|
---|
| 173 | def benchmark() {
|
---|
[91aa5ab] | 174 | Tools.BuildStage('Benchmark', Settings.RunBenchmark) {
|
---|
[5b8413b4] | 175 | dir (BuildDir) {
|
---|
[0dc3ac3] | 176 | //Append bench results
|
---|
[c6f1f3e] | 177 | sh "make --no-print-directory -C benchmark jenkins arch=${Settings.Architecture.name}"
|
---|
[0dc3ac3] | 178 | }
|
---|
[620dd2b] | 179 | }
|
---|
[9beae23] | 180 | }
|
---|
[efd60d67] | 181 |
|
---|
[95fdb0a] | 182 | def build_doc() {
|
---|
[91aa5ab] | 183 | Tools.BuildStage('Documentation', Settings.BuildDocumentation) {
|
---|
[9beae23] | 184 | dir ('doc/user') {
|
---|
| 185 | make_doc()
|
---|
| 186 | }
|
---|
| 187 |
|
---|
| 188 | dir ('doc/refrat') {
|
---|
| 189 | make_doc()
|
---|
| 190 | }
|
---|
[620dd2b] | 191 | }
|
---|
[9beae23] | 192 | }
|
---|
| 193 |
|
---|
[95fdb0a] | 194 | def publish() {
|
---|
[91aa5ab] | 195 | Tools.BuildStage('Publish', true) {
|
---|
[95fdb0a] | 196 |
|
---|
[1b3eef8] | 197 | if( Settings.Publish && !Settings.RunBenchmark ) { echo 'No results to publish!!!' }
|
---|
[95fdb0a] | 198 |
|
---|
[3221a2b] | 199 | def groupCompile = new PlotGroup('Compilation', 'duration (s) - lower is better', true)
|
---|
| 200 | def groupConcurrency = new PlotGroup('Concurrency', 'duration (n) - lower is better', false)
|
---|
[a2a0065] | 201 |
|
---|
[3898392] | 202 | //Then publish the results
|
---|
[13d2dac] | 203 | do_plot(Settings.RunBenchmark && Settings.Publish, 'compile' , groupCompile , false, 'Compilation')
|
---|
| 204 | do_plot(Settings.RunBenchmark && Settings.Publish, 'compile.diff' , groupCompile , true , 'Compilation (relative)')
|
---|
| 205 | do_plot(Settings.RunBenchmark && Settings.Publish, 'ctxswitch' , groupConcurrency, false, 'Context Switching')
|
---|
| 206 | do_plot(Settings.RunBenchmark && Settings.Publish, 'ctxswitch.diff' , groupConcurrency, true , 'Context Switching (relative)')
|
---|
| 207 | do_plot(Settings.RunBenchmark && Settings.Publish, 'mutex' , groupConcurrency, false, 'Mutual Exclusion')
|
---|
| 208 | do_plot(Settings.RunBenchmark && Settings.Publish, 'mutex.diff' , groupConcurrency, true , 'Mutual Exclusion (relative)')
|
---|
| 209 | do_plot(Settings.RunBenchmark && Settings.Publish, 'scheduling' , groupConcurrency, false, 'Internal and External Scheduling')
|
---|
| 210 | do_plot(Settings.RunBenchmark && Settings.Publish, 'scheduling.diff', groupConcurrency, true , 'Internal and External Scheduling (relative)')
|
---|
[620dd2b] | 211 | }
|
---|
[95fdb0a] | 212 | }
|
---|
| 213 |
|
---|
[29f4fe62] | 214 | //===========================================================================================================
|
---|
| 215 | //Routine responsible of sending the email notification once the build is completed
|
---|
| 216 | //===========================================================================================================
|
---|
[a336d46] | 217 | //Standard build email notification
|
---|
[13c98a4] | 218 | def email(boolean log) {
|
---|
[a336d46] | 219 | //Since tokenizer doesn't work, figure stuff out from the environnement variables and command line
|
---|
| 220 | //Configurations for email format
|
---|
| 221 | echo 'Notifying users of result'
|
---|
| 222 |
|
---|
| 223 | def project_name = (env.JOB_NAME =~ /(.+)\/.+/)[0][1].toLowerCase()
|
---|
| 224 | def email_subject = "[${project_name} git][BUILD# ${env.BUILD_NUMBER} - ${currentBuild.result}] - branch ${env.BRANCH_NAME}"
|
---|
[13c98a4] | 225 | def email_body = """<p>This is an automated email from the Jenkins build machine. It was
|
---|
[a336d46] | 226 | generated because of a git hooks/post-receive script following
|
---|
[986e260] | 227 | a ref change which was pushed to the C\u2200 repository.</p>
|
---|
[6a531ab] | 228 | """ + Tools.GitLogMessage()
|
---|
[e8a22a7] | 229 |
|
---|
[13c98a4] | 230 | def email_to = !Settings.IsSandbox ? "cforall@lists.uwaterloo.ca" : "tdelisle@uwaterloo.ca"
|
---|
[e8a22a7] | 231 |
|
---|
[13c98a4] | 232 | if( Settings && !Settings.Silent ) {
|
---|
[094a42c] | 233 | //send email notification
|
---|
| 234 | emailext body: email_body, subject: email_subject, to: email_to, attachLog: log
|
---|
| 235 | } else {
|
---|
| 236 | echo "Would send email to: ${email_to}"
|
---|
| 237 | echo "With title: ${email_subject}"
|
---|
| 238 | echo "Content: \n${email_body}"
|
---|
| 239 | }
|
---|
[e8a22a7] | 240 | }
|
---|
[5b8413b4] | 241 |
|
---|
| 242 | //===========================================================================================================
|
---|
| 243 | // Helper classes/variables/routines
|
---|
| 244 | //===========================================================================================================
|
---|
| 245 | //Description of a compiler (Must be serializable since pipelines are persistent)
|
---|
| 246 | class CC_Desc implements Serializable {
|
---|
[93fe3154] | 247 | public String name
|
---|
| 248 | public String CXX
|
---|
[6ebc13f] | 249 | public String CC
|
---|
[bf22bc6] | 250 | public String lto
|
---|
[93fe3154] | 251 |
|
---|
[bf22bc6] | 252 | CC_Desc(String name, String CXX, String CC, String lto) {
|
---|
[93fe3154] | 253 | this.name = name
|
---|
| 254 | this.CXX = CXX
|
---|
[bf22bc6] | 255 | this.CC = CC
|
---|
| 256 | this.lto = lto
|
---|
[5b8413b4] | 257 | }
|
---|
| 258 | }
|
---|
| 259 |
|
---|
| 260 | //Description of an architecture (Must be serializable since pipelines are persistent)
|
---|
| 261 | class Arch_Desc implements Serializable {
|
---|
| 262 | public String name
|
---|
| 263 | public String flags
|
---|
[5307c33] | 264 | public String node
|
---|
[5b8413b4] | 265 |
|
---|
[5307c33] | 266 | Arch_Desc(String name, String flags, String node) {
|
---|
[5b8413b4] | 267 | this.name = name
|
---|
| 268 | this.flags = flags
|
---|
[5307c33] | 269 | this.node = node
|
---|
[5b8413b4] | 270 | }
|
---|
| 271 | }
|
---|
| 272 |
|
---|
| 273 | class BuildSettings implements Serializable {
|
---|
| 274 | public final CC_Desc Compiler
|
---|
| 275 | public final Arch_Desc Architecture
|
---|
[d21dd3cb] | 276 | public final Boolean NewAST
|
---|
[5b8413b4] | 277 | public final Boolean RunAllTests
|
---|
| 278 | public final Boolean RunBenchmark
|
---|
| 279 | public final Boolean BuildDocumentation
|
---|
| 280 | public final Boolean Publish
|
---|
| 281 | public final Boolean Silent
|
---|
| 282 | public final Boolean IsSandbox
|
---|
| 283 | public final String DescLong
|
---|
| 284 | public final String DescShort
|
---|
| 285 |
|
---|
[a336d46] | 286 | public String GitNewRef
|
---|
| 287 | public String GitOldRef
|
---|
| 288 |
|
---|
[490cb3c] | 289 | BuildSettings(java.util.Collections$UnmodifiableMap param, String branch) {
|
---|
[5b8413b4] | 290 | switch( param.Compiler ) {
|
---|
[099f5bd] | 291 | case 'gcc-9':
|
---|
[bf22bc6] | 292 | this.Compiler = new CC_Desc('gcc-9', 'g++-9', 'gcc-9', '-flto=auto')
|
---|
[099f5bd] | 293 | break
|
---|
| 294 | case 'gcc-8':
|
---|
[bf22bc6] | 295 | this.Compiler = new CC_Desc('gcc-8', 'g++-8', 'gcc-8', '-flto=auto')
|
---|
[099f5bd] | 296 | break
|
---|
| 297 | case 'gcc-7':
|
---|
[bf22bc6] | 298 | this.Compiler = new CC_Desc('gcc-7', 'g++-7', 'gcc-7', '-flto=auto')
|
---|
[099f5bd] | 299 | break
|
---|
[5b8413b4] | 300 | case 'gcc-6':
|
---|
[bf22bc6] | 301 | this.Compiler = new CC_Desc('gcc-6', 'g++-6', 'gcc-6', '-flto=auto')
|
---|
[5b8413b4] | 302 | break
|
---|
| 303 | case 'gcc-5':
|
---|
[bf22bc6] | 304 | this.Compiler = new CC_Desc('gcc-5', 'g++-5', 'gcc-5', '-flto=auto')
|
---|
[5b8413b4] | 305 | break
|
---|
| 306 | case 'gcc-4.9':
|
---|
[bf22bc6] | 307 | this.Compiler = new CC_Desc('gcc-4.9', 'g++-4.9', 'gcc-4.9', '-flto=auto')
|
---|
[5b8413b4] | 308 | break
|
---|
| 309 | case 'clang':
|
---|
[391c065] | 310 | this.Compiler = new CC_Desc('clang', 'clang++-10', 'gcc-9', '-flto=thin -flto-jobs=0')
|
---|
[5b8413b4] | 311 | break
|
---|
| 312 | default :
|
---|
| 313 | error "Unhandled compiler : ${cc}"
|
---|
| 314 | }
|
---|
| 315 |
|
---|
| 316 | switch( param.Architecture ) {
|
---|
| 317 | case 'x64':
|
---|
[a3e8281] | 318 | this.Architecture = new Arch_Desc('x64', '--host=x86_64', 'x64')
|
---|
[5b8413b4] | 319 | break
|
---|
| 320 | case 'x86':
|
---|
[a3e8281] | 321 | this.Architecture = new Arch_Desc('x86', '--host=i386', 'x86')
|
---|
[5b8413b4] | 322 | break
|
---|
| 323 | default :
|
---|
| 324 | error "Unhandled architecture : ${arch}"
|
---|
| 325 | }
|
---|
| 326 |
|
---|
[f95e8f0] | 327 | this.IsSandbox = (branch == "jenkins-sandbox")
|
---|
[d21dd3cb] | 328 | this.NewAST = param.NewAST
|
---|
[5b8413b4] | 329 | this.RunAllTests = param.RunAllTests
|
---|
[7a230fd] | 330 | this.RunBenchmark = param.RunBenchmark
|
---|
[5b8413b4] | 331 | this.BuildDocumentation = param.BuildDocumentation
|
---|
[7a230fd] | 332 | this.Publish = param.Publish
|
---|
[5b8413b4] | 333 | this.Silent = param.Silent
|
---|
| 334 |
|
---|
| 335 | def full = param.RunAllTests ? " (Full)" : ""
|
---|
[490cb3c] | 336 | this.DescShort = "${ this.Compiler.name }:${ this.Architecture.name }${full}"
|
---|
[5b8413b4] | 337 |
|
---|
[fe3d9ab] | 338 | final ast = this.NewAST ? "New AST" : "Old AST"
|
---|
[93fe3154] | 339 | this.DescLong = """Compiler : ${ this.Compiler.name } (${ this.Compiler.CXX }/${ this.Compiler.CC })
|
---|
[85799aa] | 340 | AST Version : ${ ast.toString() }
|
---|
[5b8413b4] | 341 | Architecture : ${ this.Architecture.name }
|
---|
| 342 | Arc Flags : ${ this.Architecture.flags }
|
---|
| 343 | Run All Tests : ${ this.RunAllTests.toString() }
|
---|
| 344 | Run Benchmark : ${ this.RunBenchmark.toString() }
|
---|
| 345 | Build Documentation : ${ this.BuildDocumentation.toString() }
|
---|
| 346 | Publish : ${ this.Publish.toString() }
|
---|
| 347 | Silent : ${ this.Silent.toString() }
|
---|
| 348 | """
|
---|
[a336d46] | 349 |
|
---|
| 350 | this.GitNewRef = ''
|
---|
| 351 | this.GitOldRef = ''
|
---|
[5b8413b4] | 352 | }
|
---|
| 353 | }
|
---|
| 354 |
|
---|
[490cb3c] | 355 | class PlotGroup implements Serializable {
|
---|
| 356 | public String name
|
---|
| 357 | public String unit
|
---|
| 358 | public boolean log
|
---|
| 359 |
|
---|
| 360 | PlotGroup(String name, String unit, boolean log) {
|
---|
| 361 | this.name = name
|
---|
| 362 | this.unit = unit
|
---|
| 363 | this.log = log
|
---|
| 364 | }
|
---|
| 365 | }
|
---|
| 366 |
|
---|
[5b8413b4] | 367 | def prepare_build() {
|
---|
| 368 | // prepare the properties
|
---|
| 369 | properties ([ \
|
---|
[62f96ae] | 370 | buildDiscarder(logRotator( \
|
---|
| 371 | artifactDaysToKeepStr: '', \
|
---|
| 372 | artifactNumToKeepStr: '', \
|
---|
| 373 | daysToKeepStr: '730', \
|
---|
| 374 | numToKeepStr: '1000' \
|
---|
| 375 | )), \
|
---|
[5b8413b4] | 376 | [$class: 'ParametersDefinitionProperty', \
|
---|
| 377 | parameterDefinitions: [ \
|
---|
| 378 | [$class: 'ChoiceParameterDefinition', \
|
---|
| 379 | description: 'Which compiler to use', \
|
---|
| 380 | name: 'Compiler', \
|
---|
[c09ae73] | 381 | choices: 'gcc-9\ngcc-8\ngcc-7\ngcc-6\ngcc-5\ngcc-4.9\nclang', \
|
---|
[fe27d99] | 382 | defaultValue: 'gcc-8', \
|
---|
[5b8413b4] | 383 | ], \
|
---|
| 384 | [$class: 'ChoiceParameterDefinition', \
|
---|
| 385 | description: 'The target architecture', \
|
---|
| 386 | name: 'Architecture', \
|
---|
| 387 | choices: 'x64\nx86', \
|
---|
| 388 | defaultValue: 'x64', \
|
---|
| 389 | ], \
|
---|
[d21dd3cb] | 390 | [$class: 'BooleanParameterDefinition', \
|
---|
| 391 | description: 'If true, build compiler using new AST', \
|
---|
| 392 | name: 'NewAST', \
|
---|
[6a531ab] | 393 | defaultValue: true, \
|
---|
[d21dd3cb] | 394 | ], \
|
---|
[5b8413b4] | 395 | [$class: 'BooleanParameterDefinition', \
|
---|
| 396 | description: 'If false, only the quick test suite is ran', \
|
---|
| 397 | name: 'RunAllTests', \
|
---|
| 398 | defaultValue: false, \
|
---|
[fe3d9ab] | 399 | ], \
|
---|
[5b8413b4] | 400 | [$class: 'BooleanParameterDefinition', \
|
---|
| 401 | description: 'If true, jenkins also runs benchmarks', \
|
---|
| 402 | name: 'RunBenchmark', \
|
---|
| 403 | defaultValue: false, \
|
---|
| 404 | ], \
|
---|
| 405 | [$class: 'BooleanParameterDefinition', \
|
---|
| 406 | description: 'If true, jenkins also builds documentation', \
|
---|
| 407 | name: 'BuildDocumentation', \
|
---|
| 408 | defaultValue: true, \
|
---|
| 409 | ], \
|
---|
| 410 | [$class: 'BooleanParameterDefinition', \
|
---|
| 411 | description: 'If true, jenkins also publishes results', \
|
---|
| 412 | name: 'Publish', \
|
---|
| 413 | defaultValue: false, \
|
---|
| 414 | ], \
|
---|
| 415 | [$class: 'BooleanParameterDefinition', \
|
---|
| 416 | description: 'If true, jenkins will not send emails', \
|
---|
| 417 | name: 'Silent', \
|
---|
| 418 | defaultValue: false, \
|
---|
| 419 | ], \
|
---|
| 420 | ],
|
---|
| 421 | ]])
|
---|
| 422 |
|
---|
[bd8dca2] | 423 | // It's unfortunate but it looks like we need to checkout the entire repo just to get
|
---|
| 424 | // - the pretty git printer
|
---|
| 425 | // - Jenkins.tools
|
---|
[4c55047] | 426 | checkout scm
|
---|
[2407853] | 427 |
|
---|
[1483a16] | 428 | Tools = load "Jenkins/tools.groovy"
|
---|
[bd8dca2] | 429 |
|
---|
[490cb3c] | 430 | final settings = new BuildSettings(params, env.BRANCH_NAME)
|
---|
[5b8413b4] | 431 |
|
---|
| 432 | currentBuild.description = settings.DescShort
|
---|
| 433 | echo settings.DescLong
|
---|
| 434 |
|
---|
| 435 | return settings
|
---|
| 436 | }
|
---|
| 437 |
|
---|
| 438 | def make_doc() {
|
---|
| 439 | def err = null
|
---|
| 440 | try {
|
---|
| 441 | sh 'make clean > /dev/null'
|
---|
| 442 | sh 'make > /dev/null 2>&1'
|
---|
| 443 | }
|
---|
| 444 | catch (Exception caughtError) {
|
---|
| 445 | err = caughtError //rethrow error later
|
---|
[65f4a51] | 446 | sh 'cat build/*.log'
|
---|
[5b8413b4] | 447 | }
|
---|
| 448 | finally {
|
---|
| 449 | if (err) throw err // Must re-throw exception to propagate error
|
---|
| 450 | }
|
---|
[a2a0065] | 451 | }
|
---|
| 452 |
|
---|
[3221a2b] | 453 | def do_plot(boolean new_data, String file, PlotGroup group, boolean relative, String title) {
|
---|
[8d63649] | 454 |
|
---|
[1b3eef8] | 455 | if(new_data) {
|
---|
| 456 | echo "Publishing new data"
|
---|
| 457 | }
|
---|
| 458 |
|
---|
[cdcd53dc] | 459 | def series = new_data ? [[
|
---|
[df57a84] | 460 | file: "${file}.csv",
|
---|
[3c40dc2a] | 461 | exclusionValues: '',
|
---|
| 462 | displayTableFlag: false,
|
---|
| 463 | inclusionFlag: 'OFF',
|
---|
| 464 | url: ''
|
---|
[cdcd53dc] | 465 | ]] : [];
|
---|
[8d63649] | 466 |
|
---|
| 467 | echo "file is ${BuildDir}/benchmark/${file}.csv, group ${group}, title ${title}"
|
---|
| 468 | dir("${BuildDir}/benchmark/") {
|
---|
| 469 | plot csvFileName: "cforall-${env.BRANCH_NAME}-${file}.csv",
|
---|
| 470 | csvSeries: series,
|
---|
[490cb3c] | 471 | group: "${group.name}",
|
---|
[3c40dc2a] | 472 | title: "${title}",
|
---|
| 473 | style: 'lineSimple',
|
---|
| 474 | exclZero: false,
|
---|
| 475 | keepRecords: false,
|
---|
[3221a2b] | 476 | logarithmic: !relative && group.log,
|
---|
[3c40dc2a] | 477 | numBuilds: '120',
|
---|
| 478 | useDescr: true,
|
---|
[490cb3c] | 479 | yaxis: group.unit,
|
---|
[3c40dc2a] | 480 | yaxisMaximum: '',
|
---|
| 481 | yaxisMinimum: ''
|
---|
[df57a84] | 482 | }
|
---|
| 483 | }
|
---|