aboutsummaryrefslogtreecommitdiff
path: root/zorg/jenkins/jobs/jobs/lldb-cmake
blob: 2fa15f709f22d10a24a82ad8aec96a61adb252e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/usr/bin/env groovy
pipeline {
    agent { label 'green-dragon-24' }
    parameters {
        string(name: 'GIT_REVISION', defaultValue: '*/master', description: 'Git revision to build')
        string(name: 'ARTIFACT', defaultValue: 'clang-stage1-RA/latest', description: 'Compiler artifact to use for building the project')
        string(name: 'BUILD_TYPE', defaultValue: 'Release', description: 'Default CMake build type; one of: Release, Debug, ...')
        string(name: 'CLEAN', defaultValue: "false", description: 'Whether or not to clean the build directory before building')
    }
    stages {
        stage('Checkout') {
            steps {
                dir('llvm-project') {
                    checkout([$class: 'GitSCM', branches: [[name: params.GIT_REVISION]], userRemoteConfigs: [[url: 'http://labmaster3.local/git/llvm-project.git']]])
                }
                dir('llvm-zorg') {
                    checkout([$class: 'GitSCM', branches: [[name: '*/master']], userRemoteConfigs: [[url: 'http://labmaster3.local/git/llvm-zorg.git']]])
                }
            }
        }
        stage('Fetch Host Compiler') {
        steps {
        	timeout(10) {
                    sh '''
        			python llvm-zorg/zorg/jenkins/monorepo_build.py fetch
        			'''
        		}
            }
        }
        stage('Build') {
            steps {
                timeout(90) {
                    sh '''
                    set -u
                    rm -rf build.properties

                    cd llvm-project
                    git tag -a -m "First Commit" first_commit 97724f18c79c7cc81ced24239eb5e883bf1398ef || true

                    git_desc=$(git describe --match "first_commit")

                    export GIT_DISTANCE=$(echo ${git_desc} | cut -f 2 -d "-")

                    sha=$(echo ${git_desc} | cut -f 3 -d "-")
                    export GIT_SHA=${sha:1}

                    cd -

                    export PATH=$PATH:/usr/bin:/usr/local/bin

                    python llvm-zorg/zorg/jenkins/monorepo_build.py lldb-cmake build \
                      --assertions \
                      --projects="clang;libcxx;libcxxabi;compiler-rt;lld;lldb;debuginfo-tests"  \
                      --cmake-flag="-DPYTHON_LIBRARY=/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/libpython3.7.dylib" \
                      --cmake-flag="-DPYTHON_INCLUDE_DIR=/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/include/python3.7m" \
                      --cmake-flag="-DPYTHON_LIBRARY_DEBUG=/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/libpython3.7.dylib" \
                      --cmake-flag="-DPYTHON_EXECUTABLE=/usr/local/Cellar/python/3.7.0/bin/python3.7" \
                      --compiler-flag="-Wdocumentation" \
                      --cmake-type=Release
                    '''
                }
            }
        }
        stage('Test') {
            steps {
                timeout(60) {
                    sh '''
                    set -u
                    export PATH=$PATH:/usr/bin:/usr/local/bin

                    rm -rf test/results.xml

                    python llvm-zorg/zorg/jenkins/monorepo_build.py lldb-cmake testlong
                    '''
                }
            }
        }
    }
    post {
        always {
            scanForIssues tool: clang()
            junit 'test/results.xml'
        }
        failure {
            emailext
            subject: '$DEFAULT_SUBJECT',
            presendScript: '$DEFAULT_PRESEND_SCRIPT',
            postsendScript: '$DEFAULT_POSTSEND_SCRIPT',
            recipientProviders: [
                    [$class: 'CulpritsRecipientProvider'],
                    [$class: 'DevelopersRecipientProvider'],
                    [$class: 'RequesterRecipientProvider'],
            ],
            replyTo: '$DEFAULT_REPLYTO',
            to: 'jdevlieghere@apple.com', // $DEFAULT_RECIPIENTS
            body:'$DEFAULT_CONTENT'
        }
    }
}