Skip to content

Add Stage 1 arm 64 job #530

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 30, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
156 changes: 156 additions & 0 deletions zorg/jenkins/jobs/jobs/clang-stage1-RA-as
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
pipeline {
options {
disableConcurrentBuilds()
}

parameters {
string(name: 'LABEL', defaultValue: params.LABEL ?: 'macos-arm64', description: 'Node label to run on')

string(name: 'GIT_REVISION', defaultValue: params.GIT_REVISION ?: '*/main', description: 'Git revision to build')
}

agent {
node {
label params.LABEL
}
}

stages {
stage('Checkout') {
steps {
dir('llvm-project') {
checkout([$class: 'GitSCM', branches: [
[name: params.GIT_REVISION]
], extensions: [
[$class: 'CloneOption',
timeout: 30]
], userRemoteConfigs: [
[url: 'https://github.com/llvm/llvm-project.git']
]])
}
dir('llvm-zorg') {
checkout([$class: 'GitSCM', branches: [
[name: '*/main']
], userRemoteConfigs: [
[url: 'https://github.com/llvm/llvm-zorg.git']
]])
}
}
}
stage('Setup Venv') {
environment {
PATH="$PATH:/usr/bin:/usr/local/bin"
}
steps {
sh '''
# Non-incremental, so always delete just in case.
rm -rf clang-build clang-install host-compiler *.tar.gz
rm -rf venv
python3 -m venv venv
set +u
source ./venv/bin/activate
python -m pip install -r ./llvm-zorg/zorg/jenkins/jobs/requirements.txt
set -u
'''
}
}
stage('Build') {
environment {
PATH="$PATH:/usr/bin:/usr/local/bin"
MACOSX_DEPLOYMENT_TARGET="13.6"
}
steps {
timeout(120) {
withCredentials([string(credentialsId: 's3_resource_bucket', variable: 'S3_BUCKET')]) {
sh '''
set -u
rm -rf build.properties

source ./venv/bin/activate

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}

# Also save the LLVM_REV until LNT server is taught about GIT
export LLVM_REV=$(git show -q | grep "llvm-svn:" | cut -f2 -d":" | tr -d " ")

cd -

echo "GIT_DISTANCE=$GIT_DISTANCE" > build.properties
echo "GIT_SHA=$GIT_SHA" >> build.properties
echo "ARTIFACT=$JOB_NAME/clang-d$GIT_DISTANCE-g$GIT_SHA-t$BUILD_ID-b$BUILD_NUMBER.tar.gz" >> build.properties

rm -rf clang-build clang-install *.tar.gz
python llvm-zorg/zorg/jenkins/monorepo_build.py cmake build \
--assertions --cmake-type=RelWithDebInfo \
--projects="clang;clang-tools-extra;compiler-rt" \
--cmake-flag="-DPython3_EXECUTABLE=$(which python)" \
--cmake-flag="-DLLVM_TARGETS_TO_BUILD=AArch64"
'''
}
}
}
}
stage('Test') {
environment {
PATH="$PATH:/usr/bin:/usr/local/bin"
}
steps {
timeout(120) {
sh '''
set -u
source ./venv/bin/activate
python llvm-zorg/zorg/jenkins/monorepo_build.py cmake testlong
'''
}
}
post {
always {
script {
junit "clang-build/**/testresults.xunit.xml"
}
}
}
}
}
post {
always {
script {
// ToDo: Restore the issue scanner
// scanForIssues tool: clang()
sh "rm -rf clang-build clang-install host-compiler"
}
}
// This is commented out because we don't have downstream arm64 jobs setup yet, we will
// in the future
//success {
// script {
// if (!params.SKIP_TRIGGER) {
// // Trigger Stage 2 Jobs
// build job: 'clang-stage2-cmake-RgSan_relay-as', wait: false
// build job: 'clang-stage2-Rthinlto_relay-as', wait: false
// build job: 'relay-lnt-ctmark-as', wait: false
// build job: 'relay-test-suite-verify-machineinstrs-as', wait: false
// }
// }
//}
//unstable {
// script {
// if (!params.SKIP_TRIGGER) {
// // Trigger Stage 2 Jobs
// build job: 'clang-stage2-cmake-RgSan_relay-as', wait: false
// build job: 'clang-stage2-Rthinlto_relay-as', wait: false
// build job: 'relay-lnt-ctmark-as', wait: false
// build job: 'relay-test-suite-verify-machineinstrs-as', wait: false
// }
// }
//}
}
}