Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Clang Tools

Republished standalone binaries for clang-format and clang-tidy, extracted from the official LLVM releases.

The LLVM project only ships these tools within the full LLVM toolchain archives, which are around 1–2 GB in size. If all you want is a formatter in the matching version for CI or local development, it quickly adds up in bandwidth and download & extraction time - just for a ~5 MB binary. This repository extracts the two Clang tools and publishes them on their own.

Download

Each LLVM release from 14.0.0 onwards gets a matching release here, tagged with the same llvmorg-<version> tag upstream uses.

Pin a specific version:

https://github.com/SFML/clang-tools/releases/download/llvmorg-22.1.8/clang-format-linux-x64

Or always take the newest:

https://github.com/SFML/clang-tools/releases/latest/download/clang-format-linux-x64

Filenames

Replace clang-format with clang-tidy for the other tool.

Platform Tools
Linux x86-64 clang-<tool>-linux-x64
Linux ARM64 clang-<tool>-linux-arm64
macOS Intel clang-<tool>-macos-x64
macOS Apple Silicon clang-<tool>-macos-arm64
Windows x64 clang-<tool>-windows-x64.exe
Windows x86 clang-<tool>-windows-x86.exe
Windows ARM64 clang-<tool>-windows-arm64.exe

Which platforms exist for which version

Not every platform is available for every version, because LLVM's own coverage has changed over the years.

From 19.1.0 onwards: Linux x64, Linux ARM64, Windows x64 and Windows ARM64 are available for every release. The exceptions:

  • macOS Intel: patchy from the start and absent from all of 16.x, 17.x and 18.x. The last release that has it at all is 20.1.7; there is nothing for 21.x and later.
  • Windows x86: dropped by upstream after 21.1.8.
  • macOS Apple Silicon: consistent from 19.1.0 apart from a few gaps (19.1.5, 20.1.5, 20.1.6, several 21.1.x). Before that it is unreliable: absent from 14.0.0–14.0.5, 16.0.6 and all of 18.1.0–18.1.7.
  • Linux x86-64: scattered gaps across 14.x–18.x (for example 16.0.5, 16.0.6, 17.0.1, 17.0.3, 18.1.0–18.1.3).

Each release's notes list exactly which binaries that release contains, so check there before hardcoding an URL.

Usage

On Linux and macOS mark the files as executables:

curl -L -o clang-format \
  https://github.com/SFML/clang-tools/releases/download/llvmorg-22.1.8/clang-format-linux-x64
chmod +x clang-format
./clang-format --version

On macOS the binary is unsigned and downloaded from the internet, so Gatekeeper will refuse to run it until the quarantine flag is cleared:

xattr -d com.apple.quarantine clang-format

In GitHub Actions

- name: Install clang-format
  run: |
    curl -L -o /usr/local/bin/clang-format https://github.com/SFML/clang-tools/releases/download/llvmorg-22.1.8/clang-format-linux-x64
    chmod +x /usr/local/bin/clang-format

- name: Check Formatting
  run: git ls-files '*.cpp' '*.hpp' | xargs clang-format --dry-run --Werror

Pin an exact version rather than using latest - clang-format output changes between major LLVM releases, and an unpinned formatter will eventually fail CI on untouched code.

How it works

.github/workflows/release-clang-tools.yml runs every six hours. It compares LLVM's tag list against the tags in this repository and, for each new one, runs the extraction script and publishes a release.

scripts/fetch-clang-tools.sh does the actual work:

  1. Reads the asset list for the release from the GitHub API
  2. Matches each target platform against a list of archive-name patterns, most preferred first
  3. Downloads the first match and pulls just bin/clang-format and bin/clang-tidy out of it

A platform upstream never published is skipped quietly.

Set STRICT=true or STRICT=false to override the age heuristic, or STRICT_WINDOW_DAYS to move the cutoff.

Maintenance

Both are run from the Actions tab via Run workflow:

Input Effect
llvm_tag Process only these tags (space or comma separated). Leave empty for the normal "what's new" check.
force Reprocess tags that already have a release and upload any missing binaries. With no llvm_tag, this backfills every known tag.

Use force to repair a release that is missing binaries it should have - uploads use --clobber, so re-running is safe and idempotent.

To build a release locally instead:

./scripts/create-release.sh llvmorg-22.1.8

It prints the git push and gh release create commands to finish the job. Requires curl, tar, 7z, unzip and the gh CLI.

License

Two different licenses apply here, because this repository distributes someone else's work alongside its own.

The binaries are built and published by the LLVM project and are licensed under Apache-2.0 WITH LLVM-exception. They are redistributed unmodified; all credit goes to the LLVM contributors. Repackaging them does not change their license, and your use of them is governed by it.

The scripts and workflow in this repository are licensed under the zlib/libpng license.

About

Republished standalone binaries for clang-format and clang-tidy, extracted from the official LLVM releases

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages