Documentation
¶
Overview ¶
Package toolchain locates the build tools PiG uses for compiled extension cells and Piglet Binaries, and installs a PiG-managed Go toolchain for users who installed only the pig binary.
Index ¶
Constants ¶
const GoDownloadBase = "https://go.dev/dl/"
GoDownloadBase is the official Go distribution site. Its JSON index publishes the SHA-256 of every archive.
Variables ¶
var ContainerRuntimes = []string{"docker", "podman", "nerdctl"}
ContainerRuntimes lists the container engines PiG can drive, in preference order.
Functions ¶
func ConfigRoot ¶
ConfigRoot is the PiG configuration root: $PIG_HOME, else $XDG_CONFIG_HOME/pig, else ~/.pig, with a leading ~ expanded. It mirrors codingagent.ConfigRoot, which imports this package.
func ContainerRuntime ¶
ContainerRuntime returns the first container engine found on PATH.
func Go ¶
Go returns the go command to run: the one on PATH, else the PiG-managed toolchain. The error names both places it looked and the setup command.
func InstallGo ¶
func InstallGo(ctx context.Context, client *http.Client, base, version, goos, goarch, configRoot string) (string, error)
InstallGo downloads the Go archive for version, goos, and goarch from base, verifies its size and the SHA-256 published in the index, and replaces the managed toolchain under configRoot. It returns the installed go command.
func ManagedGoRoot ¶
ManagedGoRoot is the GOROOT of the PiG-managed Go toolchain.
Types ¶
This section is empty.