[llvm] [libc][ci] Add libc-shared-test CI for MSVC, ppc64le, and s390x. (PR #188553)

via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 25 15:47:39 PDT 2026


https://github.com/lntue updated https://github.com/llvm/llvm-project/pull/188553

>From 8992aeb7c3c4a827b4f223f68907ef470623f6dd Mon Sep 17 00:00:00 2001
From: Tue Ly <lntue at google.com>
Date: Wed, 25 Mar 2026 13:43:30 -0400
Subject: [PATCH 1/8] [libc][ci] Add libc-shared-test CI for MSVC, ppc64le, and
 s390x.

---
 .github/workflows/libc-shared-tests.yml | 69 +++++++++++++++++++++++++
 1 file changed, 69 insertions(+)
 create mode 100644 .github/workflows/libc-shared-tests.yml

diff --git a/.github/workflows/libc-shared-tests.yml b/.github/workflows/libc-shared-tests.yml
new file mode 100644
index 0000000000000..fd27d82cd6423
--- /dev/null
+++ b/.github/workflows/libc-shared-tests.yml
@@ -0,0 +1,69 @@
+name: libc Precommit CI - shared ßtests
+permissions:
+  contents: read
+on:
+  pull_request:
+    paths:
+      - 'libc/**'
+      - '.github/workflows/libc-shared-tests.yml'
+
+jobs:
+  # -------------------------------------------------------------
+  # Job 1: Windows Native (MSVC)
+  # -------------------------------------------------------------
+  windows-msvc-shared:
+    name: MSVC libc-shared-test
+    runs-on: windows-2022
+    steps:
+      - name: Checkout LLVM
+        uses: actions/checkout at v4
+
+      - name: Setup MSVC Dev Environment
+        uses: ilammy/msvc-dev-cmd at v1
+        with:
+          arch: x64
+
+      - name: Configure CMake
+        run: |
+          cmake -B build -S runtimes -G Ninja `
+            -DLLVM_ENABLE_RUNTIMES=libc `
+            -DCMAKE_C_COMPILER=cl `
+            -DCMAKE_CXX_COMPILER=cl `
+            -DCMAKE_BUILD_TYPE=Release
+
+      - name: Build and Test
+        run: cmake --build build --target libc-shared-test
+
+  # -------------------------------------------------------------
+  # Job 2: Linux Emulated (ppc64le & s390x)
+  # -------------------------------------------------------------
+  linux-cross-arch-shared:
+    name: Clang libc-shared-test (${{ matrix.arch }})
+    runs-on: ubuntu-24.04
+    strategy:
+      fail-fast: false # If one arch fails, let the other finish
+      matrix:
+        arch: [ppc64le, s390x]
+    
+    steps:
+      - name: Checkout LLVM
+        uses: actions/checkout at v4
+
+      # Uses QEMU and Docker to seamlessly run commands in an emulated architecture
+      - name: Build and Test in Emulated Container
+        uses: uraimo/run-on-arch-action at v2
+        with:
+          arch: ${{ matrix.arch }}
+          githubToken: ${{ github.token }}
+          install: |
+            apt-get update -y
+            apt-get install -y cmake ninja-build clang lld
+          run: |
+            # Using Clang inside the emulated Ubuntu container
+            cmake -B build -S runtimes -G Ninja \
+              -DLLVM_ENABLE_RUNTIMES=libc \
+              -DCMAKE_C_COMPILER=clang \
+              -DCMAKE_CXX_COMPILER=clang++ \
+              -DCMAKE_BUILD_TYPE=Release
+              
+            cmake --build build --target libc-shared-test

>From a20c8241c66119e54f9ec98d0a3621a033b91137 Mon Sep 17 00:00:00 2001
From: Tue Ly <lntue at google.com>
Date: Wed, 25 Mar 2026 13:56:42 -0400
Subject: [PATCH 2/8] Pin versions and remove token.

---
 .github/workflows/libc-shared-tests.yml | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/libc-shared-tests.yml b/.github/workflows/libc-shared-tests.yml
index fd27d82cd6423..073bb9178efa0 100644
--- a/.github/workflows/libc-shared-tests.yml
+++ b/.github/workflows/libc-shared-tests.yml
@@ -1,4 +1,4 @@
-name: libc Precommit CI - shared ßtests
+name: libc Precommit CI - shared tests
 permissions:
   contents: read
 on:
@@ -16,10 +16,10 @@ jobs:
     runs-on: windows-2022
     steps:
       - name: Checkout LLVM
-        uses: actions/checkout at v4
+        uses: actions/checkout at 8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
 
       - name: Setup MSVC Dev Environment
-        uses: ilammy/msvc-dev-cmd at v1
+        uses: ilammy/msvc-dev-cmd at 0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
         with:
           arch: x64
 
@@ -47,14 +47,13 @@ jobs:
     
     steps:
       - name: Checkout LLVM
-        uses: actions/checkout at v4
+        uses: actions/checkout at 8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
 
       # Uses QEMU and Docker to seamlessly run commands in an emulated architecture
       - name: Build and Test in Emulated Container
-        uses: uraimo/run-on-arch-action at v2
+        uses: uraimo/run-on-arch-action at d94c13912ea685de38fccc1109385b83fd79427d # v3.0.1
         with:
           arch: ${{ matrix.arch }}
-          githubToken: ${{ github.token }}
           install: |
             apt-get update -y
             apt-get install -y cmake ninja-build clang lld

>From 64ad1d3e2a60875e10b6cadb3ff6e427687923e2 Mon Sep 17 00:00:00 2001
From: Tue Ly <lntue at google.com>
Date: Wed, 25 Mar 2026 14:06:36 -0400
Subject: [PATCH 3/8] Fix target name.

---
 .github/workflows/libc-shared-tests.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/libc-shared-tests.yml b/.github/workflows/libc-shared-tests.yml
index 073bb9178efa0..605d6cb970ca6 100644
--- a/.github/workflows/libc-shared-tests.yml
+++ b/.github/workflows/libc-shared-tests.yml
@@ -32,7 +32,7 @@ jobs:
             -DCMAKE_BUILD_TYPE=Release
 
       - name: Build and Test
-        run: cmake --build build --target libc-shared-test
+        run: cmake --build build --target libc-shared-tests
 
   # -------------------------------------------------------------
   # Job 2: Linux Emulated (ppc64le & s390x)
@@ -65,4 +65,4 @@ jobs:
               -DCMAKE_CXX_COMPILER=clang++ \
               -DCMAKE_BUILD_TYPE=Release
               
-            cmake --build build --target libc-shared-test
+            cmake --build build --target libc-shared-tests

>From 7cde8628fca63d7c8a1d7be066c5dbe6fe527ed1 Mon Sep 17 00:00:00 2001
From: Tue Ly <lntue at google.com>
Date: Wed, 25 Mar 2026 18:25:11 -0400
Subject: [PATCH 4/8] Try different qemu setup.

---
 .github/workflows/libc-shared-tests.yml | 27 +++++++++++++++++--------
 1 file changed, 19 insertions(+), 8 deletions(-)

diff --git a/.github/workflows/libc-shared-tests.yml b/.github/workflows/libc-shared-tests.yml
index 605d6cb970ca6..5e12b320f7c95 100644
--- a/.github/workflows/libc-shared-tests.yml
+++ b/.github/workflows/libc-shared-tests.yml
@@ -43,26 +43,37 @@ jobs:
     strategy:
       fail-fast: false # If one arch fails, let the other finish
       matrix:
-        arch: [ppc64le, s390x]
+        includes:
+        - arch: aarch64
+          libc: libc6-dev-aarch64-cross
+          libcpp: libstdc++14-dev-aarch64-cross
+          target_triple: aarch64-linux-gnu
+        - arch: riscv64
+          libc: libc6-dev-riscv64-cross
+          libcpp: libstdc++14-dev-riscv64-cross
+          target_triple: riscv64-linux-gnu
+        - arch: ppc64le
+          libc: libc6-dev-ppc64el-cross
+          libcpp: libstdc++14-dev-ppc64el-cross
+          target_triple: ppc64le-linux-gnu
     
     steps:
       - name: Checkout LLVM
         uses: actions/checkout at 8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
 
-      # Uses QEMU and Docker to seamlessly run commands in an emulated architecture
-      - name: Build and Test in Emulated Container
-        uses: uraimo/run-on-arch-action at d94c13912ea685de38fccc1109385b83fd79427d # v3.0.1
+      - name: Prepare dependencies
         with:
-          arch: ${{ matrix.arch }}
+          arch: x64
           install: |
             apt-get update -y
-            apt-get install -y cmake ninja-build clang lld
+            apt-get install -y cmake ninja-build clang lld qemu-user-static ${{ matrix.libc }} ${{ matrix.libcpp }}
           run: |
             # Using Clang inside the emulated Ubuntu container
-            cmake -B build -S runtimes -G Ninja \
+            cmake -B build -S llvm -G Ninja \
               -DLLVM_ENABLE_RUNTIMES=libc \
               -DCMAKE_C_COMPILER=clang \
               -DCMAKE_CXX_COMPILER=clang++ \
-              -DCMAKE_BUILD_TYPE=Release
+              -DCMAKE_BUILD_TYPE=Release \
+              -DLIBC_TARGET_TRIPLE=${{ target_triple }}
               
             cmake --build build --target libc-shared-tests

>From ba841b00c26e16058056543d8ab615b67b909f53 Mon Sep 17 00:00:00 2001
From: Tue Ly <lntue at google.com>
Date: Wed, 25 Mar 2026 18:31:47 -0400
Subject: [PATCH 5/8] Fix include.

---
 .github/workflows/libc-shared-tests.yml | 30 ++++++++++++-------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/.github/workflows/libc-shared-tests.yml b/.github/workflows/libc-shared-tests.yml
index 5e12b320f7c95..eb1a0c269a272 100644
--- a/.github/workflows/libc-shared-tests.yml
+++ b/.github/workflows/libc-shared-tests.yml
@@ -12,7 +12,7 @@ jobs:
   # Job 1: Windows Native (MSVC)
   # -------------------------------------------------------------
   windows-msvc-shared:
-    name: MSVC libc-shared-test
+    name: libc-shared-test with MSVC
     runs-on: windows-2022
     steps:
       - name: Checkout LLVM
@@ -38,24 +38,24 @@ jobs:
   # Job 2: Linux Emulated (ppc64le & s390x)
   # -------------------------------------------------------------
   linux-cross-arch-shared:
-    name: Clang libc-shared-test (${{ matrix.arch }})
+    name: libc-shared-tests on (${{ matrix.arch }})
     runs-on: ubuntu-24.04
     strategy:
       fail-fast: false # If one arch fails, let the other finish
       matrix:
-        includes:
-        - arch: aarch64
-          libc: libc6-dev-aarch64-cross
-          libcpp: libstdc++14-dev-aarch64-cross
-          target_triple: aarch64-linux-gnu
-        - arch: riscv64
-          libc: libc6-dev-riscv64-cross
-          libcpp: libstdc++14-dev-riscv64-cross
-          target_triple: riscv64-linux-gnu
-        - arch: ppc64le
-          libc: libc6-dev-ppc64el-cross
-          libcpp: libstdc++14-dev-ppc64el-cross
-          target_triple: ppc64le-linux-gnu
+        include:
+          - arch: aarch64
+            libc: libc6-dev-aarch64-cross
+            libcpp: libstdc++14-dev-aarch64-cross
+            target_triple: aarch64-linux-gnu
+          - arch: riscv64
+            libc: libc6-dev-riscv64-cross
+            libcpp: libstdc++14-dev-riscv64-cross
+            target_triple: riscv64-linux-gnu
+          - arch: ppc64le
+            libc: libc6-dev-ppc64el-cross
+            libcpp: libstdc++14-dev-ppc64el-cross
+            target_triple: ppc64le-linux-gnu
     
     steps:
       - name: Checkout LLVM

>From 5675334a914865332ef7694d581823202d39b743 Mon Sep 17 00:00:00 2001
From: Tue Ly <lntue at google.com>
Date: Wed, 25 Mar 2026 18:37:51 -0400
Subject: [PATCH 6/8] Update steps.

---
 .github/workflows/libc-shared-tests.yml | 31 +++++++++++++------------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/.github/workflows/libc-shared-tests.yml b/.github/workflows/libc-shared-tests.yml
index eb1a0c269a272..d7002c03e0e7a 100644
--- a/.github/workflows/libc-shared-tests.yml
+++ b/.github/workflows/libc-shared-tests.yml
@@ -62,18 +62,19 @@ jobs:
         uses: actions/checkout at 8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
 
       - name: Prepare dependencies
-        with:
-          arch: x64
-          install: |
-            apt-get update -y
-            apt-get install -y cmake ninja-build clang lld qemu-user-static ${{ matrix.libc }} ${{ matrix.libcpp }}
-          run: |
-            # Using Clang inside the emulated Ubuntu container
-            cmake -B build -S llvm -G Ninja \
-              -DLLVM_ENABLE_RUNTIMES=libc \
-              -DCMAKE_C_COMPILER=clang \
-              -DCMAKE_CXX_COMPILER=clang++ \
-              -DCMAKE_BUILD_TYPE=Release \
-              -DLIBC_TARGET_TRIPLE=${{ target_triple }}
-              
-            cmake --build build --target libc-shared-tests
+        run: |
+          apt-get update -y
+          apt-get install -y cmake ninja-build clang lld qemu-user-static ${{ matrix.libc }} ${{ matrix.libcpp }}
+      
+      - name: Configure CMake
+        run: |
+          cmake -B build -S llvm -G Ninja \
+            -DLLVM_ENABLE_RUNTIMES=libc \
+            -DCMAKE_C_COMPILER=clang \
+            -DCMAKE_CXX_COMPILER=clang++ \
+            -DCMAKE_BUILD_TYPE=Release \
+            -DLIBC_TARGET_TRIPLE=${{ target_triple }}
+
+      - name: Build and Run              
+        run: |
+          cmake --build build --target libc-shared-tests

>From cddb06683d07eff955cc117ed4ee18c778a05309 Mon Sep 17 00:00:00 2001
From: Tue Ly <lntue at google.com>
Date: Wed, 25 Mar 2026 18:43:41 -0400
Subject: [PATCH 7/8] Fix target triple.

---
 .github/workflows/libc-shared-tests.yml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/libc-shared-tests.yml b/.github/workflows/libc-shared-tests.yml
index d7002c03e0e7a..a4bccf12fa81c 100644
--- a/.github/workflows/libc-shared-tests.yml
+++ b/.github/workflows/libc-shared-tests.yml
@@ -73,7 +73,7 @@ jobs:
             -DCMAKE_C_COMPILER=clang \
             -DCMAKE_CXX_COMPILER=clang++ \
             -DCMAKE_BUILD_TYPE=Release \
-            -DLIBC_TARGET_TRIPLE=${{ target_triple }}
+            -DLIBC_TARGET_TRIPLE=${{ matrix.target_triple }}
 
       - name: Build and Run              
         run: |

>From e954678836c92ddca8a145a57ee1852f55d0c99d Mon Sep 17 00:00:00 2001
From: Tue Ly <lntue at google.com>
Date: Wed, 25 Mar 2026 18:47:14 -0400
Subject: [PATCH 8/8] Use sudo for apt-get.

---
 .github/workflows/libc-shared-tests.yml | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/libc-shared-tests.yml b/.github/workflows/libc-shared-tests.yml
index a4bccf12fa81c..d03f735c4a153 100644
--- a/.github/workflows/libc-shared-tests.yml
+++ b/.github/workflows/libc-shared-tests.yml
@@ -60,11 +60,13 @@ jobs:
     steps:
       - name: Checkout LLVM
         uses: actions/checkout at 8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
+        with:
+          persist-credentials: false
 
       - name: Prepare dependencies
         run: |
-          apt-get update -y
-          apt-get install -y cmake ninja-build clang lld qemu-user-static ${{ matrix.libc }} ${{ matrix.libcpp }}
+          sudo apt-get update -y
+          sudo apt-get install -y cmake ninja-build clang lld qemu-user-static ${{ matrix.libc }} ${{ matrix.libcpp }}
       
       - name: Configure CMake
         run: |



More information about the llvm-commits mailing list