@@ -34,7 +34,11 @@ pipeline {
34
34
parameters {
35
35
string(name : ' LABEL' , defaultValue : params. LABEL ?: ' macos-x86_64' , description : ' Node label to run on' )
36
36
string(name : ' GIT_SHA' , defaultValue : params. GIT_REVISION ?: ' */release/19.x' , description : ' Git commit to build.' )
37
- string(name : ' ARTIFACT' , defaultValue : params. ARTIFACT ?: ' lldb-cmake-intel/latest' , description : ' Clang/LLDB artifact to use' )
37
+
38
+ // TODO: we should get LLDB as an artifact from the lldb-cmake-intel/latest job. Said job doesn't currently
39
+ // publish LLDB/Clang as an artifact however. So instead we build Clang/LLDB from top-of-tree main.
40
+ // string(name: 'ARTIFACT', defaultValue: params.ARTIFACT ?: 'lldb-cmake-intel/latest', description: 'Clang/LLDB artifact to use')
41
+
38
42
booleanParam(name : ' CLEAN' , defaultValue : params. CLEAN ?: false , description : ' Wipe the build directory?' )
39
43
}
40
44
@@ -63,6 +67,16 @@ pipeline {
63
67
noTags : true , timeout : 30 ]
64
68
]])
65
69
}
70
+ dir(' src/host-main' ) {
71
+ checkout([$class : ' GitSCM' , branches : [
72
+ [name : ' */main' ]
73
+ ], userRemoteConfigs : [
74
+ [url : ' https://github.com/llvm/llvm-project.git' ]
75
+ ], extensions : [
76
+ [$class : ' CloneOption' ,
77
+ noTags : true , timeout : 30 ]
78
+ ]])
79
+ }
66
80
dir(' llvm-zorg' ) {
67
81
checkout([$class : ' GitSCM' , branches : [
68
82
[name : ' */main' ]
@@ -88,32 +102,64 @@ pipeline {
88
102
'''
89
103
}
90
104
}
91
- stage(' Fetch Artifact ' ) {
105
+ stage(' Build (host) ' ) {
92
106
environment {
93
107
PATH = " $PATH :/usr/bin:/usr/local/bin"
108
+ SRC = " $WORKSPACE /src"
109
+ HOST_SRC = " $WORKSPACE /src/host-main"
110
+ HOST_BUILD = " $WORKSPACE /host-main-build"
94
111
}
95
112
steps {
96
113
withCredentials([string(credentialsId : ' s3_resource_bucket' , variable : ' S3_BUCKET' )]) {
97
- sh """
98
- source ./venv/bin/activate
99
- echo "ARTIFACT=${ params.ARTIFACT} "
100
- python llvm-zorg/zorg/jenkins/monorepo_build.py fetch
101
- ls $WORKSPACE /host-compiler/lib/clang/
102
- VERSION=`ls $WORKSPACE /host-compiler/lib/clang/`
103
- """
114
+ sh '''
115
+ source ./venv/bin/activate
116
+
117
+ cd $HOST_SRC
118
+ git tag -a -m "First Commit" first_commit 97724f18c79c7cc81ced24239eb5e883bf1398ef || true
119
+
120
+ git_desc=$(git describe --match "first_commit")
121
+ export GIT_DISTANCE=$(echo ${git_desc} | cut -f 2 -d "-")
122
+
123
+ sha=$(echo ${git_desc} | cut -f 3 -d "-")
124
+ export GIT_SHA=${sha:1}
125
+
126
+ cd -
127
+
128
+ set -eux
129
+
130
+ $CXX --version
131
+ LLVM_REV=${GIT_DISTANCE}
132
+
133
+ mkdir -p host-main-src
134
+ mkdir -p host-main-build
135
+ rsync -a $HOST_SRC/ host-main-src/
136
+ cd host-main-build
137
+ cmake ../host-main-src/llvm \
138
+ -DCMAKE_BUILD_TYPE=Release \
139
+ -DLLVM_ENABLE_PROJECTS="clang;lldb" \
140
+ -DLLVM_ENABLE_ASSERTIONS=Off \
141
+ -DLLVM_ENABLE_MODULES=Off \
142
+ -DLLDB_INCLUDE_TESTS=Off \
143
+ -DLLDB_ENABLE_PYTHON=On \
144
+ -DLLDB_ENABLE_LUA=Off \
145
+ -DLLVM_TARGETS_TO_BUILD='X86;AArch64' \
146
+ -DCMAKE_EXPORT_COMPILE_COMMANDS=On \
147
+ -G Ninja
148
+ cmake --build .
149
+ cd ../..
150
+ '''
104
151
}
105
152
}
106
153
}
107
- stage(' Build' ) {
154
+ stage(' Build (historic) ' ) {
108
155
environment {
109
156
PATH = " $PATH :/usr/bin:/usr/local/bin"
110
157
SRC = " $WORKSPACE /src"
111
158
BUILD = " $WORKSPACE /clang-19-build"
112
- TEST = " $WORKSPACE /test"
113
- RESULTS = " $WORKSPACE /results"
114
- CC = " $WORKSPACE /host-compiler/bin/clang"
115
- CXX = " $WORKSPACE /host-compiler/bin/clang++"
159
+ HOST_BUILD = " $WORKSPACE /clang-19-build"
116
160
HISTORIC_COMPILER = " clang-19"
161
+ CC = " $WORKSPACE /host-main-build/bin/clang"
162
+ CXX = " $WORKSPACE /host-main-build/bin/clang++"
117
163
}
118
164
steps {
119
165
withCredentials([string(credentialsId : ' s3_resource_bucket' , variable : ' S3_BUCKET' )]) {
@@ -161,7 +207,7 @@ pipeline {
161
207
}
162
208
stage(' Run metrics' ) {
163
209
environment {
164
- HOST_BUILD_DIR = " $WORKSPACE /host-compiler "
210
+ HOST_BUILD_DIR = " $WORKSPACE /host-build "
165
211
HISTORIC_BUILD_DIR = " $WORKSPACE /clang-19-build/tools/clang/stage2-bins"
166
212
}
167
213
steps {
0 commit comments