This PR contains the following updates: | Package | Type | Update | Change | Pending | |---|---|---|---|---| | [EnricoMi/publish-unit-test-result-action](https://redirect.github.com/EnricoMi/publish-unit-test-result-action) | action | minor | `v2.23.0` → `v2.24.0` | | | [actions/attest-build-provenance](https://redirect.github.com/actions/attest-build-provenance) | action | patch | `v4.1.0` → `v4.1.1` | | | [actions/checkout](https://redirect.github.com/actions/checkout) | action | patch | `v6.0.2` → `v6.0.3` | | | [actions/checkout](https://redirect.github.com/actions/checkout) | action | patch | `v6.0.1` → `v6.0.3` | | | [actions/create-github-app-token](https://redirect.github.com/actions/create-github-app-token) | action | minor | `v3.1.1` → `v3.2.0` | | | [actions/labeler](https://redirect.github.com/actions/labeler) | action | minor | `v6.0.1` → `v6.2.0` | | | [actions/setup-node](https://redirect.github.com/actions/setup-node) | action | minor | `v6.3.0` → `v6.5.0` | | | [actions/setup-python](https://redirect.github.com/actions/setup-python) | action | minor | `v6.2.0` → `v6.3.0` | | | [actions/upload-artifact](https://redirect.github.com/actions/upload-artifact) | action | patch | `v7.0.0` → `v7.0.1` | | | [aminya/setup-cpp](https://redirect.github.com/aminya/setup-cpp) | action | patch | `v1.8.0` → `v1.8.1` | | | [docker/login-action](https://redirect.github.com/docker/login-action) | action | minor | `v4.1.0` → `v4.4.0` | | | ghcr.io/llvm/amd64/ci-ubuntu-24.04-github-automation | container | digest | `82b5304` → `f419363` | | | ghcr.io/llvm/ci-ubuntu-24.04 | container | digest | `cc4fd65` → `26c16c2` | | | ghcr.io/llvm/ci-ubuntu-24.04-abi-tests | container | digest | `cb3aea3` → `a948062` | | | ghcr.io/llvm/ci-ubuntu-24.04-lint | container | digest | `91665a4` → `416874e` | | | ghcr.io/llvm/libc-ubuntu-24.04 | container | digest | `a902fb5` → `b9c8ea7` | | | [github/codeql-action](https://redirect.github.com/github/codeql-action) | action | minor | `v4.35.2` → `v4.37.0` | `v4.37.1` | | [hendrikmuhs/ccache-action](https://redirect.github.com/hendrikmuhs/ccache-action) | action | patch | `v1.2.22` → `v1.2.23` | | | [zizmorcore/zizmor-action](https://redirect.github.com/zizmorcore/zizmor-action) | action | minor | `v0.5.3` → `v0.6.0` | |
191 lines
6.7 KiB
YAML
191 lines
6.7 KiB
YAML
# This workflow is for pre-commit testing of the LLVM-libc project.
|
|
name: LLVM-libc Pre-commit Overlay Tests
|
|
permissions:
|
|
contents: read
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- 'libc/**'
|
|
- '.github/workflows/libc-overlay-tests.yml'
|
|
|
|
jobs:
|
|
native:
|
|
if: github.repository_owner == 'llvm'
|
|
name: ${{ matrix.os }} - ${{ matrix.compiler.c_compiler }}
|
|
timeout-minutes: 30
|
|
runs-on: ${{ matrix.os }}
|
|
container: ${{ matrix.container || null }}
|
|
strategy:
|
|
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations.
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
# TODO: add linux gcc when it is fixed
|
|
- os: ubuntu-24.04
|
|
container: 'ghcr.io/llvm/libc-ubuntu-24.04:latest@sha256:c6e2ee2a9bf5cebd51fd27dd8e85381c2f73d90e091c764082f8ad528ee18918'
|
|
compiler:
|
|
c_compiler: clang-23
|
|
cpp_compiler: clang++-23
|
|
linker: lld-23
|
|
- os: ubuntu-24.04-arm
|
|
container: 'ghcr.io/llvm/arm64v8/libc-ubuntu-24.04:latest@sha256:138636a45bb70f7b51a858b282e66291cb3c5c85371afee09032a5e09b263395'
|
|
compiler:
|
|
c_compiler: clang-23
|
|
cpp_compiler: clang++-23
|
|
linker: lld-23
|
|
- 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-15
|
|
compiler:
|
|
c_compiler: clang
|
|
cpp_compiler: clang++
|
|
|
|
steps:
|
|
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
with:
|
|
persist-credentials: false
|
|
|
|
# Libc's build is relatively small comparing with other components of LLVM.
|
|
# A fresh linux overlay takes about 180MiB of uncompressed disk space, which can
|
|
# be compressed into ~40MiB. MacOS and Windows overlay builds are less than 10MiB
|
|
# after compression. Limiting the cache size to 1G should be enough.
|
|
# Prefer sccache as it is modern and it has a guarantee to work with MSVC.
|
|
# Do not use direct GHAC access even though it is supported by sccache. GHAC rejects
|
|
# frequent small object writes.
|
|
- name: Setup ccache
|
|
uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23
|
|
with:
|
|
max-size: 1G
|
|
key: libc_overlay_build_v2_${{ matrix.os }}_${{ matrix.compiler.c_compiler }}
|
|
variant: sccache
|
|
|
|
# Chocolatey is shipped with Windows runners. Windows Server 2025 recommends WinGet.
|
|
# Consider migrating to WinGet when Windows Server 2025 is available.
|
|
- name: Prepare dependencies (Windows)
|
|
if: runner.os == 'Windows'
|
|
run: |
|
|
choco install ninja
|
|
|
|
- name: Prepare dependencies (macOS)
|
|
if: runner.os == 'macOS'
|
|
run: |
|
|
brew install ninja
|
|
|
|
# Use MinSizeRel to reduce the size of the build.
|
|
# Notice that CMP0141=NEW and MSVC_DEBUG_INFORMATION_FORMAT=Embedded are required
|
|
# by the sccache tool.
|
|
- name: Configure CMake
|
|
run: >
|
|
cmake -B build
|
|
-DCMAKE_CXX_COMPILER=${{ matrix.compiler.cpp_compiler }}
|
|
-DCMAKE_C_COMPILER=${{ matrix.compiler.c_compiler }}
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo
|
|
-DCMAKE_C_COMPILER_LAUNCHER=sccache
|
|
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
|
|
-DCMAKE_POLICY_DEFAULT_CMP0141=NEW
|
|
-DCMAKE_MSVC_DEBUG_INFORMATION_FORMAT=Embedded
|
|
-DLIBC_COMPILE_OPTIONS_NATIVE=""
|
|
-DLLVM_ENABLE_RUNTIMES=libc
|
|
-DLLVM_USE_LINKER="${{ matrix.linker }}"
|
|
-G Ninja
|
|
-S runtimes
|
|
|
|
- name: Build
|
|
run: >
|
|
cmake
|
|
--build build
|
|
--parallel
|
|
--target libc
|
|
|
|
- name: Build Test
|
|
run: >
|
|
cmake
|
|
--build build
|
|
--parallel
|
|
--target check-libc-build
|
|
|
|
- name: Test
|
|
run: >
|
|
cmake
|
|
--build build
|
|
--parallel
|
|
--target check-libc
|
|
|
|
qemu:
|
|
if: github.repository_owner == 'llvm'
|
|
name: qemu - ${{ matrix.arch }} - ${{ matrix.c_compiler }}
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 60
|
|
container:
|
|
image: 'ghcr.io/llvm/libc-ubuntu-24.04:latest@sha256:b9c8ea74685ea46c86594428c41a1ba95bc6d33b28183c0ddac64414344950fd'
|
|
# 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:
|
|
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations.
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- arch: armhf
|
|
target_triple: arm-linux-gnueabihf
|
|
c_compiler: clang-23
|
|
cxx_compiler: clang++-23
|
|
- arch: riscv64
|
|
target_triple: riscv64-linux-gnu
|
|
c_compiler: clang-23
|
|
cxx_compiler: clang++-23
|
|
mpfr_path: /usr/riscv64-linux-gnu
|
|
mpc_path: riscv64-linux-gnu
|
|
steps:
|
|
- name: Checkout LLVM
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Setup ccache
|
|
uses: hendrikmuhs/ccache-action@d62db5f07c26379fc4b4e0916f098a92573c3b03 # v1.2.23
|
|
with:
|
|
max-size: 1G
|
|
key: libc_qemu_overlay_${{ matrix.arch }}_${{ matrix.c_compiler }}
|
|
variant: sccache
|
|
|
|
- name: Create QEMU wrapper
|
|
run: |
|
|
mkdir build
|
|
cat << 'EOF' > /__w/llvm-project/llvm-project/build/qemu-wrapper.sh
|
|
#!/bin/bash
|
|
qemu-${{ matrix.arch }}-static -L /usr/${{ matrix.target_triple }} "$@"
|
|
EOF
|
|
chmod +x /__w/llvm-project/llvm-project/build/qemu-wrapper.sh
|
|
|
|
- name: Configure CMake
|
|
run: |
|
|
cmake -B build -S runtimes -G Ninja \
|
|
-DLLVM_ENABLE_RUNTIMES=libc \
|
|
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} \
|
|
-DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }} \
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
-DLLVM_USE_LINKER=lld-23 \
|
|
-DLIBC_TARGET_TRIPLE=${{ matrix.target_triple}} \
|
|
-DLLVM_LIBC_MPFR_INSTALL_PATH="${{ matrix.mpfr_path }}" \
|
|
-DLIBC_MPC_INSTALL_PATH="${{ matrix.mpc_path }}" \
|
|
-DCMAKE_CROSSCOMPILING_EMULATOR=/__w/llvm-project/llvm-project/build/qemu-wrapper.sh
|
|
|
|
- name: Build
|
|
run: |
|
|
cmake --build build --parallel --target libc
|
|
|
|
- name: Build Test
|
|
run: |
|
|
cmake --build build --parallel --target check-libc-build
|
|
|
|
- name: Run Test
|
|
run: |
|
|
cmake --build build --parallel --target check-libc
|