toolchain

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: MIT Imports: 16 Imported by: 0

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

View Source
const GoDownloadBase = "https://go.dev/dl/"

GoDownloadBase is the official Go distribution site. Its JSON index publishes the SHA-256 of every archive.

Variables

View Source
var ContainerRuntimes = []string{"docker", "podman", "nerdctl"}

ContainerRuntimes lists the container engines PiG can drive, in preference order.

Functions

func ConfigRoot

func ConfigRoot() (string, error)

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

func ContainerRuntime() (name, path string, ok bool)

ContainerRuntime returns the first container engine found on PATH.

func Go

func Go() (string, error)

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

func ManagedGoRoot(configRoot string) string

ManagedGoRoot is the GOROOT of the PiG-managed Go toolchain.

Types

This section is empty.

Jump to

Keyboard shortcuts

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