Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 5 additions & 31 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ jobs:
strategy:
fail-fast: false
matrix:
clang-version: [ 20, 19, 18, 17, 16, 15, 14, 13, 12.0.1, 12, 11, 10, 9, 8]
clang-version: [ 21, 20, 19, 18, 17, 16, 15, 14, 13, 12.0.1, 12, 11, 10, 9]
os: [ linux, macosx, windows ]
include:
- clang-version: 21
release: llvm-project-21.1.0.src
- clang-version: 20
release: llvm-project-20.1.0.src
- clang-version: 19
Expand Down Expand Up @@ -51,9 +53,6 @@ jobs:
- clang-version: 9
release: llvm-project-9.0.1
extra-cmake-args: '-DLLVM_ENABLE_Z3_SOLVER=OFF'
- clang-version: 8
release: llvm-project-8.0.1
extra-cmake-args: '-DCLANG_ANALYZER_ENABLE_Z3_SOLVER=OFF'
- os: linux
runner: ubuntu-22.04
os-cmake-args: '-DLLVM_BUILD_STATIC=ON -DCMAKE_CXX_FLAGS="-s -flto" ${POSIX_CMAKE_ARGS} ${LINUX_CMAKE_ARGS}'
Expand Down Expand Up @@ -91,42 +90,17 @@ jobs:
# The commit hash of this repository into the clang binaries
shell: bash
run: curl -L https://github.com/${{ github.repository }}/archive/${{ github.ref }}.tar.gz | tar xvz --strip 1
- name: Get llvm-project
if: ${{ matrix.clang-version == 8 }}
shell: bash
run: |
version=${RELEASE##llvm-project-}
curl -LO https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/llvm-${version}.src.tar.xz
curl -LO https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/cfe-${version}.src.tar.xz
curl -LO https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/clang-tools-extra-${version}.src.tar.xz
- name: Get llvm-project
if: ${{ matrix.clang-version >= 9 || matrix.clang-version == '12.0.1' }}
Copy link

Copilot AI Aug 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The condition matrix.clang-version >= 9 will fail for version 21 because it's comparing a number to a string. Version 21 should be included in this condition, but the comparison logic needs to handle string versions properly or use numeric comparison.

Copilot uses AI. Check for mistakes.
shell: bash
run: |
version=${RELEASE##llvm-project-}; version=${version%.src}
curl -LO https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/${{ matrix.release }}.tar.xz

- name: Unpack llvm-project
if: ${{ matrix.clang-version < 9 }}
shell: bash
run: |
version=${RELEASE##llvm-project-}
tar xf llvm-${version}.src.tar.xz
tar xf cfe-${version}.src.tar.xz ${{ matrix.extra-tar-args-cfe }}
tar xf clang-tools-extra-${version}.src.tar.xz
mkdir ${{ matrix.release }}
mv llvm-${version}.src ${{ matrix.release }}/llvm
mv cfe-${version}.src ${{ matrix.release }}/clang
mv clang-tools-extra-${version}.src ${{ matrix.release }}/clang-tools-extra
- name: Unpack llvm-project
if: ${{ matrix.clang-version >= 9 || matrix.clang-version == '12.0.1' }}
shell: bash
run: |
tar xf ${{ matrix.release }}.tar.xz ${{ matrix.extra-tar-args }}
- name: Patch clang-8 includes
if: ${{ matrix.clang-version == 8 }}
shell: bash
run: patch ${{ matrix.release }}/llvm/include/llvm/Demangle/MicrosoftDemangleNodes.h include-cstdint-string-prior-to-using-uint8_t.patch
# ignore failure on v21 on windows
tar xf ${{ matrix.release }}.tar.xz ${{ matrix.extra-tar-args }} || true
Comment on lines +102 to +103
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Don’t mask extraction failures; make Windows-only fallback explicit.

The comment says “ignore failure on v21 on windows,” but the command ignores all failures on all OSes. Remove || true and only add special handling on Windows. Also scope any GNU tar flags to Windows (not macOS) to avoid bsdtar errors.

-        # ignore failure on v21 on windows
-        tar xf ${{ matrix.release }}.tar.xz ${{ matrix.extra-tar-args }} || true
+        # Use Windows-only fallback; avoid GNU-only flags on macOS (bsdtar).
+        if [[ "${{ matrix.os }}" == "windows" || "${{ runner.os }}" == "Windows" ]]; then
+          # If needed, append GNU-only flags here; verify support on the runner.
+          tar xf "${{ matrix.release }}.tar.xz" ${{ matrix.extra-tar-args }}
+        else
+          tar xf "${{ matrix.release }}.tar.xz" ${{ matrix.extra-tar-args }}
+        fi

If Windows extraction still fails for v21, consider a guarded retry with 7-Zip:

+        if [[ "${{ matrix.os }}" == "windows" || "${{ runner.os }}" == "Windows" ]]; then
+          tar xf "${{ matrix.release }}.tar.xz" ${{ matrix.extra-tar-args }} || {
+            echo "tar failed; retrying with 7z";
+            7z x "${{ matrix.release }}.tar.xz" -y && 7z x "${{ matrix.release }}.tar" -y
+          }
+        fi

🏁 Script executed:

#!/bin/bash
# Show context around lines 80-120 in build.yml
sed -n '80,120p' .github/workflows/build.yml

# Search for definition of matrix.os
rg -nP '\bmatrix\.os\b' -C3 .github/workflows/build.yml

# Search for runner.os usage
rg -nP '\brunner\.os\b' -C3 .github/workflows/build.yml

Length of output: 5303


Make Windows-only tar fallback explicit and scope GNU-only flags

  • Remove the unconditional || true on the tar command and wrap it in a shell conditional on matrix.os == 'windows' so extraction failures on macOS/Linux surface.
  • Ensure any GNU-specific flags in matrix.extra-tar-args are only declared for Windows in your matrix to avoid bsdtar errors on macOS.

Example refactor in .github/workflows/build.yml:

- name: Unpack llvm-project
  shell: bash
  run: |
    if [[ "${{ matrix.os }}" == "windows" ]]; then
      # mask failures only on Windows
      tar xf "${{ matrix.release }}.tar.xz" ${{ matrix.extra-tar-args }} || true
    else
      tar xf "${{ matrix.release }}.tar.xz" ${{ matrix.extra-tar-args }}
    fi

Optional Windows 7-Zip retry for v21 failures:

if [[ "${{ matrix.os }}" == "windows" ]]; then
  tar xf "${{ matrix.release }}.tar.xz" ${{ matrix.extra-tar-args }} || {
    echo "tar failed; retrying with 7z";
    7z x "${{ matrix.release }}.tar.xz" -y && 7z x "${{ matrix.release }}.tar" -y
  }
fi
🤖 Prompt for AI Agents
In .github/workflows/build.yml around lines 102-103, remove the unconditional
"|| true" from the tar extraction and instead make the fallback Windows-only by
wrapping the tar command in a shell conditional that checks if matrix.os ==
'windows'; on Windows keep the "|| true" (or the 7-Zip retry) so failures are
masked there, while on non-Windows run tar without "|| true" so extraction
failures surface. Also ensure any GNU-specific flags contained in
matrix.extra-tar-args are only set for the Windows matrix entries to avoid
bsdtar errors on macOS/Linux.

- name: Patch trivially-copyable clang 9/10
if: ${{ ( matrix.clang-version == 9 || matrix.clang-version == 10 ) && matrix.os == 'windows' }}
shell: bash
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Includes **[clang-format](https://clang.llvm.org/docs/ClangFormat.html), [clang-

## Clang Tools Version Support Matrix

| Clang Tools |OS/Version |20|19|18 |17 |16 |15 |14 |13 |12 |11 |10 |9 |8 |
| Clang Tools |OS/Version |21|20|19 |18 |17 |16 |15 |14 |13 |12 |11 |10 |9 |
|:------------|-----------|--|--|---|---|---|---|---|---|---|---|---|---|---|
|clang-format |Linux 64 |✔️|✔️|✔️ |✔️|✔️|✔️ |✔️|✔️ |✔️ |✔️|✔️| ✔️|✔️|
| |Window 64 |✔️|✔️|✔️ |✔️|✔️|✔️ |✔️|✔️ |✔️ |✔️|✔️| ✔️|✔️|
Expand All @@ -27,6 +27,8 @@ Includes **[clang-format](https://clang.llvm.org/docs/ClangFormat.html), [clang-
> [!NOTE]
>
> Remove Support v7 (released in May 2019) by February 2025.
>
> Remove Support v8 (released in July 2019) by September 2025.

## Download

Expand Down
37 changes: 0 additions & 37 deletions include-cstdint-string-prior-to-using-uint8_t.patch

This file was deleted.

Loading