Toolchain registry for scrap — a C/C++ build system.
This repository defines molds (toolchain recipes) and the CI/CD pipeline that validates and distributes them as ingots (prebuilt toolchain packages).
scrap-toolchain/
├── molds/ # Toolchain recipes
│ └── {family}/{version}/
│ ├── mold.toml # Recipe definition
│ └── patches/ # Optional patches (build type only)
├── schema/
│ └── mold-v1.schema.json # JSON Schema for mold.toml validation
├── scripts/ # CI/CD helper scripts
├── .github/workflows/ # GitHub Actions workflows
├── platforms.toml # Platform matrix (Tier 1/2)
├── index.toml # Auto-generated toolchain index
└── README.md
- A contributor submits a PR adding or updating a
molds/{family}/{version}/mold.toml - PR Validation — the mold is validated against
schema/mold-v1.schema.json, and fetch-type molds are verified on Tier 1 platforms where binaries are defined (Linux platforms are mandatory; macOS is verified when a binary is available) - On merge, Ingot Cast — CI processes the mold:
- fetch molds: no artifacts produced (validation already done in step 2), except for the Linux binaries that remove DT_NEEDED entries and the macOS binaries that rebuild libraries, which CI changes and pushes to
ghcr.ioas ingots - build molds: CI builds the toolchain and pushes ingots to
ghcr.ioas OCI artifacts
- fetch molds: no artifacts produced (validation already done in step 2), except for the Linux binaries that remove DT_NEEDED entries and the macOS binaries that rebuild libraries, which CI changes and pushes to
- Index Update —
index.tomlis regenerated from mold definitions and build artifacts, then committed to the repository
- fetch — References prebuilt binaries from upstream (e.g., LLVM official releases). CI validates the recipe but does not produce artifacts; users download directly from upstream. A Linux binary entry can list DT_NEEDED entries to remove (
source.binaries[].remove_needed, e.g.,libatomic.so.1from libc++ of LLVM). CI removes them withpatchelfafter checking that the file takes no symbol from the library, and pushes the result toghcr.ioas an ingot;index.tomlthen lists the ingot for that platform instead of the upstream archive. A macOS binary entry can likewise name libraries to build again from the source of the release (source.binaries[].rebuild). The macOS releases of LLVM from 20.1.0 on are linked with lld, and theirlibunwindcannot unwind a C++ exception; CI buildslibunwindagain with the system linker, checks that it keeps the install name, the minimum macOS and the exported symbols, and adds theLICENSE.TXTof the source, which the archive does not have at its top. - build — Builds from source (e.g., GCC). CI produces ingots and pushes them to
ghcr.ioas OCI artifacts. A build mold can list sources built into the toolchain (source.build.in_tree, e.g., GMP, MPFR, MPC and ISL for GCC) and packages installed alongside it (source.build.companions, e.g., binutils), so that the ingot runs without the libraries and tools of the machine that built it.
| Tier | Platforms | Support |
|---|---|---|
| Tier 1 | linux-x86_64, linux-aarch64, darwin-aarch64 | Full CI validation, official distribution |
| Tier 2 | darwin-x86_64 | Source build only |
Every toolchain uses the C library of the system: glibc at least the glibc_version that index.toml lists for the ingot, and its headers (libc6-dev on Debian and Ubuntu).
- GCC ingots carry everything else they need to compile and link, including binutils and the libraries the compiler loads.
- LLVM molds use the upstream release binaries, which also need:
- the C++ standard library headers (
libstdc++-<N>-dev) libxml2for LLVM 17 to 23.1.2 (except LLVM 17 on aarch64)- ICU 70 (
libicu70, packaged in Ubuntu 22.04) for LLVM 23.1.0 to 23.1.2 - binutils, unless linking with
-fuse-ld=lld libatomic1, unless the mold removeslibatomic.so.1withremove_needed. Such ingots are listed withorigin = "scrap-release"inindex.toml
- the C++ standard library headers (
This repository is licensed under MIT.
Important: The distributed toolchain ingots are subject to their respective upstream licenses, not MIT. Each ingot includes the relevant license files as specified by the metadata.license_files field in its mold.toml.
| Toolchain | License | License Files | Status |
|---|---|---|---|
| LLVM/Clang | Apache-2.0 WITH LLVM-exception | LICENSE.TXT |
Available |
| GCC | GPL-3.0-or-later WITH GCC-exception-3.1 AND (LGPL-3.0-or-later OR GPL-2.0-or-later) AND LGPL-3.0-or-later AND MIT | COPYING, COPYING.RUNTIME, and licenses/ for binutils, GMP, MPFR, MPC and ISL |
Available |
- Repository code (scripts, workflows, schema): MIT
- Mold definitions (
mold.toml): MIT (as part of the repository) - Distributed ingots: Each toolchain's own license. The
mold.tomlmetadata.licensefield declares the SPDX identifier, andmetadata.license_fileslists the files that must be present in the upstream distribution.cast-ingot.shverifies their presence during validation. - Bundled sources (
source.build.in_treeandsource.build.companions): their own licenses, included in the ingot underlicenses/<name>/from thelicense_filesof each entry, and covered bymetadata.license.
For contributors adding new molds: ensure metadata.license and metadata.license_files are accurate for the upstream project. The CI pipeline will fail if specified license files are missing from the upstream distribution.