[llvm] [libc][workflow] improve ci coverage with windows-2025 and arm ubuntu (PR #123745)

Schrodinger ZHU Yifan via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 24 03:51:18 PST 2025


https://github.com/SchrodingerZhu updated https://github.com/llvm/llvm-project/pull/123745

>From 6ef0df0d884a6fa5a38aac92a845cd6542f7ba96 Mon Sep 17 00:00:00 2001
From: Schrodinger ZHU Yifan <i at zhuyi.fan>
Date: Tue, 21 Jan 2025 12:33:14 +0000
Subject: [PATCH 1/5] [libc][workflow] improve ci coverage with windows-2024
 and arm ubuntu

---
 .github/workflows/libc-fullbuild-tests.yml | 8 ++++++--
 .github/workflows/libc-overlay-tests.yml   | 8 ++++++++
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/libc-fullbuild-tests.yml b/.github/workflows/libc-fullbuild-tests.yml
index 58e15ce29546ef..1db69665ae186d 100644
--- a/.github/workflows/libc-fullbuild-tests.yml
+++ b/.github/workflows/libc-fullbuild-tests.yml
@@ -11,12 +11,16 @@ on:
 
 jobs:
   build:
-    runs-on: ubuntu-24.04
+    runs-on: ${{ matrix.os }}
     strategy:
       fail-fast: false
       matrix:
         include:
-          - c_compiler: clang
+          - os: ubuntu-24.04
+            c_compiler: clang
+            cpp_compiler: clang++
+          - os: ubuntu-24.04-arm
+            c_compiler: clang
             cpp_compiler: clang++
           # TODO: add back gcc build when it is fixed
           # - c_compiler: gcc
diff --git a/.github/workflows/libc-overlay-tests.yml b/.github/workflows/libc-overlay-tests.yml
index 8b59d76aed4a88..62c99742f7a6cc 100644
--- a/.github/workflows/libc-overlay-tests.yml
+++ b/.github/workflows/libc-overlay-tests.yml
@@ -22,10 +22,18 @@ jobs:
             compiler:
               c_compiler: clang
               cpp_compiler: clang++
+          - os: ubuntu-24.04-arm
+            compiler:
+              c_compiler: clang
+              cpp_compiler: clang++
           - os: windows-2022
             compiler:
               c_compiler: clang-cl
               cpp_compiler: clang-cl
+          - os: windows-2025
+            compiler:
+              c_compiler: clang-cl
+              cpp_compiler: clang-cl
           - os: macos-14
             compiler:
               c_compiler: clang

>From d26214b353f5a00fbb7c75cd61a4a3a0d25b8aad Mon Sep 17 00:00:00 2001
From: Schrodinger ZHU Yifan <i at zhuyi.fan>
Date: Tue, 21 Jan 2025 12:42:12 +0000
Subject: [PATCH 2/5] skip ccache on arm64

---
 .github/workflows/libc-fullbuild-tests.yml | 7 +++++++
 .github/workflows/libc-overlay-tests.yml   | 6 ++++++
 2 files changed, 13 insertions(+)

diff --git a/.github/workflows/libc-fullbuild-tests.yml b/.github/workflows/libc-fullbuild-tests.yml
index 1db69665ae186d..9cb1dd32b1e2a8 100644
--- a/.github/workflows/libc-fullbuild-tests.yml
+++ b/.github/workflows/libc-fullbuild-tests.yml
@@ -36,6 +36,7 @@ jobs:
     # frequent small object writes.
     - name: Setup ccache
       uses: hendrikmuhs/ccache-action at v1.2
+      if: runner.arch == 'X64'
       with:
         max-size: 1G
         key: libc_fullbuild_${{ matrix.c_compiler }}
@@ -46,10 +47,16 @@ jobs:
     # - Debian has a multilib setup, so we need to symlink the asm directory.
     #   For more information, see https://wiki.debian.org/Multiarch/LibraryPathOverview
     - name: Prepare dependencies (Ubuntu)
+      shell: bash
       run: |
         sudo apt-get update
         sudo apt-get install -y libmpfr-dev libgmp-dev libmpc-dev ninja-build linux-libc-dev
         sudo ln -sf /usr/include/$(uname -p)-linux-gnu/asm /usr/include/asm
+        if [[ $(uname -m) == 'aarch64' ]]; then
+          wget https://github.com/mozilla/sccache/releases/download/v0.9.1/sccache-v0.9.1-aarch64-unknown-linux-musl.tar.gz
+          tar xvaf sccache-v0.9.1-aarch64-unknown-linux-musl.tar.gz
+          sudo cp sccache-v0.9.1-aarch64-unknown-linux-musl/sccache /usr/bin
+        fi
 
     - name: Set reusable strings
       id: strings
diff --git a/.github/workflows/libc-overlay-tests.yml b/.github/workflows/libc-overlay-tests.yml
index 62c99742f7a6cc..1fc77860a3cfe4 100644
--- a/.github/workflows/libc-overlay-tests.yml
+++ b/.github/workflows/libc-overlay-tests.yml
@@ -51,6 +51,7 @@ jobs:
     # frequent small object writes.
     - name: Setup ccache
       uses: hendrikmuhs/ccache-action at v1
+      if: runner.arch == 'X64'
       with:
         max-size: 1G
         key: libc_overlay_build_${{ matrix.os }}_${{ matrix.compiler.c_compiler }}
@@ -62,6 +63,11 @@ jobs:
       run: |
         sudo apt-get update
         sudo apt-get install -y libmpfr-dev libgmp-dev libmpc-dev ninja-build
+        if [[ $(uname -m) == 'aarch64' ]]; then
+          wget https://github.com/mozilla/sccache/releases/download/v0.9.1/sccache-v0.9.1-aarch64-unknown-linux-musl.tar.gz
+          tar xvaf sccache-v0.9.1-aarch64-unknown-linux-musl.tar.gz
+          sudo cp sccache-v0.9.1-aarch64-unknown-linux-musl/sccache /usr/bin
+        fi
     
     # Chocolatey is shipped with Windows runners. Windows Server 2025 recommends WinGet.
     # Consider migrating to WinGet when Windows Server 2025 is available.

>From 5527418c8e471194f87d92f644572c1d5524d455 Mon Sep 17 00:00:00 2001
From: Schrodinger ZHU Yifan <i at zhuyi.fan>
Date: Tue, 21 Jan 2025 23:50:58 +0000
Subject: [PATCH 3/5] address CR

---
 .github/workflows/libc-fullbuild-tests.yml | 11 +++--------
 .github/workflows/libc-overlay-tests.yml   | 13 ++++++-------
 2 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/.github/workflows/libc-fullbuild-tests.yml b/.github/workflows/libc-fullbuild-tests.yml
index 9cb1dd32b1e2a8..7c3e9ac027b26a 100644
--- a/.github/workflows/libc-fullbuild-tests.yml
+++ b/.github/workflows/libc-fullbuild-tests.yml
@@ -17,9 +17,11 @@ jobs:
       matrix:
         include:
           - os: ubuntu-24.04
+            ccache-variant: sccache
             c_compiler: clang
             cpp_compiler: clang++
           - os: ubuntu-24.04-arm
+            ccache-variant: ccache
             c_compiler: clang
             cpp_compiler: clang++
           # TODO: add back gcc build when it is fixed
@@ -36,27 +38,20 @@ jobs:
     # frequent small object writes.
     - name: Setup ccache
       uses: hendrikmuhs/ccache-action at v1.2
-      if: runner.arch == 'X64'
       with:
         max-size: 1G
         key: libc_fullbuild_${{ matrix.c_compiler }}
-        variant: sccache
+        variant: ${{ matrix.ccache-variant }}
     
     # Notice:
     # - MPFR is required by some of the mathlib tests.
     # - Debian has a multilib setup, so we need to symlink the asm directory.
     #   For more information, see https://wiki.debian.org/Multiarch/LibraryPathOverview
     - name: Prepare dependencies (Ubuntu)
-      shell: bash
       run: |
         sudo apt-get update
         sudo apt-get install -y libmpfr-dev libgmp-dev libmpc-dev ninja-build linux-libc-dev
         sudo ln -sf /usr/include/$(uname -p)-linux-gnu/asm /usr/include/asm
-        if [[ $(uname -m) == 'aarch64' ]]; then
-          wget https://github.com/mozilla/sccache/releases/download/v0.9.1/sccache-v0.9.1-aarch64-unknown-linux-musl.tar.gz
-          tar xvaf sccache-v0.9.1-aarch64-unknown-linux-musl.tar.gz
-          sudo cp sccache-v0.9.1-aarch64-unknown-linux-musl/sccache /usr/bin
-        fi
 
     - name: Set reusable strings
       id: strings
diff --git a/.github/workflows/libc-overlay-tests.yml b/.github/workflows/libc-overlay-tests.yml
index 1fc77860a3cfe4..929b01d36321b7 100644
--- a/.github/workflows/libc-overlay-tests.yml
+++ b/.github/workflows/libc-overlay-tests.yml
@@ -19,22 +19,27 @@ jobs:
         include:
           # TODO: add linux gcc when it is fixed
           - os: ubuntu-24.04
+            ccache-variant: sccache
             compiler:
               c_compiler: clang
               cpp_compiler: clang++
           - os: ubuntu-24.04-arm
+            ccache-variant: ccache
             compiler:
               c_compiler: clang
               cpp_compiler: clang++
           - os: windows-2022
+            ccache-variant: sccache
             compiler:
               c_compiler: clang-cl
               cpp_compiler: clang-cl
           - os: windows-2025
+            ccache-variant: sccache
             compiler:
               c_compiler: clang-cl
               cpp_compiler: clang-cl
           - os: macos-14
+            ccache-variant: sccache
             compiler:
               c_compiler: clang
               cpp_compiler: clang++
@@ -51,11 +56,10 @@ jobs:
     # frequent small object writes.
     - name: Setup ccache
       uses: hendrikmuhs/ccache-action at v1
-      if: runner.arch == 'X64'
       with:
         max-size: 1G
         key: libc_overlay_build_${{ matrix.os }}_${{ matrix.compiler.c_compiler }}
-        variant: sccache
+        variant: ${{ matrix.ccache-variant }}
     
     # MPFR is required by some of the mathlib tests.
     - name: Prepare dependencies (Ubuntu)
@@ -63,11 +67,6 @@ jobs:
       run: |
         sudo apt-get update
         sudo apt-get install -y libmpfr-dev libgmp-dev libmpc-dev ninja-build
-        if [[ $(uname -m) == 'aarch64' ]]; then
-          wget https://github.com/mozilla/sccache/releases/download/v0.9.1/sccache-v0.9.1-aarch64-unknown-linux-musl.tar.gz
-          tar xvaf sccache-v0.9.1-aarch64-unknown-linux-musl.tar.gz
-          sudo cp sccache-v0.9.1-aarch64-unknown-linux-musl/sccache /usr/bin
-        fi
     
     # Chocolatey is shipped with Windows runners. Windows Server 2025 recommends WinGet.
     # Consider migrating to WinGet when Windows Server 2025 is available.

>From 6259b5e7ae7a4387160bf511d6676fc2af70e60b Mon Sep 17 00:00:00 2001
From: Schrodinger ZHU Yifan <i at zhuyi.fan>
Date: Tue, 21 Jan 2025 23:54:32 +0000
Subject: [PATCH 4/5] fix build

---
 .github/workflows/libc-fullbuild-tests.yml | 4 ++--
 .github/workflows/libc-overlay-tests.yml   | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/.github/workflows/libc-fullbuild-tests.yml b/.github/workflows/libc-fullbuild-tests.yml
index 7c3e9ac027b26a..a228651bf0014d 100644
--- a/.github/workflows/libc-fullbuild-tests.yml
+++ b/.github/workflows/libc-fullbuild-tests.yml
@@ -68,8 +68,8 @@ jobs:
         -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
         -DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
         -DCMAKE_BUILD_TYPE=MinSizeRel
-        -DCMAKE_C_COMPILER_LAUNCHER=sccache
-        -DCMAKE_CXX_COMPILER_LAUNCHER=sccache
+        -DCMAKE_C_COMPILER_LAUNCHER=${{ matrix.ccache-variant }}
+        -DCMAKE_CXX_COMPILER_LAUNCHER=${{ matrix.ccache-variant }}
         -DCMAKE_INSTALL_PREFIX=${{ steps.strings.outputs.build-install-dir }}
         -DLLVM_ENABLE_RUNTIMES="libc;compiler-rt"
         -DLLVM_LIBC_FULL_BUILD=ON
diff --git a/.github/workflows/libc-overlay-tests.yml b/.github/workflows/libc-overlay-tests.yml
index 929b01d36321b7..9e6c637603c880 100644
--- a/.github/workflows/libc-overlay-tests.yml
+++ b/.github/workflows/libc-overlay-tests.yml
@@ -95,8 +95,8 @@ jobs:
         -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cpp_compiler }}
         -DCMAKE_C_COMPILER=${{ matrix.compiler.c_compiler }}
         -DCMAKE_BUILD_TYPE=MinSizeRel
-        -DCMAKE_C_COMPILER_LAUNCHER=sccache
-        -DCMAKE_CXX_COMPILER_LAUNCHER=sccache
+        -DCMAKE_C_COMPILER_LAUNCHER=${{ matrix.ccache-variant }}
+        -DCMAKE_CXX_COMPILER_LAUNCHER=${{ matrix.ccache-variant }}
         -DCMAKE_POLICY_DEFAULT_CMP0141=NEW
         -DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=Embedded
         -DLLVM_ENABLE_RUNTIMES=libc

>From d62e81e09b4936b8800b69b82bc31fa76ee84c7b Mon Sep 17 00:00:00 2001
From: Schrodinger ZHU Yifan <i at zhuyi.fan>
Date: Fri, 24 Jan 2025 19:48:56 +0800
Subject: [PATCH 5/5] address CR

---
 .github/workflows/libc-fullbuild-tests.yml | 1 +
 .github/workflows/libc-overlay-tests.yml   | 1 +
 2 files changed, 2 insertions(+)

diff --git a/.github/workflows/libc-fullbuild-tests.yml b/.github/workflows/libc-fullbuild-tests.yml
index a228651bf0014d..2c88da653aae4a 100644
--- a/.github/workflows/libc-fullbuild-tests.yml
+++ b/.github/workflows/libc-fullbuild-tests.yml
@@ -20,6 +20,7 @@ jobs:
             ccache-variant: sccache
             c_compiler: clang
             cpp_compiler: clang++
+          # TODO: remove ccache logic when https://github.com/hendrikmuhs/ccache-action/issues/279 is resolved.
           - os: ubuntu-24.04-arm
             ccache-variant: ccache
             c_compiler: clang
diff --git a/.github/workflows/libc-overlay-tests.yml b/.github/workflows/libc-overlay-tests.yml
index 9e6c637603c880..0a0916084b18c1 100644
--- a/.github/workflows/libc-overlay-tests.yml
+++ b/.github/workflows/libc-overlay-tests.yml
@@ -23,6 +23,7 @@ jobs:
             compiler:
               c_compiler: clang
               cpp_compiler: clang++
+          # TODO: remove ccache logic when https://github.com/hendrikmuhs/ccache-action/issues/279 is resolved.
           - os: ubuntu-24.04-arm
             ccache-variant: ccache
             compiler:



More information about the llvm-commits mailing list