1
1
pipeline {
2
- agent { label 'green-dragon-22' }
3
-
4
- options { disableResume() }
2
+ options {
3
+ disableConcurrentBuilds()
4
+ }
5
5
6
6
parameters {
7
- string(name: 'GIT_SHA', defaultValue: '*/main', description: 'Git revision to build')
8
- string(name: 'ARTIFACT', defaultValue: 'clang-stage1-RA/latest', description: 'description')
7
+ string(name: 'LABEL', defaultValue: params.LABEL ?: 'macos-x86_64', description: 'Node label to run on')
8
+
9
+ string(name: 'GIT_SHA', defaultValue: params.GIT_REVISION ?: '*/main', description: 'Git commit to build.')
10
+
11
+ string(name: 'ARTIFACT', defaultValue: params.ARTIFACT ?: 'llvm.org/clang-stage1-RA/latest', description: 'Clang artifact to use')
12
+ }
13
+
14
+ agent {
15
+ node {
16
+ label params.LABEL
17
+ }
9
18
}
10
19
11
20
stages {
@@ -16,7 +25,7 @@ pipeline {
16
25
[name: params.GIT_SHA]
17
26
], extensions: [
18
27
[$class: 'CloneOption',
19
- reference: '/Users/Shared/llvm-project.git' ]
28
+ timeout: 30 ]
20
29
], userRemoteConfigs: [
21
30
[url: 'https://github.com/llvm/llvm-project.git']
22
31
]])
@@ -33,71 +42,107 @@ pipeline {
33
42
}
34
43
}
35
44
}
45
+ stage('Setup Venv') {
46
+ environment {
47
+ PATH="$PATH:/usr/bin:/usr/local/bin"
48
+ }
49
+ steps {
50
+ sh '''
51
+ # Non-incremental, so always delete.
52
+ rm -rf clang-build clang-install host-compiler *.tar.gz
53
+ rm -rf venv
54
+ python3 -m venv venv
55
+ set +u
56
+ source ./venv/bin/activate
57
+ pip install -r ./llvm-zorg/zorg/jenkins/jobs/requirements.txt
58
+ set -u
59
+ '''
60
+ }
61
+ }
62
+ stage('Fetch Artifact') {
63
+ environment {
64
+ PATH="$PATH:/usr/bin:/usr/local/bin"
65
+ }
66
+ steps {
67
+ withCredentials([string(credentialsId: 's3_resource_bucket', variable: 'S3_BUCKET')]) {
68
+ sh """
69
+ source ./venv/bin/activate
70
+ echo "ARTIFACT=${params.ARTIFACT}"
71
+ python llvm-zorg/zorg/jenkins/monorepo_build.py fetch
72
+ ls $WORKSPACE/host-compiler/lib/clang/
73
+ VERSION=`ls $WORKSPACE/host-compiler/lib/clang/`
74
+ """
75
+ }
76
+ }
77
+ }
36
78
stage('Build') {
79
+ environment {
80
+ PATH="$PATH:/usr/bin:/usr/local/bin"
81
+ }
37
82
steps {
38
- timeout(600) {
39
- sh '''
40
- set -u
41
- rm -rf build.properties
83
+ timeout(1200) {
84
+ withCredentials([string(credentialsId: 's3_resource_bucket', variable: 'S3_BUCKET')]) {
85
+ sh '''
86
+ set -u
87
+ rm -rf build.properties
88
+ source ./venv/bin/activate
42
89
43
- cd llvm-project
44
- git tag -a -m "First Commit" first_commit 97724f18c79c7cc81ced24239eb5e883bf1398ef || true
90
+ cd llvm-project
91
+ git tag -a -m "First Commit" first_commit 97724f18c79c7cc81ced24239eb5e883bf1398ef || true
45
92
46
- git_desc=$(git describe --match "first_commit")
47
- export GIT_DISTANCE=$(echo ${git_desc} | cut -f 2 -d "-")
93
+ git_desc=$(git describe --match "first_commit")
94
+ export GIT_DISTANCE=$(echo ${git_desc} | cut -f 2 -d "-")
48
95
49
- sha=$(echo ${git_desc} | cut -f 3 -d "-")
50
- export GIT_SHA=${sha:1}
96
+ sha=$(echo ${git_desc} | cut -f 3 -d "-")
97
+ export GIT_SHA=${sha:1}
51
98
52
- cd -
99
+ cd -
53
100
54
- echo "ARTIFACT=$JOB_NAME/clang-d$GIT_DISTANCE-g$GIT_SHA-t$BUILD_ID-b$BUILD_NUMBER.tar.gz" > build.properties
101
+ echo "ARTIFACT=$JOB_NAME/clang-d$GIT_DISTANCE-g$GIT_SHA-t$BUILD_ID-b$BUILD_NUMBER.tar.gz" > build.properties
55
102
56
- export PATH=$PATH:/usr/bin:/usr/local/bin
57
-
58
- rm -rf clang-build clang-install *.tar.gz
59
-
60
- python llvm-zorg/zorg/jenkins/monorepo_build.py fetch
61
- python llvm-zorg/zorg/jenkins/monorepo_build.py clang build \
62
- --thinlto --projects="clang;compiler-rt" \
63
- --cmake-flag="-DCMAKE_DSYMUTIL=$WORKSPACE/host-compiler/bin/dsymutil"
64
- '''
103
+ python llvm-zorg/zorg/jenkins/monorepo_build.py clang build \
104
+ --thinlto --projects="clang;compiler-rt" \
105
+ --cmake-flag="-DCMAKE_DSYMUTIL=$WORKSPACE/host-compiler/bin/dsymutil" \
106
+ --runtimes="libunwind" \
107
+ --cmake-flag="-DPython3_EXECUTABLE=$(which python)"
108
+ '''
109
+ }
65
110
}
66
111
}
67
112
}
68
-
69
113
stage('Test') {
114
+ environment {
115
+ PATH="$PATH:/usr/bin:/usr/local/bin"
116
+ }
70
117
steps {
71
- timeout(240 ) {
118
+ timeout(420 ) {
72
119
sh '''
73
120
set -u
74
- export PATH=$PATH:/usr /bin:/usr/local/bin
121
+ source ./venv /bin/activate
75
122
76
123
rm -rf clang-build/testresults.xunit.xml
77
124
78
125
python llvm-zorg/zorg/jenkins/monorepo_build.py clang test
79
126
'''
80
127
}
81
- junit 'clang-build/**/testresults.xunit.xml'
128
+ }
129
+ post {
130
+ always {
131
+ script {
132
+ junit "clang-build/**/testresults.xunit.xml"
133
+ }
134
+ }
82
135
}
83
136
}
84
137
}
85
138
post {
86
139
always {
87
- scanForIssues tool: clang()
88
- }
89
- regression {
90
- emailext subject: '$DEFAULT_SUBJECT',
91
- presendScript: '$DEFAULT_PRESEND_SCRIPT',
92
- postsendScript: '$DEFAULT_POSTSEND_SCRIPT',
93
- recipientProviders: [
94
- [$class: 'CulpritsRecipientProvider'],
95
- [$class: 'DevelopersRecipientProvider'],
96
- [$class: 'RequesterRecipientProvider'],
97
- ],
98
- replyTo: '$DEFAULT_REPLYTO',
99
- to: '$DEFAULT_RECIPIENTS',
100
- body:'$DEFAULT_CONTENT'
140
+ script {
141
+ // ToDo: Restore the issue scanner
142
+ // scanForIssues tool: clang()
143
+
144
+ sh "rm -rf clang-build clang-install host-compiler *.tar.gz"
145
+ }
101
146
}
102
147
}
103
148
}
0 commit comments