Skip to content

Commit 9fc1fad

Browse files
committed
[zorg][lldb-statistics] Don't fetch artifacts for now
Ideally we'd want to fetch the Clang/LLDB binary that the incremental LLDB bots produced. However, they currently don't publish their artifacts. Until they do, build the host Clang/LLDB.
1 parent a0da45f commit 9fc1fad

File tree

1 file changed

+61
-15
lines changed

1 file changed

+61
-15
lines changed

zorg/jenkins/jobs/jobs/lldb-statistics

Lines changed: 61 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ pipeline {
3434
parameters {
3535
string(name: 'LABEL', defaultValue: params.LABEL ?: 'macos-x86_64', description: 'Node label to run on')
3636
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+
3842
booleanParam(name: 'CLEAN', defaultValue: params.CLEAN ?: false, description: 'Wipe the build directory?')
3943
}
4044

@@ -63,6 +67,16 @@ pipeline {
6367
noTags: true, timeout: 30]
6468
]])
6569
}
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+
}
6680
dir('llvm-zorg') {
6781
checkout([$class: 'GitSCM', branches: [
6882
[name: '*/main']
@@ -88,32 +102,64 @@ pipeline {
88102
'''
89103
}
90104
}
91-
stage('Fetch Artifact') {
105+
stage('Build (host)') {
92106
environment {
93107
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"
94111
}
95112
steps {
96113
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+
'''
104151
}
105152
}
106153
}
107-
stage('Build') {
154+
stage('Build (historic)') {
108155
environment {
109156
PATH="$PATH:/usr/bin:/usr/local/bin"
110157
SRC="$WORKSPACE/src"
111158
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"
116160
HISTORIC_COMPILER="clang-19"
161+
CC="$WORKSPACE/host-main-build/bin/clang"
162+
CXX="$WORKSPACE/host-main-build/bin/clang++"
117163
}
118164
steps {
119165
withCredentials([string(credentialsId: 's3_resource_bucket', variable: 'S3_BUCKET')]) {
@@ -161,7 +207,7 @@ pipeline {
161207
}
162208
stage('Run metrics') {
163209
environment {
164-
HOST_BUILD_DIR="$WORKSPACE/host-compiler"
210+
HOST_BUILD_DIR="$WORKSPACE/host-build"
165211
HISTORIC_BUILD_DIR="$WORKSPACE/clang-19-build/tools/clang/stage2-bins"
166212
}
167213
steps {

0 commit comments

Comments
 (0)