Documentation
¶
Overview ¶
Package toolchain pins the external tools `unobin compile` shells out to and fetches them through a shared cache, so builds use the same versions across machines regardless of what is on ${PATH}.
Index ¶
Constants ¶
const UnobinModulePath = "github.com/cloudboss/unobin"
UnobinModulePath is the unobin module's path: the one requirement every generated go.mod pins to the compiling CLI's version, and the dependency a factory checks its own build info for at startup.
Variables ¶
var All = []cachedeps.Dependency{Go, TreeSitter}
All is the set of pinned tools, used by tests to confirm coverage for the running platform.
var Go = cachedeps.Dependency{ Name: "go", Version: "1.26.2", Format: cachedeps.TarGz, URLs: map[cachedeps.Platform]string{ {OS: "linux", Arch: "amd64"}: "https://go.dev/dl/go1.26.2.linux-amd64.tar.gz", {OS: "linux", Arch: "arm64"}: "https://go.dev/dl/go1.26.2.linux-arm64.tar.gz", {OS: "darwin", Arch: "amd64"}: "https://go.dev/dl/go1.26.2.darwin-amd64.tar.gz", {OS: "darwin", Arch: "arm64"}: "https://go.dev/dl/go1.26.2.darwin-arm64.tar.gz", }, SHA256: map[cachedeps.Platform]string{ {OS: "linux", Arch: "amd64"}: "990e6b4bbba816dc3ee129eaeaf4b42f17c2800b88a2166c265ac1a200262282", {OS: "linux", Arch: "arm64"}: "c958a1fe1b361391db163a485e21f5f228142d6f8b584f6bef89b26f66dc5b23", {OS: "darwin", Arch: "amd64"}: "bc3f1500d9968c36d705442d90ba91addf9271665033748b82532682e90a7966", {OS: "darwin", Arch: "arm64"}: "32af1522bf3e3ff3975864780a429cc0b41d190ec7bf90faa661d6d64566e7af", }, }
Go is the pinned Go toolchain `unobin compile` invokes when building factory binaries. Bumping the version means updating both the URL and the SHA256 for every supported platform.
var TreeSitter = cachedeps.Dependency{ Name: "tree-sitter.gz", Version: treeSitterVersion, Format: cachedeps.Binary, URLs: map[cachedeps.Platform]string{ {OS: "linux", Arch: "amd64"}: treeSitterReleaseURL + "tree-sitter-linux-x64.gz", {OS: "linux", Arch: "arm64"}: treeSitterReleaseURL + "tree-sitter-linux-arm64.gz", {OS: "darwin", Arch: "amd64"}: treeSitterReleaseURL + "tree-sitter-macos-x64.gz", {OS: "darwin", Arch: "arm64"}: treeSitterReleaseURL + "tree-sitter-macos-arm64.gz", }, SHA256: map[cachedeps.Platform]string{ {OS: "linux", Arch: "amd64"}: "9ce82137caa65864e7ca8b869fd391cef88c9bd2a01c4371b9c4dd26c2585efb", {OS: "linux", Arch: "arm64"}: "c8feeb32115958cb44442ca4d68f6d66cf7605dbd65681e62342181ebdd6db3b", {OS: "darwin", Arch: "amd64"}: "a57b6044ad739ca3164cc20637db65352ccc9c69e1c34a7cda3e5a62d529b164", {OS: "darwin", Arch: "arm64"}: "e46725b2417c085b0761948abc0cc240bff6a3ab5d2128e3ad0de467ded3388d", }, }
TreeSitter pins the compressed standalone CLI used by grammar checks.
Functions ¶
func Ensure ¶
Ensure returns the path to the pinned `go` executable, fetching and caching the toolchain under the user cache dir on first use. Progress is written to out; pass nil for silent operation. The archive unpacks to a top-level `go/` directory, so the executable sits at go/bin/go under the returned cache entry.
Types ¶
This section is empty.