cuetoolchain

package
v0.2026281.830 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2026 License: MIT Imports: 14 Imported by: 0

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

View Source
const Member = "cue"

Member is the path of the CLI inside the release tarball.

View Source
const Version = "v0.16.1"

Version is the pinned release tag of the `cue` CLI.

Variables

This section is empty.

Functions

func Ensure

func Ensure(dir string) (string, error)

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

func ExtractMember(tgz []byte, dest string) error

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

func SHA256(goarch string) (string, bool)

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.

func Tarball

func Tarball(goarch string) string

Tarball returns the release tarball name for a GOARCH, or "" when that arch is not checksum-pinned.

func URL

func URL(goarch string) string

URL returns the pinned download URL for a GOARCH, or "" when that arch is not checksum-pinned.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL