cb424d7448
verify-patch-sanity.py validates every active recipe .patch has internally- consistent hunk line counts — catching the 'malformed patch at line N' failure at commit/CI/preflight time instead of hours into a cook. This cycle hit that class three times (qtwaylandscanner, sddm, xwayland), each only discovered when cookbook tried to apply the patch. Running it across the repo found 29 latent malformed patches (validated against GNU patch: e.g. relibc/P3-sysv-ipc reproduces 'malformed patch at line 22'). They were harmless only because they sit in vendored recipes (baked, not re- applied) — but would fail on any version-bump re-derivation. --fix recounts the hunk headers (body untouched) and repaired all 29. Wired into build-preflight.sh (Phase 1.0D) and redbear-ci.yml, with a unit test (test-patch-sanity.sh). Skips archived/legacy trees and unvalidatable formats (empty placeholders, bare-@@ git hunks).
140 lines
5.0 KiB
YAML
140 lines
5.0 KiB
YAML
# This workflow is for pre-commit testing of the LLVM-libc project.
|
|
name: LLVM-libc Pre-commit Fullbuild Tests
|
|
permissions:
|
|
contents: read
|
|
on:
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
paths:
|
|
- 'libc/**'
|
|
- '.github/workflows/libc-fullbuild-tests.yml'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
# Build basic linux configuration with Debug/Release/MinSizeRel and all
|
|
# other configurations in Debug only.
|
|
include:
|
|
- os: ubuntu-24.04
|
|
build_type: Debug
|
|
ccache-variant: sccache
|
|
c_compiler: clang-21
|
|
cpp_compiler: clang++-21
|
|
target: x86_64-unknown-linux-llvm
|
|
include_scudo: ON
|
|
- os: ubuntu-24.04
|
|
build_type: Release
|
|
ccache-variant: sccache
|
|
c_compiler: clang-21
|
|
cpp_compiler: clang++-21
|
|
target: x86_64-unknown-linux-llvm
|
|
include_scudo: ON
|
|
- os: ubuntu-24.04
|
|
build_type: MinSizeRel
|
|
ccache-variant: sccache
|
|
c_compiler: clang-21
|
|
cpp_compiler: clang++-21
|
|
target: x86_64-unknown-linux-llvm
|
|
include_scudo: ON
|
|
# TODO: remove ccache logic when https://github.com/hendrikmuhs/ccache-action/issues/279 is resolved.
|
|
- os: ubuntu-24.04-arm
|
|
build_type: Debug
|
|
ccache-variant: ccache
|
|
c_compiler: clang-21
|
|
cpp_compiler: clang++-21
|
|
target: aarch64-unknown-linux-llvm
|
|
include_scudo: ON
|
|
- os: ubuntu-24.04
|
|
build_type: Debug
|
|
ccache-variant: ccache
|
|
c_compiler: clang-21
|
|
cpp_compiler: clang++-21
|
|
target: x86_64-unknown-uefi-llvm
|
|
include_scudo: OFF
|
|
# TODO: add back gcc build when it is fixed
|
|
# - c_compiler: gcc
|
|
# cpp_compiler: g++
|
|
steps:
|
|
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
|
|
# Libc's build is relatively small comparing with other components of LLVM.
|
|
# A fresh fullbuild takes about 190MiB of uncompressed disk space, which can
|
|
# be compressed into ~40MiB. Limiting the cache size to 1G should be enough.
|
|
# Prefer sccache as it is more modern.
|
|
# 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@a1209f81afb8c005c13b4296c32e363431bffea5 # v1.2.17
|
|
with:
|
|
max-size: 1G
|
|
key: libc_fullbuild_${{ matrix.c_compiler }}
|
|
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)
|
|
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
|
|
shell: bash
|
|
run: |
|
|
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
|
|
echo "build-install-dir=${{ github.workspace }}/install" >> "$GITHUB_OUTPUT"
|
|
|
|
# Configure libc fullbuild with scudo.
|
|
# Use MinSizeRel to reduce the size of the build.
|
|
- name: Configure CMake
|
|
run: |
|
|
export RUNTIMES="libc"
|
|
|
|
if [[ ${{ matrix.include_scudo}} == "ON" ]]; then
|
|
export RUNTIMES="$RUNTIMES;compiler-rt"
|
|
export CMAKE_FLAGS="
|
|
-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"
|
|
fi
|
|
|
|
cmake -B ${{ steps.strings.outputs.build-output-dir }} \
|
|
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} \
|
|
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }} \
|
|
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
|
|
-DCMAKE_C_COMPILER_LAUNCHER=${{ matrix.ccache-variant }} \
|
|
-DCMAKE_CXX_COMPILER_LAUNCHER=${{ matrix.ccache-variant }} \
|
|
-DCMAKE_INSTALL_PREFIX=${{ steps.strings.outputs.build-install-dir }} \
|
|
-DLLVM_RUNTIME_TARGETS=${{ matrix.target }} \
|
|
-DLLVM_ENABLE_RUNTIMES="$RUNTIMES" \
|
|
-DLLVM_LIBC_FULL_BUILD=ON \
|
|
-G Ninja \
|
|
-S ${{ github.workspace }}/runtimes \
|
|
$CMAKE_FLAGS
|
|
|
|
- name: Build
|
|
run: >
|
|
cmake
|
|
--build ${{ steps.strings.outputs.build-output-dir }}
|
|
--parallel
|
|
--target install
|
|
|
|
- name: Test
|
|
# Skip UEFI tests until we have testing set up.
|
|
if: ${{ ! endsWith(matrix.target, '-uefi-llvm') }}
|
|
run: >
|
|
cmake
|
|
--build ${{ steps.strings.outputs.build-output-dir }}
|
|
--parallel
|
|
--target check-libc
|