Skip to main content

LLVM/Clang Toolchain Build Tools - Rust-powered toolchain packaging with Python bindings

Project description

clang-tool-chain-bins

CI

clang-tool-chain-bins is the package and CLI for querying and installing the archived LLVM, Clang, MSVC-adjacent, and related tool bundles managed in this repository.

It is designed for machine consumption first:

  • per-archive JSON indexes for every *.tar.zst
  • aggregate tool index for exact and glob lookup
  • JSON Lines query output for scripting and AI agents
  • install resolution with cache tracking and concurrency-safe locking

Install

pip install clang-tool-chain-bins

The CLI uses ~/.clang-tool-chain as its default cache and install root. Set CLANG_TOOL_CHAIN_DOWNLOAD_PATH or pass --home-dir to use a different location.

Python API

The published package now exposes an importable top-level API at clang_tool_chain_bins.

from clang_tool_chain_bins import ensure, install, is_installed, query, resolve_one

matches = query("clang", platform="win", arch="x86_64")
selected = resolve_one("clang", platform="win", arch="x86_64", version="21.1.5", component="clang")

if not is_installed("clang", platform="win", arch="x86_64", version="21.1.5", component="clang"):
    result = ensure("clang", platform="win", arch="x86_64", version="21.1.5", component="clang")[0]
    print(result.install_path)

Public API types:

  • ToolMatch
  • QueryResult
  • InstallResult

Public API functions:

  • query(*patterns, ...)
  • resolve(tool, ...)
  • resolve_one(tool, ...)
  • is_installed(tool, ...)
  • install(tool, ...)
  • ensure(tool, ...)
  • try_install(tool, ...)

Query CLI

query is the discovery command. Default JSONL output returns one matched entry per line.

  • Patterns without glob characters are exact matches.
  • Patterns containing *, ?, or [] use glob matching.
  • Matching is case-insensitive against both normalized tool_name and the archived file_name.
  • Filters narrow matches by platform, arch, version, and component.
  • Output is JSON Lines by default, one matched entry per line. Use --pretty for a human-readable table plus per-match source URL and install path details.

Exact lookup:

clang-tool-chain-bins query clang

Glob lookup:

clang-tool-chain-bins query "llvm-*"

Multiple patterns in one call:

clang-tool-chain-bins query clang clang++ --platform linux --arch x86_64

Pretty output:

clang-tool-chain-bins query clang++ --pretty

Typical JSONL shape:

{"query":"clang","tool_name":"clang","file_name":"clang","component":"clang","version":"21.1.5","platform":"linux","arch":"x86_64","archive_url":"https://...","source_urls":["https://..."],"archive_sha256":"...","local_cache_path":"...","install_path":"...","installed":false}

Each JSON line for a match includes the aggregate index metadata plus derived local state such as:

  • query
  • tool_name and file_name
  • component, version, platform, arch
  • archive_filename, archive_path, archive_sha256, archive_url
  • source_urls
  • path_in_archive, tool_type, tool_sha256, size
  • parts, download_kind, probe_urls
  • local_cache_path
  • install_path
  • installed

installed is a local state check against the selected home directory. It becomes true when the install directory or its done.txt marker already exists there; it is not a remote availability check.

install_path is always the resolved destination for that archive candidate, even when installed is false. source_urls resolves to the concrete download URL list for that match; for normal archives it is a one-item list, and for multipart archives it contains the part URLs.

If a query has no matches, the JSONL stream emits a marker line like {"query":"missing-tool","matched":false}.

Index selection for query works like this:

  • --index PATH uses that local aggregate index file.
  • CLANG_TOOL_CHAIN_BINS_INDEX_URL overrides the remote index URL when --index is not set.
  • Otherwise the CLI first tries to discover a repo-relative raw GitHub tool-index.json.
  • If that remote lookup fails, it falls back to the packaged local index at tools/data/tool-index.json.

Install CLI

install resolves an exact tool or filename to one or more archive candidates, then downloads and extracts the selected archive.

  • install does not support globs.
  • Matching is exact against tool_name or file_name.
  • If more than one archive matches, the command exits with an error unless you add filters or pass --all.
  • Output is always JSON, one object per installed candidate.
  • --dry-run prints the install plan without downloading or extracting anything.

Install a single archive:

clang-tool-chain-bins install clang --platform linux --arch x86_64

Preview the plan only:

clang-tool-chain-bins install clang --platform linux --arch x86_64 --dry-run

If multiple archives match, narrow the selection with:

  • --platform
  • --arch
  • --version
  • --component

Use --all to install every matching archive.

Typical install result:

{"operation":"install","status":"installed","tool_name":"clang","component":"clang","version":"21.1.5","platform":"linux","arch":"x86_64","install_path":"~/.clang-tool-chain/clang/linux/x86_64","archive_sha256":"...","archive_url":"https://...","dry_run":false}

Possible status values include:

  • installed
  • already_installed
  • dry_run

The installer is concurrency-safe for each component/platform/arch target:

  • archives are cached under HOME/archives/
  • installs land under HOME/<component>/<platform>/<arch>/
  • a per-target lock file prevents concurrent writers
  • done.txt records the installed archive hash and source URL

Download behavior:

  • file:// archive URLs are copied directly
  • HTTP(S) archive URLs are downloaded automatically

install uses the packaged local aggregate index unless --index is provided. Unlike query, it does not try to fetch a remote index automatically.

Index Generation

Generate or refresh sidecar indexes and the aggregate tool index:

clang-tool-chain-bins-index

Publishing

Build and validate release artifacts locally:

clang-tool-chain-bins-publish --skip-upload

Publish to TestPyPI:

clang-tool-chain-bins-publish --testpypi

Publish to PyPI:

clang-tool-chain-bins-publish

By default the publish script reads the token from PYPI_TOKEN.

Repository Scope

This repository still contains maintainer-oriented archive build scripts under tools/. The published package hardens the artifact boundary so wheel and sdist contents are limited to intentional code, metadata, tests, and generated tool index data rather than the raw archive payloads.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clang_tool_chain_bins-0.4.3.tar.gz (110.0 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

clang_tool_chain_bins-0.4.3-cp310-abi3-win_arm64.whl (565.9 kB view details)

Uploaded CPython 3.10+Windows ARM64

clang_tool_chain_bins-0.4.3-cp310-abi3-win_amd64.whl (597.5 kB view details)

Uploaded CPython 3.10+Windows x86-64

clang_tool_chain_bins-0.4.3-cp310-abi3-musllinux_1_2_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ x86-64

clang_tool_chain_bins-0.4.3-cp310-abi3-musllinux_1_2_aarch64.whl (1.2 MB view details)

Uploaded CPython 3.10+musllinux: musl 1.2+ ARM64

clang_tool_chain_bins-0.4.3-cp310-abi3-manylinux_2_34_x86_64.whl (956.3 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.34+ x86-64

clang_tool_chain_bins-0.4.3-cp310-abi3-manylinux_2_34_aarch64.whl (910.6 kB view details)

Uploaded CPython 3.10+manylinux: glibc 2.34+ ARM64

clang_tool_chain_bins-0.4.3-cp310-abi3-macosx_11_0_arm64.whl (733.7 kB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

clang_tool_chain_bins-0.4.3-cp310-abi3-macosx_10_12_x86_64.whl (819.6 kB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file clang_tool_chain_bins-0.4.3.tar.gz.

File metadata

  • Download URL: clang_tool_chain_bins-0.4.3.tar.gz
  • Upload date:
  • Size: 110.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for clang_tool_chain_bins-0.4.3.tar.gz
Algorithm Hash digest
SHA256 1322d4b0af44aff9b00bf02702a06d3fcb5a836c452e1ef8d26d4361038a161c
MD5 92697fb8a3c1689543d864a5996109a5
BLAKE2b-256 a8428bf0d2666bbc35d322197de8064e9f883a7f49097c6d1a3b4e2bbb583427

See more details on using hashes here.

Provenance

The following attestation bundles were made for clang_tool_chain_bins-0.4.3.tar.gz:

Publisher: auto-release.yml on zackees/clang-tool-chain-bins

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file clang_tool_chain_bins-0.4.3-cp310-abi3-win_arm64.whl.

File metadata

File hashes

Hashes for clang_tool_chain_bins-0.4.3-cp310-abi3-win_arm64.whl
Algorithm Hash digest
SHA256 011e709bcbf503ea20a88626ffc7bc6034cd014a0cd7e04b9c56b98ffc32e108
MD5 666a4218659d3e1589c309cc4f4baa20
BLAKE2b-256 3c59dcc02778ba103239cbe1f7df8f3eeba75f9d71de50f832fb276c0dcc966d

See more details on using hashes here.

Provenance

The following attestation bundles were made for clang_tool_chain_bins-0.4.3-cp310-abi3-win_arm64.whl:

Publisher: auto-release.yml on zackees/clang-tool-chain-bins

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file clang_tool_chain_bins-0.4.3-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for clang_tool_chain_bins-0.4.3-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 a92f644b04e892e0e07e95e4768b30094c4a3fa272861cbcab4a07c3926d85f8
MD5 465abefa89cf8774f37305b2778ecc2d
BLAKE2b-256 265a95ab270780ff92f0c63282626c105db3b73924d6fa9cc8365f884197a335

See more details on using hashes here.

Provenance

The following attestation bundles were made for clang_tool_chain_bins-0.4.3-cp310-abi3-win_amd64.whl:

Publisher: auto-release.yml on zackees/clang-tool-chain-bins

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file clang_tool_chain_bins-0.4.3-cp310-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for clang_tool_chain_bins-0.4.3-cp310-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 3eb869ee8ac0d800348030f8795ea84b9ade5ffd3fe495ec35d37bc4519f95bb
MD5 46e9bead1fb82cbad19da28423f778c2
BLAKE2b-256 ffb3580984a5e0c333c9d6a7e191a4b3d06cdbcb515ae9b6624e119587902afc

See more details on using hashes here.

Provenance

The following attestation bundles were made for clang_tool_chain_bins-0.4.3-cp310-abi3-musllinux_1_2_x86_64.whl:

Publisher: auto-release.yml on zackees/clang-tool-chain-bins

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file clang_tool_chain_bins-0.4.3-cp310-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for clang_tool_chain_bins-0.4.3-cp310-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 5f27e335771f97839d627bde798c737396a3c298385de471a709a03cff1b3761
MD5 fe696df917bd4303752466098b78864a
BLAKE2b-256 f397f41749aba6932a0458707f94d6558953a560496bf3bd725e05e6eac962e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for clang_tool_chain_bins-0.4.3-cp310-abi3-musllinux_1_2_aarch64.whl:

Publisher: auto-release.yml on zackees/clang-tool-chain-bins

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file clang_tool_chain_bins-0.4.3-cp310-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for clang_tool_chain_bins-0.4.3-cp310-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 f696984c98707c03f59401c0e86212755c1c8a5a34bfb53dc9f6cdfb5ea0fb8e
MD5 96b35ab84d11a1df547b29a555f9aee4
BLAKE2b-256 2e70f0f988358359a3c2133551b42fdb1ffbb5e698e8cabb0afc2c69d5c77e0a

See more details on using hashes here.

Provenance

The following attestation bundles were made for clang_tool_chain_bins-0.4.3-cp310-abi3-manylinux_2_34_x86_64.whl:

Publisher: auto-release.yml on zackees/clang-tool-chain-bins

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file clang_tool_chain_bins-0.4.3-cp310-abi3-manylinux_2_34_aarch64.whl.

File metadata

File hashes

Hashes for clang_tool_chain_bins-0.4.3-cp310-abi3-manylinux_2_34_aarch64.whl
Algorithm Hash digest
SHA256 e2bb54b8f85a69da633a743a0516ebb43bf813bcb5c05b341e6530148bd37150
MD5 3862be2c3c9daaf7d0d8df82a4e47a9a
BLAKE2b-256 827e3a3433764891db659a7ecd99f89e69230d9f9e91ab6b353c33a2a4eea04d

See more details on using hashes here.

Provenance

The following attestation bundles were made for clang_tool_chain_bins-0.4.3-cp310-abi3-manylinux_2_34_aarch64.whl:

Publisher: auto-release.yml on zackees/clang-tool-chain-bins

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file clang_tool_chain_bins-0.4.3-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for clang_tool_chain_bins-0.4.3-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1476411bdd79bdc3819a00328901062430911a25ec453de0cc987da9a3ac7231
MD5 a4d4106d39230bfd6040ded4ca9d179e
BLAKE2b-256 9714f11cab8a9275bf49a03c2349e8580af4ed77eaa7214d191eb0b394cb217e

See more details on using hashes here.

Provenance

The following attestation bundles were made for clang_tool_chain_bins-0.4.3-cp310-abi3-macosx_11_0_arm64.whl:

Publisher: auto-release.yml on zackees/clang-tool-chain-bins

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file clang_tool_chain_bins-0.4.3-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for clang_tool_chain_bins-0.4.3-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 7ea02418d51a019199948afdba5e6f9b924271129f1d221d53d54e25c067b8fa
MD5 1722e92c878d9930da3860a8e3bcdc78
BLAKE2b-256 c244a4de5b7fbaca26543f5086322f1585ccfbc33c62f6e6eae13cc16cd7786d

See more details on using hashes here.

Provenance

The following attestation bundles were made for clang_tool_chain_bins-0.4.3-cp310-abi3-macosx_10_12_x86_64.whl:

Publisher: auto-release.yml on zackees/clang-tool-chain-bins

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page