[llvm] [libc] add multi-platform pre-commit github actions (PR #119104)
Schrodinger ZHU Yifan via llvm-commits
llvm-commits at lists.llvm.org
Sat Dec 7 19:26:44 PST 2024
https://github.com/SchrodingerZhu updated https://github.com/llvm/llvm-project/pull/119104
>From e6e227af2c9ab4141a8ca562b9423f3f19ac2f9a Mon Sep 17 00:00:00 2001
From: schrodingerzhu <i at zhuyi.fan>
Date: Sat, 7 Dec 2024 20:20:35 -0500
Subject: [PATCH 01/20] [libc] add multi-platform pre-commit github actions
---
.github/workflows/libc-fullbuild-tests.yml | 0
.github/workflows/libc-gpu-build.yml | 0
.github/workflows/libc-overlay-tests.yml | 66 ++++++++++++++++++++++
3 files changed, 66 insertions(+)
create mode 100644 .github/workflows/libc-fullbuild-tests.yml
create mode 100644 .github/workflows/libc-gpu-build.yml
create mode 100644 .github/workflows/libc-overlay-tests.yml
diff --git a/.github/workflows/libc-fullbuild-tests.yml b/.github/workflows/libc-fullbuild-tests.yml
new file mode 100644
index 00000000000000..e69de29bb2d1d6
diff --git a/.github/workflows/libc-gpu-build.yml b/.github/workflows/libc-gpu-build.yml
new file mode 100644
index 00000000000000..e69de29bb2d1d6
diff --git a/.github/workflows/libc-overlay-tests.yml b/.github/workflows/libc-overlay-tests.yml
new file mode 100644
index 00000000000000..63732a37277886
--- /dev/null
+++ b/.github/workflows/libc-overlay-tests.yml
@@ -0,0 +1,66 @@
+# This workflow is for pre-commit testing of the LLVM-libc project.
+name: LLVM-libc Pre-commit Overlay Tests
+
+on:
+ pull_request:
+ branches: [ "main" ]
+ paths:
+ - 'libc/**'
+ - '.github/workflows/libc-overlay-tests.yml'
+
+jobs:
+ build:
+ env:
+ SCCACHE_GHA_ENABLED: "true"
+ runs-on: ${{ matrix.os }}
+ strategy:
+ # Set fail-fast to false to ensure that feedback is delivered for all matrix combinations.
+ fail-fast: false
+ matrix:
+ os: [ubuntu-latest, windows-latest, macos-latest]
+ build_type: [Release, Debug]
+ compiler: [
+ { c_compiler: gcc, cpp_compiler: g++ },
+ { c_compiler: clang, cpp_compiler: clang++ },
+ { c_compiler: clang-cl, cpp_compiler: clang-cl }
+ ]
+ exclude:
+ - os: windows-latest
+ compiler: { c_compiler: gcc, cpp_compiler: g++ }
+ - os: ubuntu-latest
+ compiler: { c_compiler: clang-cl, cpp_compiler: clang-cl }
+ - os: macos-latest
+ compiler: { c_compiler: clang-cl, cpp_compiler: clang-cl }
+ - os: macos-latest
+ compiler: { c_compiler: gcc, cpp_compiler: g++ }
+
+ steps:
+ - uses: actions/checkout at v4
+
+ - name: Run sccache-cache
+ uses: mozilla-actions/sccache-action at v0.0.6
+
+ - name: Set reusable strings
+ id: strings
+ shell: bash
+ run: |
+ echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
+
+ - name: Configure CMake
+ run: >
+ cmake -B ${{ steps.strings.outputs.build-output-dir }}
+ -DCMAKE_CXX_COMPILER=${{ matrix.compiler.cpp_compiler }}
+ -DCMAKE_C_COMPILER=${{ matrix.compiler.c_compiler }}
+ -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
+ -DCMAKE_C_COMPILER_LAUNCHER=sccache
+ -DCMAKE_CXX_COMPILER_LAUNCHER=sccache
+ -DLLVM_ENABLE_RUNTIMES=libc
+ -G Ninja
+ -S ${{ github.workspace }}/runtimes
+
+ - name: Build
+ run: cmake --build ${{ steps.strings.outputs.build-output-dir }}
+
+ - name: Test
+ working-directory: ${{ steps.strings.outputs.build-output-dir }}
+ run: ninja check-libc
>From 49ca7bcb8dbc1ddc29e1fa5eed83ab1dea7488bb Mon Sep 17 00:00:00 2001
From: schrodingerzhu <i at zhuyi.fan>
Date: Sat, 7 Dec 2024 20:22:57 -0500
Subject: [PATCH 02/20] [libc] add multi-platform pre-commit github actions
---
.github/workflows/libc-gpu-build.yml | 0
.github/workflows/libc-overlay-tests.yml | 3 +--
2 files changed, 1 insertion(+), 2 deletions(-)
delete mode 100644 .github/workflows/libc-gpu-build.yml
diff --git a/.github/workflows/libc-gpu-build.yml b/.github/workflows/libc-gpu-build.yml
deleted file mode 100644
index e69de29bb2d1d6..00000000000000
diff --git a/.github/workflows/libc-overlay-tests.yml b/.github/workflows/libc-overlay-tests.yml
index 63732a37277886..e2e0fa0beadd96 100644
--- a/.github/workflows/libc-overlay-tests.yml
+++ b/.github/workflows/libc-overlay-tests.yml
@@ -55,11 +55,10 @@ jobs:
-DCMAKE_C_COMPILER_LAUNCHER=sccache
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
-DLLVM_ENABLE_RUNTIMES=libc
- -G Ninja
-S ${{ github.workspace }}/runtimes
- name: Build
- run: cmake --build ${{ steps.strings.outputs.build-output-dir }}
+ run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --parallel
- name: Test
working-directory: ${{ steps.strings.outputs.build-output-dir }}
>From a16c16ead303a0ebaca4244ff371b0282defcfb4 Mon Sep 17 00:00:00 2001
From: schrodingerzhu <i at zhuyi.fan>
Date: Sat, 7 Dec 2024 20:23:49 -0500
Subject: [PATCH 03/20] [libc] add multi-platform pre-commit github actions
---
.github/workflows/libc-overlay-tests.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/libc-overlay-tests.yml b/.github/workflows/libc-overlay-tests.yml
index e2e0fa0beadd96..689a9d077eed65 100644
--- a/.github/workflows/libc-overlay-tests.yml
+++ b/.github/workflows/libc-overlay-tests.yml
@@ -51,14 +51,14 @@ jobs:
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=${{ matrix.compiler.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.compiler.c_compiler }}
- -DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
+ -DCMAKE_BUILD_TYPE=RelWithDebInfo
-DCMAKE_C_COMPILER_LAUNCHER=sccache
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
-DLLVM_ENABLE_RUNTIMES=libc
-S ${{ github.workspace }}/runtimes
- name: Build
- run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --parallel
+ run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --parallel --config RelWithDebInfo
- name: Test
working-directory: ${{ steps.strings.outputs.build-output-dir }}
>From feb3428f837c2bc20d79c2cb86502ff383168ee2 Mon Sep 17 00:00:00 2001
From: schrodingerzhu <i at zhuyi.fan>
Date: Sat, 7 Dec 2024 20:26:37 -0500
Subject: [PATCH 04/20] [libc] add multi-platform pre-commit github actions
---
.github/workflows/libc-overlay-tests.yml | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/.github/workflows/libc-overlay-tests.yml b/.github/workflows/libc-overlay-tests.yml
index 689a9d077eed65..daee174db34702 100644
--- a/.github/workflows/libc-overlay-tests.yml
+++ b/.github/workflows/libc-overlay-tests.yml
@@ -61,5 +61,4 @@ jobs:
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --parallel --config RelWithDebInfo
- name: Test
- working-directory: ${{ steps.strings.outputs.build-output-dir }}
- run: ninja check-libc
+ run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --target check-libc
>From d1af585efe6de04f90f8cd85aaeaa02713f308fa Mon Sep 17 00:00:00 2001
From: schrodingerzhu <i at zhuyi.fan>
Date: Sat, 7 Dec 2024 20:27:24 -0500
Subject: [PATCH 05/20] [libc] add multi-platform pre-commit github actions
---
.github/workflows/libc-overlay-tests.yml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/.github/workflows/libc-overlay-tests.yml b/.github/workflows/libc-overlay-tests.yml
index daee174db34702..878ea4e9216473 100644
--- a/.github/workflows/libc-overlay-tests.yml
+++ b/.github/workflows/libc-overlay-tests.yml
@@ -27,6 +27,8 @@ jobs:
exclude:
- os: windows-latest
compiler: { c_compiler: gcc, cpp_compiler: g++ }
+ - os: windows-latest
+ compiler: { c_compiler: clang, cpp_compiler: clang++ }
- os: ubuntu-latest
compiler: { c_compiler: clang-cl, cpp_compiler: clang-cl }
- os: macos-latest
>From 0cf345f131be1cd4e2fe42b6c16143c522047f7b Mon Sep 17 00:00:00 2001
From: schrodingerzhu <i at zhuyi.fan>
Date: Sat, 7 Dec 2024 20:35:15 -0500
Subject: [PATCH 06/20] prepare to fix windows build
---
.github/workflows/libc-overlay-tests.yml | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/libc-overlay-tests.yml b/.github/workflows/libc-overlay-tests.yml
index 878ea4e9216473..5e54771d028c22 100644
--- a/.github/workflows/libc-overlay-tests.yml
+++ b/.github/workflows/libc-overlay-tests.yml
@@ -60,7 +60,16 @@ jobs:
-S ${{ github.workspace }}/runtimes
- name: Build
- run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --parallel --config RelWithDebInfo
+ run: >
+ cmake
+ --build ${{ steps.strings.outputs.build-output-dir }}
+ --parallel
+ --config RelWithDebInfo
+ --target libc
- name: Test
- run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --target check-libc
+ run: >
+ cmake
+ --build ${{ steps.strings.outputs.build-output-dir }}
+ --parallel
+ --target check-libc
>From 008ffefe78cbdccee889d951c4c9ecb610a42f46 Mon Sep 17 00:00:00 2001
From: schrodingerzhu <i at zhuyi.fan>
Date: Sat, 7 Dec 2024 20:38:26 -0500
Subject: [PATCH 07/20] add ubuntu preparation step
---
.github/workflows/libc-overlay-tests.yml | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/.github/workflows/libc-overlay-tests.yml b/.github/workflows/libc-overlay-tests.yml
index 5e54771d028c22..f93e03d1bb2e88 100644
--- a/.github/workflows/libc-overlay-tests.yml
+++ b/.github/workflows/libc-overlay-tests.yml
@@ -41,6 +41,12 @@ jobs:
- name: Run sccache-cache
uses: mozilla-actions/sccache-action at v0.0.6
+
+ - name: Prepare dependencies (Ubuntu)
+ if: matrix.os == 'ubuntu-latest'
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y cmake ninja-build libmpfr-dev libgmp-dev libmpc-dev
- name: Set reusable strings
id: strings
>From 1263dbcf1c20203fdffcf6b3c743cc2abfafe310 Mon Sep 17 00:00:00 2001
From: schrodingerzhu <i at zhuyi.fan>
Date: Sat, 7 Dec 2024 20:50:08 -0500
Subject: [PATCH 08/20] setup ninja
---
.github/workflows/libc-overlay-tests.yml | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/.github/workflows/libc-overlay-tests.yml b/.github/workflows/libc-overlay-tests.yml
index f93e03d1bb2e88..c169105844eba8 100644
--- a/.github/workflows/libc-overlay-tests.yml
+++ b/.github/workflows/libc-overlay-tests.yml
@@ -47,6 +47,18 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y cmake ninja-build libmpfr-dev libgmp-dev libmpc-dev
+
+ - name: Prepare dependencies (Windows)
+ if: matrix.os == 'windows-latest'
+ run: |
+ winget install --silent --exact --force LLVM.LLVM
+ winget install --silent --exact --force Ninja-build.Ninja
+ echo "C:\\Program Files\\LLVM\\bin" >> $GITHUB_PATH
+
+ - name: Prepare dependencies (macOS)
+ if: matrix.os == 'macos-latest'
+ run: |
+ brew install ninja
- name: Set reusable strings
id: strings
@@ -63,6 +75,7 @@ jobs:
-DCMAKE_C_COMPILER_LAUNCHER=sccache
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
-DLLVM_ENABLE_RUNTIMES=libc
+ -G Ninja
-S ${{ github.workspace }}/runtimes
- name: Build
>From a7738ed29490a70cd1a28afc73872d612c6283e6 Mon Sep 17 00:00:00 2001
From: schrodingerzhu <i at zhuyi.fan>
Date: Sat, 7 Dec 2024 20:51:21 -0500
Subject: [PATCH 09/20] remove build type
---
.github/workflows/libc-overlay-tests.yml | 1 -
1 file changed, 1 deletion(-)
diff --git a/.github/workflows/libc-overlay-tests.yml b/.github/workflows/libc-overlay-tests.yml
index c169105844eba8..b95dd07e4edaef 100644
--- a/.github/workflows/libc-overlay-tests.yml
+++ b/.github/workflows/libc-overlay-tests.yml
@@ -18,7 +18,6 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
- build_type: [Release, Debug]
compiler: [
{ c_compiler: gcc, cpp_compiler: g++ },
{ c_compiler: clang, cpp_compiler: clang++ },
>From 8f3c0ee68c8337c2e015c1924370eb063cd0b15a Mon Sep 17 00:00:00 2001
From: schrodingerzhu <i at zhuyi.fan>
Date: Sat, 7 Dec 2024 20:54:17 -0500
Subject: [PATCH 10/20] fix winget installation
---
.github/workflows/libc-overlay-tests.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/.github/workflows/libc-overlay-tests.yml b/.github/workflows/libc-overlay-tests.yml
index b95dd07e4edaef..a997b503ba2c9b 100644
--- a/.github/workflows/libc-overlay-tests.yml
+++ b/.github/workflows/libc-overlay-tests.yml
@@ -50,6 +50,7 @@ jobs:
- name: Prepare dependencies (Windows)
if: matrix.os == 'windows-latest'
run: |
+ Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe
winget install --silent --exact --force LLVM.LLVM
winget install --silent --exact --force Ninja-build.Ninja
echo "C:\\Program Files\\LLVM\\bin" >> $GITHUB_PATH
>From df708869248b8b122ce2e1a7d72e5b75488dc1c8 Mon Sep 17 00:00:00 2001
From: schrodingerzhu <i at zhuyi.fan>
Date: Sat, 7 Dec 2024 20:58:19 -0500
Subject: [PATCH 11/20] fix winget installation
---
.github/workflows/libc-overlay-tests.yml | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/libc-overlay-tests.yml b/.github/workflows/libc-overlay-tests.yml
index a997b503ba2c9b..6b1668797d0711 100644
--- a/.github/workflows/libc-overlay-tests.yml
+++ b/.github/workflows/libc-overlay-tests.yml
@@ -50,7 +50,13 @@ jobs:
- name: Prepare dependencies (Windows)
if: matrix.os == 'windows-latest'
run: |
- Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe
+ $progressPreference = 'silentlyContinue'
+ Write-Host "Installing WinGet PowerShell module from PSGallery..."
+ Install-PackageProvider -Name NuGet -Force | Out-Null
+ Install-Module -Name Microsoft.WinGet.Client -Force -Repository PSGallery | Out-Null
+ Write-Host "Using Repair-WinGetPackageManager cmdlet to bootstrap WinGet..."
+ Repair-WinGetPackageManager
+ Write-Host "Done."
winget install --silent --exact --force LLVM.LLVM
winget install --silent --exact --force Ninja-build.Ninja
echo "C:\\Program Files\\LLVM\\bin" >> $GITHUB_PATH
>From 08d00ccb41aa730a142b44e8cf03d7fe594093da Mon Sep 17 00:00:00 2001
From: schrodingerzhu <i at zhuyi.fan>
Date: Sat, 7 Dec 2024 21:13:07 -0500
Subject: [PATCH 12/20] more fixes
---
.github/workflows/libc-overlay-tests.yml | 33 +++++++-----------------
1 file changed, 9 insertions(+), 24 deletions(-)
diff --git a/.github/workflows/libc-overlay-tests.yml b/.github/workflows/libc-overlay-tests.yml
index 6b1668797d0711..c8b90ceacd2ff5 100644
--- a/.github/workflows/libc-overlay-tests.yml
+++ b/.github/workflows/libc-overlay-tests.yml
@@ -17,22 +17,22 @@ jobs:
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations.
fail-fast: false
matrix:
- os: [ubuntu-latest, windows-latest, macos-latest]
+ os: [ ubuntu-24.04, windows-2022, macos-14 ]
compiler: [
{ c_compiler: gcc, cpp_compiler: g++ },
{ c_compiler: clang, cpp_compiler: clang++ },
{ c_compiler: clang-cl, cpp_compiler: clang-cl }
]
exclude:
- - os: windows-latest
+ - os: windows-2022
compiler: { c_compiler: gcc, cpp_compiler: g++ }
- - os: windows-latest
+ - os: windows-2022
compiler: { c_compiler: clang, cpp_compiler: clang++ }
- - os: ubuntu-latest
+ - os: ubuntu-24.04
compiler: { c_compiler: clang-cl, cpp_compiler: clang-cl }
- - os: macos-latest
+ - os: macos-14
compiler: { c_compiler: clang-cl, cpp_compiler: clang-cl }
- - os: macos-latest
+ - os: macos-14
compiler: { c_compiler: gcc, cpp_compiler: g++ }
steps:
@@ -42,30 +42,16 @@ jobs:
uses: mozilla-actions/sccache-action at v0.0.6
- name: Prepare dependencies (Ubuntu)
- if: matrix.os == 'ubuntu-latest'
+ if: runner.os == 'Linux'
run: |
sudo apt-get update
- sudo apt-get install -y cmake ninja-build libmpfr-dev libgmp-dev libmpc-dev
+ sudo apt-get install -y cmake libmpfr-dev libgmp-dev libmpc-dev
- name: Prepare dependencies (Windows)
- if: matrix.os == 'windows-latest'
+ if: runner.os == 'Windows'
run: |
- $progressPreference = 'silentlyContinue'
- Write-Host "Installing WinGet PowerShell module from PSGallery..."
- Install-PackageProvider -Name NuGet -Force | Out-Null
- Install-Module -Name Microsoft.WinGet.Client -Force -Repository PSGallery | Out-Null
- Write-Host "Using Repair-WinGetPackageManager cmdlet to bootstrap WinGet..."
- Repair-WinGetPackageManager
- Write-Host "Done."
- winget install --silent --exact --force LLVM.LLVM
- winget install --silent --exact --force Ninja-build.Ninja
echo "C:\\Program Files\\LLVM\\bin" >> $GITHUB_PATH
- - name: Prepare dependencies (macOS)
- if: matrix.os == 'macos-latest'
- run: |
- brew install ninja
-
- name: Set reusable strings
id: strings
shell: bash
@@ -81,7 +67,6 @@ jobs:
-DCMAKE_C_COMPILER_LAUNCHER=sccache
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
-DLLVM_ENABLE_RUNTIMES=libc
- -G Ninja
-S ${{ github.workspace }}/runtimes
- name: Build
>From fcb25009d25910aaa230ee6e0ef2b705847fd8d2 Mon Sep 17 00:00:00 2001
From: schrodingerzhu <i at zhuyi.fan>
Date: Sat, 7 Dec 2024 21:34:01 -0500
Subject: [PATCH 13/20] more fixes
---
.github/workflows/libc-overlay-tests.yml | 41 +++++++++++-------------
1 file changed, 18 insertions(+), 23 deletions(-)
diff --git a/.github/workflows/libc-overlay-tests.yml b/.github/workflows/libc-overlay-tests.yml
index c8b90ceacd2ff5..8570f859f1fa7e 100644
--- a/.github/workflows/libc-overlay-tests.yml
+++ b/.github/workflows/libc-overlay-tests.yml
@@ -17,24 +17,23 @@ jobs:
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations.
fail-fast: false
matrix:
- os: [ ubuntu-24.04, windows-2022, macos-14 ]
- compiler: [
- { c_compiler: gcc, cpp_compiler: g++ },
- { c_compiler: clang, cpp_compiler: clang++ },
- { c_compiler: clang-cl, cpp_compiler: clang-cl }
- ]
- exclude:
- - os: windows-2022
- compiler: { c_compiler: gcc, cpp_compiler: g++ }
- - os: windows-2022
- compiler: { c_compiler: clang, cpp_compiler: clang++ }
- - os: ubuntu-24.04
- compiler: { c_compiler: clang-cl, cpp_compiler: clang-cl }
+ include:
+ - os: ubuntu-20.04
+ compiler:
+ c_compiler: clang
+ cpp_compiler: clang++
+ cmake_config:
+ - os: windows-latest
+ compiler:
+ c_compiler: clang-cl
+ cpp_compiler: clang-cl
+ cmake_config: -TClangCL
- os: macos-14
- compiler: { c_compiler: clang-cl, cpp_compiler: clang-cl }
- - os: macos-14
- compiler: { c_compiler: gcc, cpp_compiler: g++ }
-
+ compiler:
+ c_compiler: clang
+ cpp_compiler: clang++
+ cmake_config:
+
steps:
- uses: actions/checkout at v4
@@ -45,12 +44,7 @@ jobs:
if: runner.os == 'Linux'
run: |
sudo apt-get update
- sudo apt-get install -y cmake libmpfr-dev libgmp-dev libmpc-dev
-
- - name: Prepare dependencies (Windows)
- if: runner.os == 'Windows'
- run: |
- echo "C:\\Program Files\\LLVM\\bin" >> $GITHUB_PATH
+ sudo apt-get install -y libmpfr-dev libgmp-dev libmpc-dev
- name: Set reusable strings
id: strings
@@ -67,6 +61,7 @@ jobs:
-DCMAKE_C_COMPILER_LAUNCHER=sccache
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
-DLLVM_ENABLE_RUNTIMES=libc
+ ${{ matrix.cmake_config }}
-S ${{ github.workspace }}/runtimes
- name: Build
>From 0be378fc7d8eca8f4a6c1de12d87f9cee5acf5f6 Mon Sep 17 00:00:00 2001
From: schrodingerzhu <i at zhuyi.fan>
Date: Sat, 7 Dec 2024 21:34:23 -0500
Subject: [PATCH 14/20] more fixes
---
.github/workflows/libc-overlay-tests.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/libc-overlay-tests.yml b/.github/workflows/libc-overlay-tests.yml
index 8570f859f1fa7e..ed6897e8077eee 100644
--- a/.github/workflows/libc-overlay-tests.yml
+++ b/.github/workflows/libc-overlay-tests.yml
@@ -18,7 +18,7 @@ jobs:
fail-fast: false
matrix:
include:
- - os: ubuntu-20.04
+ - os: ubuntu-24.04
compiler:
c_compiler: clang
cpp_compiler: clang++
>From 779c80641034a4f710669c86f17cf260701972ec Mon Sep 17 00:00:00 2001
From: schrodingerzhu <i at zhuyi.fan>
Date: Sat, 7 Dec 2024 21:54:35 -0500
Subject: [PATCH 15/20] enable fullbuild
---
.github/workflows/libc-fullbuild-tests.yml | 71 ++++++++++++++++++++++
.github/workflows/libc-overlay-tests.yml | 1 +
2 files changed, 72 insertions(+)
diff --git a/.github/workflows/libc-fullbuild-tests.yml b/.github/workflows/libc-fullbuild-tests.yml
index e69de29bb2d1d6..e1700720ae95c2 100644
--- a/.github/workflows/libc-fullbuild-tests.yml
+++ b/.github/workflows/libc-fullbuild-tests.yml
@@ -0,0 +1,71 @@
+# This workflow is for pre-commit testing of the LLVM-libc project.
+name: LLVM-libc Pre-commit Fullbuild Tests
+
+on:
+ pull_request:
+ branches: [ "main" ]
+ paths:
+ - 'libc/**'
+ - '.github/workflows/libc-fullbuild-tests.yml'
+
+jobs:
+ build:
+ env:
+ SCCACHE_GHA_ENABLED: "true"
+ runs-on: ubuntu-24.04
+ strategy:
+ fail-fast: false
+ matrix:
+ include:
+ - c_compiler: clang
+ cpp_compiler: clang++
+ - c_compiler: gcc
+ cpp_compiler: g++
+ steps:
+ - uses: actions/checkout at v4
+
+ - name: Run sccache-cache
+ uses: mozilla-actions/sccache-action at v0.0.6
+
+ - name: Prepare dependencies (Ubuntu)
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y libmpfr-dev libgmp-dev libmpc-dev ninja-build
+
+ - name: Set reusable strings
+ id: strings
+ shell: bash
+ run: |
+ echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
+ echo "build-install-dir=${{ github.workspace }}/install" >> "$GITHUB_OUTPUT"
+
+ - name: Configure CMake
+ run: >
+ cmake -B ${{ steps.strings.outputs.build-output-dir }}
+ -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
+ -DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
+ -DCMAKE_BUILD_TYPE=RelWithDebInfo
+ -DCMAKE_C_COMPILER_LAUNCHER=sccache
+ -DCMAKE_CXX_COMPILER_LAUNCHER=sccache
+ -DCMAKE_INSTALL_PREFIX=${{ steps.strings.outputs.build-install-dir }}
+ -DLLVM_ENABLE_RUNTIMES="libc;compiler-rt"
+ -DLLVM_LIBC_FULL_BUILD=ON
+ -DLLVM_LIBC_INCLUDE_SCUDO=ON
+ -DCOMPILER_RT_BUILD_SCUDO_STANDALONE_WITH_LLVM_LIBC=ON
+ -DCOMPILER_RT_BUILD_GWP_ASAN=OFF
+ -DCOMPILER_RT_SCUDO_STANDALONE_BUILD_SHARED=OFF
+ -S ${{ github.workspace }}/runtimes
+
+ - name: Build
+ run: >
+ cmake
+ --build ${{ steps.strings.outputs.build-output-dir }}
+ --parallel
+ --target install
+
+ - name: Test
+ run: >
+ cmake
+ --build ${{ steps.strings.outputs.build-output-dir }}
+ --parallel
+ --target check-libc
diff --git a/.github/workflows/libc-overlay-tests.yml b/.github/workflows/libc-overlay-tests.yml
index ed6897e8077eee..fbb912c3905a45 100644
--- a/.github/workflows/libc-overlay-tests.yml
+++ b/.github/workflows/libc-overlay-tests.yml
@@ -18,6 +18,7 @@ jobs:
fail-fast: false
matrix:
include:
+ # TODO: add linux gcc when it is fixed
- os: ubuntu-24.04
compiler:
c_compiler: clang
>From 009b76cdf23b54e60e63bf1cfac5753cd1659ebc Mon Sep 17 00:00:00 2001
From: schrodingerzhu <i at zhuyi.fan>
Date: Sat, 7 Dec 2024 22:01:52 -0500
Subject: [PATCH 16/20] fix
---
.github/workflows/libc-fullbuild-tests.yml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/libc-fullbuild-tests.yml b/.github/workflows/libc-fullbuild-tests.yml
index e1700720ae95c2..7b814ada7d8394 100644
--- a/.github/workflows/libc-fullbuild-tests.yml
+++ b/.github/workflows/libc-fullbuild-tests.yml
@@ -30,7 +30,7 @@ jobs:
- name: Prepare dependencies (Ubuntu)
run: |
sudo apt-get update
- sudo apt-get install -y libmpfr-dev libgmp-dev libmpc-dev ninja-build
+ sudo apt-get install -y libmpfr-dev libgmp-dev libmpc-dev ninja-build linux-headers-generic
- name: Set reusable strings
id: strings
@@ -54,6 +54,7 @@ jobs:
-DCOMPILER_RT_BUILD_SCUDO_STANDALONE_WITH_LLVM_LIBC=ON
-DCOMPILER_RT_BUILD_GWP_ASAN=OFF
-DCOMPILER_RT_SCUDO_STANDALONE_BUILD_SHARED=OFF
+ -G Ninja
-S ${{ github.workspace }}/runtimes
- name: Build
>From 6776e8d5ae1175a17aa49203e9bd5fede9e2a90e Mon Sep 17 00:00:00 2001
From: schrodingerzhu <i at zhuyi.fan>
Date: Sat, 7 Dec 2024 22:05:04 -0500
Subject: [PATCH 17/20] fix
---
.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 7b814ada7d8394..0b8688ef6d5b07 100644
--- a/.github/workflows/libc-fullbuild-tests.yml
+++ b/.github/workflows/libc-fullbuild-tests.yml
@@ -30,7 +30,7 @@ jobs:
- name: Prepare dependencies (Ubuntu)
run: |
sudo apt-get update
- sudo apt-get install -y libmpfr-dev libgmp-dev libmpc-dev ninja-build linux-headers-generic
+ sudo apt-get install -y libmpfr-dev libgmp-dev libmpc-dev ninja-build linux-headers-generic linux-libc-dev
- name: Set reusable strings
id: strings
>From a9eba5e433b0f80fe2a0d88f2a99b56d4bd9acf1 Mon Sep 17 00:00:00 2001
From: schrodingerzhu <i at zhuyi.fan>
Date: Sat, 7 Dec 2024 22:09:12 -0500
Subject: [PATCH 18/20] fix
---
.github/workflows/libc-fullbuild-tests.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/.github/workflows/libc-fullbuild-tests.yml b/.github/workflows/libc-fullbuild-tests.yml
index 0b8688ef6d5b07..d9cbd0c8325ade 100644
--- a/.github/workflows/libc-fullbuild-tests.yml
+++ b/.github/workflows/libc-fullbuild-tests.yml
@@ -31,6 +31,7 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y libmpfr-dev libgmp-dev libmpc-dev ninja-build linux-headers-generic linux-libc-dev
+ sudo ln -sf /usr/include/asm-generic /usr/include/asm
- name: Set reusable strings
id: strings
>From 8482b9d30865c5f1b4e481edad183029922a8c59 Mon Sep 17 00:00:00 2001
From: schrodingerzhu <i at zhuyi.fan>
Date: Sat, 7 Dec 2024 22:14:14 -0500
Subject: [PATCH 19/20] fix
---
.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 d9cbd0c8325ade..6f612c9a585cf6 100644
--- a/.github/workflows/libc-fullbuild-tests.yml
+++ b/.github/workflows/libc-fullbuild-tests.yml
@@ -31,7 +31,7 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y libmpfr-dev libgmp-dev libmpc-dev ninja-build linux-headers-generic linux-libc-dev
- sudo ln -sf /usr/include/asm-generic /usr/include/asm
+ sudo ln -sf /usr/include/$(uname -p)-linux-gnu/asm /usr/include/asm
- name: Set reusable strings
id: strings
>From 5c8fba19544786509ee46b0c8d075056c63adb06 Mon Sep 17 00:00:00 2001
From: schrodingerzhu <i at zhuyi.fan>
Date: Sat, 7 Dec 2024 22:26:15 -0500
Subject: [PATCH 20/20] skip gcc and speed up clang testing
---
.github/workflows/libc-fullbuild-tests.yml | 5 +++--
.github/workflows/libc-overlay-tests.yml | 4 ++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/libc-fullbuild-tests.yml b/.github/workflows/libc-fullbuild-tests.yml
index 6f612c9a585cf6..5947e07637cbdb 100644
--- a/.github/workflows/libc-fullbuild-tests.yml
+++ b/.github/workflows/libc-fullbuild-tests.yml
@@ -19,8 +19,9 @@ jobs:
include:
- c_compiler: clang
cpp_compiler: clang++
- - c_compiler: gcc
- cpp_compiler: g++
+ # TODO: add back gcc build when it is fixed
+ # - c_compiler: gcc
+ # cpp_compiler: g++
steps:
- uses: actions/checkout at v4
diff --git a/.github/workflows/libc-overlay-tests.yml b/.github/workflows/libc-overlay-tests.yml
index fbb912c3905a45..9b8109d0f67059 100644
--- a/.github/workflows/libc-overlay-tests.yml
+++ b/.github/workflows/libc-overlay-tests.yml
@@ -23,7 +23,7 @@ jobs:
compiler:
c_compiler: clang
cpp_compiler: clang++
- cmake_config:
+ cmake_config: -GNinja
- os: windows-latest
compiler:
c_compiler: clang-cl
@@ -45,7 +45,7 @@ jobs:
if: runner.os == 'Linux'
run: |
sudo apt-get update
- sudo apt-get install -y libmpfr-dev libgmp-dev libmpc-dev
+ sudo apt-get install -y libmpfr-dev libgmp-dev libmpc-dev ninja-build
- name: Set reusable strings
id: strings
More information about the llvm-commits
mailing list