[llvm] [Github][libc] Use a container for fullbuild tests (PR #181436)

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 14 10:59:56 PST 2026


https://github.com/boomanaiden154 updated https://github.com/llvm/llvm-project/pull/181436

>From 74f98fd66f8be5a1bf70ccc8c0c98f20ebdf8231 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Fri, 13 Feb 2026 23:45:56 +0000
Subject: [PATCH 1/6] [Github][libc] Use a container for fullbuild tests

This avoids needing to set up deps every time and avoids failures due to
failed dependency installation.
---
 .github/workflows/libc-fullbuild-tests.yml | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/.github/workflows/libc-fullbuild-tests.yml b/.github/workflows/libc-fullbuild-tests.yml
index d9445a6407ccf..cbde4641f40bb 100644
--- a/.github/workflows/libc-fullbuild-tests.yml
+++ b/.github/workflows/libc-fullbuild-tests.yml
@@ -12,6 +12,8 @@ on:
 jobs:
   build:
     runs-on: ${{ matrix.os }}
+    container:
+      image: 'ghcr.io/llvm/libc-ubuntu-24.04'
     strategy:
       fail-fast: false
       matrix:
@@ -102,19 +104,6 @@ jobs:
         max-size: 1G
         key: libc_fullbuild_${{ matrix.c_compiler }}
         variant: sccache
-    
-    # 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)
-      run: |
-        wget https://apt.llvm.org/llvm.sh
-        chmod +x llvm.sh
-        sudo ./llvm.sh 21
-        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
 
     - name: Set reusable strings
       id: strings

>From a65d2fea81b7b12d915199b875816bc2c2f1416c Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Sat, 14 Feb 2026 00:15:41 +0000
Subject: [PATCH 2/6] test

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

diff --git a/.github/workflows/libc-fullbuild-tests.yml b/.github/workflows/libc-fullbuild-tests.yml
index cbde4641f40bb..5b76fc54efb47 100644
--- a/.github/workflows/libc-fullbuild-tests.yml
+++ b/.github/workflows/libc-fullbuild-tests.yml
@@ -109,8 +109,8 @@ jobs:
       id: strings
       shell: bash
       run: |
-        echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
-        echo "build-install-dir=${{ github.workspace }}/install" >> "$GITHUB_OUTPUT"
+        echo "build-output-dir=/home/gha/llvm-project/build" >> "$GITHUB_OUTPUT"
+        echo "build-install-dir=/home/gha/llvm-project/install" >> "$GITHUB_OUTPUT"
     
     # Configure libc fullbuild with scudo.
     # Use MinSizeRel to reduce the size of the build.
@@ -120,7 +120,7 @@ jobs:
 
         export CMAKE_FLAGS="
           -G Ninja
-          -S ${{ github.workspace }}/runtimes
+          -S /home/gha/llvm-project/runtimes
           -B ${{ steps.strings.outputs.build-output-dir }}
           -DCMAKE_ASM_COMPILER=${{ matrix.c_compiler }}
           -DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
@@ -142,7 +142,7 @@ jobs:
         case "${{ matrix.target }}" in
           *-none-eabi|riscv32-unknown-elf)
             cmake $CMAKE_FLAGS \
-              -C ${{ github.workspace }}/libc/cmake/caches/${{ matrix.target }}.cmake
+              -C /home/gha/llvm-project/libc/cmake/caches/${{ matrix.target }}.cmake
             ;;
           *)
             cmake -DLLVM_RUNTIME_TARGETS=${{ matrix.target }} \

>From 425d8fd8afc5ffae8540df2cdb41d72f228ba70e Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Sat, 14 Feb 2026 00:17:37 +0000
Subject: [PATCH 3/6] testing

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

diff --git a/.github/workflows/libc-fullbuild-tests.yml b/.github/workflows/libc-fullbuild-tests.yml
index 5b76fc54efb47..84e528f79f8f0 100644
--- a/.github/workflows/libc-fullbuild-tests.yml
+++ b/.github/workflows/libc-fullbuild-tests.yml
@@ -116,6 +116,8 @@ jobs:
     # Use MinSizeRel to reduce the size of the build.
     - name: Configure CMake
       run: |
+        pwd
+        ls
         export RUNTIMES="libc"
 
         export CMAKE_FLAGS="

>From a5265653a51abe4f8101e662d084d775ede9e37c Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Sat, 14 Feb 2026 00:20:44 +0000
Subject: [PATCH 4/6] testing

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

diff --git a/.github/workflows/libc-fullbuild-tests.yml b/.github/workflows/libc-fullbuild-tests.yml
index 84e528f79f8f0..d36d08232bba7 100644
--- a/.github/workflows/libc-fullbuild-tests.yml
+++ b/.github/workflows/libc-fullbuild-tests.yml
@@ -109,8 +109,8 @@ jobs:
       id: strings
       shell: bash
       run: |
-        echo "build-output-dir=/home/gha/llvm-project/build" >> "$GITHUB_OUTPUT"
-        echo "build-install-dir=/home/gha/llvm-project/install" >> "$GITHUB_OUTPUT"
+        echo "build-output-dir=/__w/llvm-project/llvm-project/build" >> "$GITHUB_OUTPUT"
+        echo "build-install-dir=/__w/llvm-project/llvm-project/install" >> "$GITHUB_OUTPUT"
     
     # Configure libc fullbuild with scudo.
     # Use MinSizeRel to reduce the size of the build.
@@ -122,7 +122,7 @@ jobs:
 
         export CMAKE_FLAGS="
           -G Ninja
-          -S /home/gha/llvm-project/runtimes
+          -S /__w/llvm-project/llvm-project/runtimes
           -B ${{ steps.strings.outputs.build-output-dir }}
           -DCMAKE_ASM_COMPILER=${{ matrix.c_compiler }}
           -DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
@@ -144,7 +144,7 @@ jobs:
         case "${{ matrix.target }}" in
           *-none-eabi|riscv32-unknown-elf)
             cmake $CMAKE_FLAGS \
-              -C /home/gha/llvm-project/libc/cmake/caches/${{ matrix.target }}.cmake
+              -C /__w/llvm-project/llvm-project/libc/cmake/caches/${{ matrix.target }}.cmake
             ;;
           *)
             cmake -DLLVM_RUNTIME_TARGETS=${{ matrix.target }} \

>From 11062794aca40e46edf0326d8f240d45ee77e025 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Sat, 14 Feb 2026 18:42:17 +0000
Subject: [PATCH 5/6] privileged

---
 .github/workflows/libc-fullbuild-tests.yml | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/libc-fullbuild-tests.yml b/.github/workflows/libc-fullbuild-tests.yml
index d36d08232bba7..86a37878e7ea2 100644
--- a/.github/workflows/libc-fullbuild-tests.yml
+++ b/.github/workflows/libc-fullbuild-tests.yml
@@ -14,6 +14,11 @@ jobs:
     runs-on: ${{ matrix.os }}
     container:
       image: 'ghcr.io/llvm/libc-ubuntu-24.04'
+      # We need to enable privileged containers so that certain libc tests
+      # have the necessary permissions (like SYS_TIME). There are no security
+      # implications as we are already running in an isolated VM.
+      options: >-
+        --privileged
     strategy:
       fail-fast: false
       matrix:
@@ -116,8 +121,6 @@ jobs:
     # Use MinSizeRel to reduce the size of the build.
     - name: Configure CMake
       run: |
-        pwd
-        ls
         export RUNTIMES="libc"
 
         export CMAKE_FLAGS="

>From 206236cae303763c2162c8631484d9c5cf016b37 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Sat, 14 Feb 2026 18:59:43 +0000
Subject: [PATCH 6/6] container arm

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

diff --git a/.github/workflows/libc-fullbuild-tests.yml b/.github/workflows/libc-fullbuild-tests.yml
index 86a37878e7ea2..88e28bccd0ec7 100644
--- a/.github/workflows/libc-fullbuild-tests.yml
+++ b/.github/workflows/libc-fullbuild-tests.yml
@@ -13,7 +13,7 @@ jobs:
   build:
     runs-on: ${{ matrix.os }}
     container:
-      image: 'ghcr.io/llvm/libc-ubuntu-24.04'
+      image: ${{ (startsWith(matrix.runs-on, 'ubuntu-24.04-arm') && 'ghcr.io/llvm/arm64v8/libc-ubuntu-24.04') || 'ghcr.io/llvm/libc-ubuntu-24.04'}}
       # We need to enable privileged containers so that certain libc tests
       # have the necessary permissions (like SYS_TIME). There are no security
       # implications as we are already running in an isolated VM.



More information about the llvm-commits mailing list