[llvm] JOCA-349 Create the multibranch job in Jenkins (PR #169388)

Rodrigo Camargo via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 25 12:47:13 PST 2025


https://github.com/galdinocamargo updated https://github.com/llvm/llvm-project/pull/169388

>From ac28ece34deea292f4c88b16abd876a6d88b3bec Mon Sep 17 00:00:00 2001
From: Rodrigo Luiz Galdino Camargo <galdinocamargo at gmail.com>
Date: Mon, 24 Nov 2025 18:36:05 +0000
Subject: [PATCH 1/8] updated

---
 Jenkinsfile | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)
 create mode 100644 Jenkinsfile

diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644
index 0000000000000..df35e1230be7a
--- /dev/null
+++ b/Jenkinsfile
@@ -0,0 +1,56 @@
+pipeline {
+  agent { label 'cpp-ec2-al2-candidate' }
+
+  options {
+    timestamps()
+    disableConcurrentBuilds()
+  }
+
+  environment {
+    BUILD_TYPE    = 'Release'
+    LLVM_PROJECTS = 'clang;lld'   // adjust if you want more/less
+    BUILD_DIR     = 'build'
+  }
+
+  stages {
+    stage('Checkout') {
+      steps {
+        // Uses the same repo/branch that triggered the multibranch job
+        checkout scm
+      }
+    }
+
+    stage('Configure') {
+      steps {
+        sh '''
+          set -eux
+
+          mkdir -p "${BUILD_DIR}"
+
+          cmake -S llvm -B "${BUILD_DIR}" -G Ninja \
+            -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \
+            -DLLVM_ENABLE_PROJECTS="${LLVM_PROJECTS}"
+        '''
+      }
+    }
+
+    stage('Build') {
+      steps {
+        sh '''
+          set -eux
+          cmake --build "${BUILD_DIR}" -j"$(nproc)"
+        '''
+      }
+    }
+
+    // Optional, wire later once build works and you decide what to run
+    // stage('Smoke tests') {
+    //   steps {
+    //     sh '''
+    //       set -eux
+    //       ctest --test-dir "${BUILD_DIR}" -R clang -j"$(nproc)" || true
+    //     '''
+    //   }
+    // }
+  }
+}

>From 1577954fdee28e41756f4dedd1bde4152984cae9 Mon Sep 17 00:00:00 2001
From: Rodrigo Luiz Galdino Camargo <galdinocamargo at gmail.com>
Date: Mon, 24 Nov 2025 20:25:41 +0000
Subject: [PATCH 2/8] make to make3

---
 Jenkinsfile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index df35e1230be7a..7b781faf75b3e 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -27,7 +27,7 @@ pipeline {
 
           mkdir -p "${BUILD_DIR}"
 
-          cmake -S llvm -B "${BUILD_DIR}" -G Ninja \
+          cmake3 -S llvm -B "${BUILD_DIR}" -G Ninja \
             -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \
             -DLLVM_ENABLE_PROJECTS="${LLVM_PROJECTS}"
         '''
@@ -38,7 +38,7 @@ pipeline {
       steps {
         sh '''
           set -eux
-          cmake --build "${BUILD_DIR}" -j"$(nproc)"
+          cmake3 --build "${BUILD_DIR}" -j"$(nproc)"
         '''
       }
     }

>From 698244ed3c267f38d08cffd500ea46a43568b277 Mon Sep 17 00:00:00 2001
From: Rodrigo Luiz Galdino Camargo <galdinocamargo at gmail.com>
Date: Mon, 24 Nov 2025 21:51:07 +0000
Subject: [PATCH 3/8] updated

---
 Jenkinsfile | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 7b781faf75b3e..f0db469e0af9a 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -8,14 +8,14 @@ pipeline {
 
   environment {
     BUILD_TYPE    = 'Release'
-    LLVM_PROJECTS = 'clang;lld'   // adjust if you want more/less
+    LLVM_PROJECTS = 'clang;lld'   // adjust if you want more or less
     BUILD_DIR     = 'build'
   }
 
   stages {
     stage('Checkout') {
       steps {
-        // Uses the same repo/branch that triggered the multibranch job
+        // Uses the same repo and branch that triggered the multibranch job
         checkout scm
       }
     }
@@ -29,7 +29,9 @@ pipeline {
 
           cmake3 -S llvm -B "${BUILD_DIR}" -G Ninja \
             -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \
-            -DLLVM_ENABLE_PROJECTS="${LLVM_PROJECTS}"
+            -DLLVM_ENABLE_PROJECTS="${LLVM_PROJECTS}" \
+            -DCMAKE_C_COMPILER=/usr/bin/gcc10 \
+            -DCMAKE_CXX_COMPILER=/usr/bin/g++10
         '''
       }
     }

>From 7deeab63845b2a9ec46787b3dfb9ad80dbe67c33 Mon Sep 17 00:00:00 2001
From: Rodrigo Luiz Galdino Camargo <galdinocamargo at gmail.com>
Date: Tue, 25 Nov 2025 18:33:49 +0000
Subject: [PATCH 4/8] updated

---
 Jenkinsfile | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index f0db469e0af9a..baa13aff079c9 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -8,14 +8,18 @@ pipeline {
 
   environment {
     BUILD_TYPE    = 'Release'
-    LLVM_PROJECTS = 'clang;lld'   // adjust if you want more or less
+    LLVM_PROJECTS = 'clang;lld'   // adjust if you want more/less
     BUILD_DIR     = 'build'
+
+    // Use GCC 10 toolchain installed on the AMI
+    CC  = 'gcc10-gcc'
+    CXX = 'gcc10-g++'
   }
 
   stages {
     stage('Checkout') {
       steps {
-        // Uses the same repo and branch that triggered the multibranch job
+        // Uses the same repo/branch that triggered the multibranch job
         checkout scm
       }
     }
@@ -30,8 +34,8 @@ pipeline {
           cmake3 -S llvm -B "${BUILD_DIR}" -G Ninja \
             -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \
             -DLLVM_ENABLE_PROJECTS="${LLVM_PROJECTS}" \
-            -DCMAKE_C_COMPILER=/usr/bin/gcc10 \
-            -DCMAKE_CXX_COMPILER=/usr/bin/g++10
+            -DCMAKE_C_COMPILER="${CC}" \
+            -DCMAKE_CXX_COMPILER="${CXX}"
         '''
       }
     }
@@ -45,7 +49,7 @@ pipeline {
       }
     }
 
-    // Optional, wire later once build works and you decide what to run
+    // Optional tests, keep commented until you decide what to run
     // stage('Smoke tests') {
     //   steps {
     //     sh '''

>From bbefc4483a9274034c9667253392a1f8da6ee010 Mon Sep 17 00:00:00 2001
From: Rodrigo Luiz Galdino Camargo <galdinocamargo at gmail.com>
Date: Tue, 25 Nov 2025 18:43:58 +0000
Subject: [PATCH 5/8] updated

---
 Jenkinsfile | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index baa13aff079c9..9412c06c9d59b 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -14,6 +14,9 @@ pipeline {
     // Use GCC 10 toolchain installed on the AMI
     CC  = 'gcc10-gcc'
     CXX = 'gcc10-g++'
+
+    // Python 3.8 installed by the AMI (amazon-linux-extras python3.8)
+    PYTHON3_EXE = '/usr/bin/python3.8'
   }
 
   stages {
@@ -35,7 +38,8 @@ pipeline {
             -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \
             -DLLVM_ENABLE_PROJECTS="${LLVM_PROJECTS}" \
             -DCMAKE_C_COMPILER="${CC}" \
-            -DCMAKE_CXX_COMPILER="${CXX}"
+            -DCMAKE_CXX_COMPILER="${CXX}" \
+            -DPython3_EXECUTABLE="${PYTHON3_EXE}"
         '''
       }
     }

>From a8c6692b30ad4e03755f4847bccb8bf8bdc63873 Mon Sep 17 00:00:00 2001
From: Rodrigo Luiz Galdino Camargo <galdinocamargo at gmail.com>
Date: Tue, 25 Nov 2025 20:24:21 +0000
Subject: [PATCH 6/8] updated

---
 Jenkinsfile | 59 +++++++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 51 insertions(+), 8 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 9412c06c9d59b..a5f63af4a6a56 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -8,21 +8,65 @@ pipeline {
 
   environment {
     BUILD_TYPE    = 'Release'
-    LLVM_PROJECTS = 'clang;lld'   // adjust if you want more/less
+    LLVM_PROJECTS = 'clang;lld'
     BUILD_DIR     = 'build'
 
-    // Use GCC 10 toolchain installed on the AMI
     CC  = 'gcc10-gcc'
     CXX = 'gcc10-g++'
-
-    // Python 3.8 installed by the AMI (amazon-linux-extras python3.8)
-    PYTHON3_EXE = '/usr/bin/python3.8'
   }
 
   stages {
+
+    stage('Diagnostics') {
+      steps {
+        sh '''
+          set -eux
+
+          echo "=== compilers ==="
+          which gcc || true
+          gcc --version || true
+          which g++ || true
+          g++ --version || true
+
+          echo "=== GCC 10 toolset ==="
+          which gcc10-gcc || true
+          gcc10-gcc --version || true
+          which gcc10-g++ || true
+          gcc10-g++ --version || true
+
+          echo "=== clang ==="
+          which clang || true
+          clang --version || true
+
+          echo "=== python ==="
+          which python || true
+          python --version || true
+          which python3 || true
+          python3 --version || true
+          which python3.8 || true
+          python3.8 --version || true
+
+          echo "=== cmake ==="
+          which cmake || true
+          cmake --version || true
+          which cmake3 || true
+          cmake3 --version || true
+
+          echo "=== ninja ==="
+          which ninja || true
+          ninja --version || true
+          which ninja-build || true
+          ninja-build --version || true
+
+          echo "=== pkg-config ==="
+          which pkg-config || true
+          pkg-config --version || true
+        '''
+      }
+    }
+
     stage('Checkout') {
       steps {
-        // Uses the same repo/branch that triggered the multibranch job
         checkout scm
       }
     }
@@ -39,7 +83,7 @@ pipeline {
             -DLLVM_ENABLE_PROJECTS="${LLVM_PROJECTS}" \
             -DCMAKE_C_COMPILER="${CC}" \
             -DCMAKE_CXX_COMPILER="${CXX}" \
-            -DPython3_EXECUTABLE="${PYTHON3_EXE}"
+            -DPython3_EXECUTABLE=/usr/bin/python3.8
         '''
       }
     }
@@ -53,7 +97,6 @@ pipeline {
       }
     }
 
-    // Optional tests, keep commented until you decide what to run
     // stage('Smoke tests') {
     //   steps {
     //     sh '''

>From 4b326a697fd8993718f209c6c5a71315c892cc79 Mon Sep 17 00:00:00 2001
From: Rodrigo Luiz Galdino Camargo <galdinocamargo at gmail.com>
Date: Tue, 25 Nov 2025 20:34:50 +0000
Subject: [PATCH 7/8] updated

---
 Jenkinsfile | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/Jenkinsfile b/Jenkinsfile
index a5f63af4a6a56..c04c7ce4052a9 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -11,6 +11,7 @@ pipeline {
     LLVM_PROJECTS = 'clang;lld'
     BUILD_DIR     = 'build'
 
+    // Use GCC 10 toolchain installed on the AMI
     CC  = 'gcc10-gcc'
     CXX = 'gcc10-g++'
   }
@@ -65,6 +66,34 @@ pipeline {
       }
     }
 
+    stage('Bootstrap Ninja') {
+      steps {
+        sh '''
+          set -eux
+
+          NINJA_VERSION=1.11.1
+
+          echo "Existing ninja (if any):"
+          command -v ninja || true
+          ninja --version || true
+
+          # Need unzip for the GitHub artifact
+          sudo yum -y install unzip || true
+
+          cd /tmp
+          curl -fsSLO "https://github.com/ninja-build/ninja/releases/download/v${NINJA_VERSION}/ninja-linux.zip"
+          unzip -o ninja-linux.zip
+
+          sudo mv ninja /usr/local/bin/ninja
+          sudo chmod +x /usr/local/bin/ninja
+
+          echo "Ninja after upgrade:"
+          command -v ninja
+          ninja --version
+        '''
+      }
+    }
+
     stage('Checkout') {
       steps {
         checkout scm

>From f4ab8493b18a72ab16236f03e478766b6e97f3f9 Mon Sep 17 00:00:00 2001
From: Rodrigo Luiz Galdino Camargo <galdinocamargo at gmail.com>
Date: Tue, 25 Nov 2025 20:46:59 +0000
Subject: [PATCH 8/8] updated

---
 Jenkinsfile | 30 +-----------------------------
 1 file changed, 1 insertion(+), 29 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index c04c7ce4052a9..0df350a090b33 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -18,7 +18,7 @@ pipeline {
 
   stages {
 
-    stage('Diagnostics') {
+    stage('Toolchain overview') {
       steps {
         sh '''
           set -eux
@@ -66,34 +66,6 @@ pipeline {
       }
     }
 
-    stage('Bootstrap Ninja') {
-      steps {
-        sh '''
-          set -eux
-
-          NINJA_VERSION=1.11.1
-
-          echo "Existing ninja (if any):"
-          command -v ninja || true
-          ninja --version || true
-
-          # Need unzip for the GitHub artifact
-          sudo yum -y install unzip || true
-
-          cd /tmp
-          curl -fsSLO "https://github.com/ninja-build/ninja/releases/download/v${NINJA_VERSION}/ninja-linux.zip"
-          unzip -o ninja-linux.zip
-
-          sudo mv ninja /usr/local/bin/ninja
-          sudo chmod +x /usr/local/bin/ninja
-
-          echo "Ninja after upgrade:"
-          command -v ninja
-          ninja --version
-        '''
-      }
-    }
-
     stage('Checkout') {
       steps {
         checkout scm



More information about the llvm-commits mailing list