RFD0027 - Toolchain Manifest Contract
- Feature Name:
toolchain_manifest_contract - Start Date:
2026-03-30 - Status:
implemented
Summary
Section titled “Summary”This RFD makes riot require manifest.json inside published OCaml
toolchain tarballs and use it as the authoritative toolchain identity input to
cache hashing.
From this point forward, published toolchains use the Riot toolchain suffixing
scheme 5.5.0-riot.<N> (for example 5.5.0-riot.1) to force explicit rebuild
epochs. scripts/toolchain/ocaml.sh defaults that suffix to riot.1 when
packaging is not explicitly overridden, so consumers resolve and download the Riot
artifact family by default.
The contract is:
- Release toolchains published for
./scripts/toolchain/ocaml.shmust includemanifest.json. - The file must contain a non-empty
toolchain_fingerprint. riot-toolchainmust validate manifest presence on install and reject archives that do not contain it.- Planner cache keys for downloaded/non-local toolchains must be derived from that fingerprint instead of probing selected filesystem paths.
- Local source toolchains (explicit
Pathinstalls / vendored compiler) remain supported and continue to use path-based fallback hashing.
Motivation
Section titled “Motivation”Recent cross-compilation failures were traceable to toolchain tarballs drifting from the compiler artifact set expected by the build process (missing sysroot headers/libs). A manifest fingerprint makes it explicit when a compiler bundle is semantically different even if file layout is similar.
This RFD removes ad-hoc probing as the primary identity and makes cache behavior depend on a stable build artifact description carried in the release tarball.
Mechanism
Section titled “Mechanism”vendor/ocaml/cross/package.shwritesmanifest.jsonduring packaging and archives it into every tarball.riot-toolchain:- validates
manifest.jsonafter extraction for downloaded toolchains, - fails installation if the manifest is missing or invalid,
- prefers
toolchain_fingerprintinhash.
- validates
- Planner cache keys now fail fast for missing-manifest non-local toolchains, forcing users to install from a republished artifact.
Migration
Section titled “Migration”- Re-publish affected OCaml toolchains after this change and upload to CDN.
- Invalidate stale local toolchain cache directories under
~/.riot/toolchains/...if users previously installed legacy tarballs without manifests. - Publish and consume only Riot version-family toolchains by default:
bootstrap.py,packages/riot-toolchain,packages/riot-model, andocaml-toolchain.tomldefault to5.5.0-riot.1.- Explicitly setting
OCAML_VERSION/[toolchain].versionremains the override for newer epochs (for example5.5.0-riot.2).