Expand description
The deterministic cargo-dist config generator (issue
release-engine-dist-config-generator).
Renders a downstream project’s dist-workspace.toml from the contract’s
Distribution block — the deterministic half of ossctl dist generate.
The ossctl-cli handler writes the rendered text to the repo root and then
invokes dist generate (the cargo-dist tool) to produce the tag-triggered
.github/workflows/release.yml from it; this module never shells out and
never touches the filesystem, so it is a pure, fully unit-testable function.
§What maps where (the contract → cargo-dist mapping)
The mapping is the binding cross-platform default documented in the
/oss-release skill and AGENTS.md (“Cross-platform is a hard requirement —
macOS AND Linux”):
distribution.platforms→[dist] targets. Copied verbatim (Rust target-triple syntax). The normalizer guarantees the set is non-empty and defaults an omittedplatformsto the cross-platform macOS + Linux-musl set (DEFAULT_CROSS_PLATFORM_TARGETS), so a repo that never thinks about platforms still ships Linux binaries. This generator NEVER narrows the set — a macOS-only matrix is a release gap.distribution.installers→[dist] installers. Mapped through, with two deliberate rules that mirror ossctl’s owndist-workspace.toml:shellis always ensured, so the generated curl-installer covers the Unix side (macOS AND Linux) even when the contract omitted it; andhomebrewis EXCLUDED from cargo-dist’s installer set — ossctl publishes the Homebrew formula through its own tap adapter (post-tag, needing the tarball sha256 that only exists after the release), exactly as the reference config does (“Homebrew auto-publish is deliberately NOT enabled here”). The tap itself is threaded elsewhere (distribution.homebrew_tapincrate::release::plan).
The rest of the [dist] table is the fixed reference shape: a pinned
PINNED_CARGO_DIST_VERSION, ci = "github", hosting = "github",
github-attestations = true, and pr-run-mode = "skip" (tag-triggered only).
The personal [dist.github-custom-runners] override in ossctl’s own config is
repo-local infra and is deliberately NOT emitted for downstream projects.
Determinism: the output is a pure function of the Distribution — no clock,
no environment, no map iteration — so the same block always renders the same
bytes (proven in tests).
Structs§
- Generated
Dist Config - The result of rendering a
dist-workspace.tomlfrom aDistribution.
Constants§
- PINNED_
CARGO_ DIST_ VERSION - The cargo-dist version pinned into every generated
dist-workspace.toml, so a regenerated workflow and a locally-installeddiststay in lockstep. Kept in step with ossctl’s own referencedist-workspace.tomlat the repo root.
Functions§
- generate
- Render a
dist-workspace.tomlfrom a normalizedDistributionblock.