Documentation
¶
Overview ¶
Package cuetoolchain is THE single home for the pinned `cue` CLI (R3).
The schema→Go pipeline runs `cue exp gengotypes`, and that generator lives in `cuelang.org/go`'s INTERNAL tree (`internal/encoding/gotypes`), so no other module can call it in-process. The CLI is therefore a toolchain the pipeline provisions itself — checksum-verified, from a pinned release — so a reader who is told to run a `charly` command never sees `cue`, a checkout path, or a `cd`.
The pin AND the provisioning live here, once: the `charly`-side generation verb calls Ensure to obtain the toolchain, and spec's own `bootstrap-cue` task is re-keyed onto it too (it used to carry the same version, URL and checksum inline in shell — two declarations of one toolchain, which is exactly what this package removes). One pin, one home, one fetcher.
STANDALONE: stdlib only, so both callers can import it without pulling in the packages they regenerate.
Index ¶
Constants ¶
const Member = "cue"
Member is the path of the CLI inside the release tarball.
const Version = "v0.16.1"
Version is the pinned release tag of the `cue` CLI.
Variables ¶
This section is empty.
Functions ¶
func Ensure ¶
Ensure returns a path to the pinned cue CLI, provisioning it into dir on first use and verifying it on every call. It is the ONE fetcher:
- an existing binary is accepted only if it REPORTS the pinned version, so a stale cache is re-provisioned rather than served as success;
- an unpinned arch fails before any download, naming the arch and the remedy;
- the checksum is verified BEFORE extraction, so a mismatch leaves no half-written binary behind (the write is atomic: tmp + rename);
- every failure names the pin, the URL and the destination.
func ExtractMember ¶
ExtractMember writes the release tarball's Member entry to dest atomically (tmp + rename), so an interrupted extraction cannot leave a partial binary at the destination path.
func Pin ¶
func Pin() string
Pin names the pinned toolchain for the running host in one line, for a `--help` or a log line: what will be provisioned, and which arch rule applies. It is the ONE place a caller takes that sentence from.
func SHA256 ¶
SHA256 returns the pinned checksum for a GOARCH and whether that arch is pinned at all — the check a caller must make BEFORE fetching, so an unpinned arch fails with a remedy rather than an unverifiable download.
Types ¶
This section is empty.