packages

package
v2.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2026 License: MIT Imports: 55 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Packages icebath downloads and keeps on this machine for its features, every profile of the machine sharing them: pinned tools and runtimes in a hash checked store, and the Python environments features run their code in

Index

Constants

View Source
const (
	Python = "python"
	UV     = "uv"
	Node   = "node"
	NPM    = "npm"
	Git    = "git"
	GH     = "gh"
)

Packages the host itself runs on, declared by it

View Source
const Android = "android"

Key of a package's gaps standing for every target of Termux

View Source
const Bionic = "linux-arm64-bionic"

Android's Termux userland on arm64, the one target of Termux the declared pins carry archives for, such as Python's wheels

View Source
const DisableLazyEnv = "ICEBATH_DISABLE_LAZY_INSTALLS"

Variable that turns installs on demand off, set by images and test harnesses

View Source
const DownloadsEnv = "ICEBATH_DOWNLOADS"

Variable naming a folder of archives by their sha256, as the image of icebath carries the pinned archives of its programs: an install takes an archive from there in place of the network

View Source
const RuntimeDirEnv = "ICEBATH_RUNTIME_DIR"

Environment variable pointing a process at another tool store, such as the one an image ships

Variables

View Source
var AndroidTargets = []string{"linux-arm64-bionic", "linux-arm-bionic", "linux-x64-bionic", "linux-x86-bionic"}

Targets of Termux, one for each processor Termux builds for, as detection names them

View Source
var Musl = map[string]bool{"linux-x64-musl": true, "linux-arm64-musl": true}

Linux userlands on musl

View Source
var RustTriple = map[string]string{
	"win32-x64":        "x86_64-pc-windows-msvc",
	"win32-arm64":      "aarch64-pc-windows-msvc",
	"linux-x64":        "x86_64-unknown-linux-gnu",
	"linux-arm64":      "aarch64-unknown-linux-gnu",
	"linux-x64-musl":   "x86_64-unknown-linux-musl",
	"linux-arm64-musl": "aarch64-unknown-linux-musl",
	"darwin-x64":       "x86_64-apple-darwin",
	"darwin-arm64":     "aarch64-apple-darwin",
}

Rust target triple of each target

View Source
var Targets = []string{
	"win32-x64",
	"win32-arm64",
	"linux-x64",
	"linux-arm64",
	"linux-x64-musl",
	"linux-arm64-musl",
	"linux-arm64-bionic",
	"darwin-x64",
	"darwin-arm64",
}

Every platform the package manager pins archives for

Functions

func CurrentTarget

func CurrentTarget() string

Target of this machine, the libc of its userland deciding the Linux flavour

func Extract

func Extract(archive, dest string) error

Empties dest and extracts an archive into it by its file name: a tarball, a zip, a wheel, which is a zip, or a Debian package; nothing escapes dest

func Fetch

func Fetch(cfg *config.Config, rawURL string) ([]byte, error)

Body of an upstream index page a package's newest versions are read from, remembered within one operation

func Flatten

func Flatten(dest string) error

Hoists the contents of a lone top folder unless the folder is the layout itself, leaving everything when a name would collide

func GitHubDigests

func GitHubDigests(cfg *config.Config, repo, tag string) (map[string]string, error)

Digests GitHub publishes for the files of one release of a repository, in hex by the name of each file, so a pin is made without downloading them; a file it publishes none for is left out

func GitHubTags

func GitHubTags(cfg *config.Config, repo, strip string) ([]string, error)

Newest first version tags of a GitHub repository's releases, a prefix stripped, drafts and prereleases left out

func InImage

func InImage() bool

Whether this process runs from the container image of icebath, whose programs are linked onto PATH, installed from the archives it carries, and whose programs laid out at build are pinned

func IsDownload

func IsDownload(err error, kind DownloadKind) bool

Whether err is a download failure of the kind

func Keep

func Keep(cfg *config.Config, step, output string) string

Keeps the whole output of a failed step a feature of the profile ran, such as the npm install of a language server or the system packages of the agent desktop, in the profile's logs folder where Log reads it; the file, empty when there is no output or it could not be written

func Kept

func Kept(cfg *config.Config) []string

Logs of the failed steps of the profile of the settings, the newest last

func LinkFolder

func LinkFolder() string

Folder the commands are linked into: the folder of commands every account's PATH holds, in the image when this process may write it, as it starts as root, and for an install for everyone of the computer; else the folder of commands of the user's own, where the icebath command is put on PATH

func Lookup

func Lookup(name string, env map[string]string) string

Path of the program of the name on the search path of the environment a child is given, PATH as Windows spells it there too, the one the child finds; the name itself, for this process to find, when that search path has none

func Merge

func Merge(src, dst string) error

Moves the files of src into dst keeping both layouts, a file in both failing

func NodeModules

func NodeModules(tree string) [][2]string

Name and version of every Node package installed in the folder, as the lock npm keeps of node_modules says, else the lock beside the package.json; none when neither reads

func NpmLatest

func NpmLatest(cfg *config.Config, name string) (string, error)

Newest version of an npm package on the registry the profile's environment sets, what its latest dist tag names, for a package a plugin declares that npm installs

func OnAndroid

func OnAndroid(target string) bool

Whether the target is Termux on Android, whatever its processor

func Pins

func Pins(data []byte) map[string]Pin

Pins of a lock document a declaring package embeds: {"packages": {name: {"version", "artifacts"}}}. A document that does not read is a mistake of the code

func Present

func Present(bin, entry, target string) string

Why a binary is not there or not of the target's architecture, empty when it is

func PythonNames

func PythonNames() []string

Names the interpreter goes by on PATH, in the order they are looked for

func Which

func Which(name, path string) string

Executable a name resolves to on a search path, Windows trying its program extensions; empty when none

Types

type Archives

type Archives []Artifact

Archives of one target, written as one object when there is only one

func (Archives) MarshalJSON

func (a Archives) MarshalJSON() ([]byte, error)

func (*Archives) UnmarshalJSON

func (a *Archives) UnmarshalJSON(data []byte) error

type Artifact

type Artifact struct {
	URL    string `json:"url"`
	SHA256 string `json:"sha256"`
}

type Build

type Build struct {
	Ctx      context.Context
	Dir      string
	Version  string
	Target   string
	Archives Archives
	// contains filtered or unexported fields
}

One store entry being built: its staged tree, version and target, and the archives of the pin in force it is built from

func (*Build) Binary

func (b *Build) Binary(name string) (string, error)

Binary of another installed package

func (*Build) Entry

func (b *Build) Entry(name string) (string, error)

Store entry of another installed package on the build's target, for a build that takes from it

func (*Build) NpmInstall

func (b *Build) NpmInstall(name, archive string) error

Installs the npm package of the checked tarball into the build's entry as a global package of its own prefix, with the Node and npm the package manager keeps; what the package needs comes from the npm registry. A failure keeps all npm said in a log

type Closure

type Closure struct {
	// Package of icebath and the version of Termux's package installed
	Name, Version string
	// Termux's architecture, and the packages taken, the program's first, each as its name and version
	Arch  string
	Taken []string
	// Libraries linked from the phone's Termux, by the package of it owning each
	Linked map[string]string
	// Packages its Depends name that the phone's Termux lacks, as a person installs them
	Wanted []string
	// ELF files of it that find none of the libraries they need, being built with no library path
	Stranded []string
	// ELF files of it built for another processor, which nothing loads, so they were left as they came
	Foreign []string
	// Why the entry would not run as it stands, empty when it would
	Broken string
}

A program installed from Termux's repository on this phone, as its entry holds it

type ConflictError

type ConflictError struct{ *InstallError }

A resolution that has no solution

func (*ConflictError) Unwrap

func (e *ConflictError) Unwrap() error

type Coverage

type Coverage struct {
	Key    string
	Ranges []Range
}

Runs one destination holds, keyed by its address

type Declared

type Declared struct {
	Tools []Package
	Sets  []Extra
}

Declarations fixed once they are registered

func (Declared) Extras

func (d Declared) Extras() []Extra

func (Declared) Packages

func (d Declared) Packages() []Package

type Dependency

type Dependency struct {
	// PyPI, npm, crates.io or Go, and the name and version as that ecosystem writes them
	Ecosystem, Name, Version string
	// What has it, as a person reads it: the program, the Python set or environment, or the folder of the Node packages
	Of string
	// Name the package manager updates it by, the program or the Python set; empty for what only an update of everything reaches
	Update string
	// The same for every profile, as the store and the Python sets are
	Shared bool
}

A package of an ecosystem OSV tracks that is installed on this machine for a feature: a program of the store, a Python distribution of a Python set or of a side environment of the profile, or a Node package of a folder whose dependencies a feature of the profile installed

type Download

type Download struct {
	Sources []Source
	// Starts afresh rather than from the partial an earlier run kept
	NoResume bool
	// Ranges at once, eight when zero
	Connections int
	// Folder of the partials, the package manager's own when empty
	Partials string
	// Environment of the profile the files are fetched for, whose proxy and authorities its requests take, none meaning no proxy and the
	// system's authorities
	Env httpx.Env
	// contains filtered or unexported fields
}

Resumable download of a set of files, ranges of each fetched at once and every file checked before it is published

func (*Download) Run

func (d *Download) Run(ctx context.Context, progress Progress) ([]string, error)

Fetches every source, the context's end stopping it as paused with its partials kept; the published destinations in source order

type DownloadError

type DownloadError struct {
	Kind    DownloadKind
	Message string
	URL     string
	Status  int
	// A pinned mirror may be tried after it
	Fallback bool
	Err      error
}

func (*DownloadError) Error

func (e *DownloadError) Error() string

func (*DownloadError) Unwrap

func (e *DownloadError) Unwrap() error

type DownloadKind

type DownloadKind int

What kind of failure a download had

const (
	Failed DownloadKind = iota
	// The server changed the bytes or the range under the download
	RangeChanged
	// The bytes are not the pinned ones
	HashMismatch
	// Stopped by its caller with its partial kept for the next run
	Paused
	// The network or server refused once every try was spent
	Unreachable
)

type Ensuring

type Ensuring struct {
	// Base environment of the runner and of what its install runs, the profile's own as its commands get it when nil
	Base map[string]string
	// A person asked for it, so the lazy install setting does not apply and the entries are checked again
	Explicit bool
	// Steps of each package's install as they go
	Step func(name, stage string, done, total int64, label string)
	// Download coverage, for a feature drawing its own progress
	Progress Progress
	// Where lock waits and build notes go
	Report Reporter
	// contains filtered or unexported fields
}

How ensure installs

type Env

type Env struct {
	Path []string
	Vars map[string]string
}

Variables an entry gives the programs that use it: folders put first on PATH and values set

func (Env) MarshalJSON

func (e Env) MarshalJSON() ([]byte, error)

func (*Env) UnmarshalJSON

func (e *Env) UnmarshalJSON(data []byte) error

type EnvironmentOptions

type EnvironmentOptions struct {
	// Simple name of the environment, a folder under the profile's environments
	Name string
	// Bounded requirements to install, such as "pypdf==6.21.2"
	Requirements []string
	// A person asked for it, so the lazy install setting does not apply
	Explicit bool
	// Longest the resolution and install may take, half an hour when zero
	Timeout time.Duration
	// Program the requirements must install beside the interpreter, checked before the generation is selected
	Executable string
	Report     Reporter
}

What a side environment is to hold and where

type Extra

type Extra struct {
	// Canonical name, the key of its entry
	Name string `json:"-"`
	// What a person calls it, what it does and the feature that needs it, which the declaring package gives
	Title   string   `json:"-"`
	About   string   `json:"-"`
	Feature string   `json:"-"`
	Aliases []string `json:"aliases,omitempty"`
	// Modules whose presence proves it installed
	Anchors []string `json:"anchors"`
	// Requirements it is resolved from
	Requires []string `json:"requires"`
	// Package indexes some requirements come from, on the platforms their marker admits
	Sources map[string]Index `json:"sources,omitempty"`
	// Programs its source builds call, the package manager's own unless the system's on that platform
	Tools []string `json:"tools,omitempty"`
	// Why it can't be installed on a target
	Unsupported map[string]string `json:"unsupported,omitempty"`
	// Packages each target compiles from source
	Build map[string][]string `json:"build,omitempty"`
	// The resolution: every package with the targets its marker admits and every artifact the lock allows
	Packages  []Locked `json:"packages"`
	BuildDeps []Locked `json:"build_requires,omitempty"`
	// Python minor the resolution is for
	Python string `json:"-"`
}

A Python dependency set a feature installs on request, its requirements and the hash pinned resolution of them for every target

func Extras

func Extras(data []byte, shown map[string]Shown) []Extra

Extras of a document a declaring package embeds, each with how a person knows it; a document that does not read, or an extra of it with none, is a mistake of the code

type ExtraState

type ExtraState struct {
	Name, Title, About, Feature string
	Standing                    Standing
	// Why it can't be installed on this machine, empty when it can
	Unsupported string
	// Worked out again for newer packages than this build pins, which putting back the build's undoes
	Updated bool
}

How one extra stands on this machine

type HTTPError

type HTTPError struct {
	Code   int
	Reason string
	Header http.Header
	URL    string
}

Response that was no success

func (*HTTPError) Error

func (e *HTTPError) Error() string

type Index

type Index struct {
	Index  string `json:"index"`
	Marker string `json:"marker,omitempty"`
}

type InstallArgs

type InstallArgs struct {
	Names []string
}

What an install installs: programs and Python sets by name, else the programs icebath needs and those it installs by default

type InstallError

type InstallError struct {
	Package string
	Cause   string
	Remedy  string
	Err     error
	// File holding the whole output of the program that failed, empty when there is none
	Log string
}

Failure of a package, why it failed and what the person can do about it

func Failure

func Failure(name, cause, remedy string) *InstallError

Install failure with the usual remedy when none is given

func (*InstallError) Error

func (e *InstallError) Error() string

func (*InstallError) Unwrap

func (e *InstallError) Unwrap() error

type Installed

type Installed struct {
	// Its store entry
	Path    string
	Version string
	// Its binary, empty for a package without one
	Binary string
}

A package found installed, as a feature asks for it

type Keeper

type Keeper interface {
	Registrant
	Keepings(cfg *config.Config) []Keeping
}

A feature whose keepings the package manager lists beside the programs

type Keeping

type Keeping struct {
	// Name the package manager knows it by, such as tokenizer:Qwen/Qwen3-8B, and what a person calls it
	Name, Title string
	// What it is, a sentence, and the feature that keeps it
	About, Feature string
	// Bytes of its files
	Size int64
	// What is wrong with its files, each a sentence; none when they are the ones downloaded
	Check func() []string
	// Removes its files
	Remove func() error
}

Files a feature downloaded once into icebath's folder and keeps for every profile, such as the tokenizer of a model: listed with the programs, checked and removed with them, and downloaded again by the feature when it needs them

type Kind

type Kind string

What a run changed

const (
	KindInstall Kind = "install"
	KindRemove  Kind = "remove"
	KindCheck   Kind = "check"
	KindUpdate  Kind = "update"
	KindPin     Kind = "pin"
	KindClean   Kind = "clean"
)
type Link struct {
	// Name of the command, the program it is of and the program file it runs
	Name    string `json:"name"`
	Package string `json:"package"`
	Target  string `json:"target"`
	// Folder it is linked into
	Folder string `json:"folder"`
}

A command of a program icebath installed, linked into a folder of commands on PATH so every program finds it

func (Link) Path

func (l Link) Path() string

File of the link: a link to the program, or on Windows a command file that runs it

type Locked

type Locked struct {
	Name    string       `json:"name"`
	Version string       `json:"version"`
	Marker  string       `json:"marker,omitempty"`
	Index   string       `json:"index,omitempty"`
	Wheels  []LockedFile `json:"wheels,omitempty"`
	Sdist   *LockedFile  `json:"sdist,omitempty"`
}

One locked package of a resolution

type LockedFile

type LockedFile struct {
	URL    string `json:"url"`
	SHA256 string `json:"sha256"`
}

type Newer

type Newer struct {
	Name string
	// Version pinned now, empty when none is, and the newest upstream offers
	Pinned, Newest string
	// Upstream rebuilt the version pinned, so it stays and takes the newer downloads
	Rebuilt bool
	// Why its newest version could not be found, empty when it was
	Failure string
}

What an update would move one package to

type Package

type Package struct {
	Name string
	// What it does, as a person reads it, and the feature that needs it, the heading it is listed under; every package but an internal one
	// says both
	About, Feature string
	// Ecosystem OSV tracks the releases of the program in, such as PyPI or crates.io, and its name there, the program's own name when
	// empty, which the security audit asks about the version installed; none for a program OSV does not track
	Ecosystem, Project string
	// Packages installed before it, on every target and on some only
	Deps       []string
	TargetDeps map[string][]string
	// Installed only when asked for by name or by a feature that needs it
	Optional bool
	// Installed with the required ones though optional, unless the person removed it
	Default bool
	// Tooling of icebath itself: never listed among the programs nor put on the user's PATH
	Internal bool
	// Adds no folder to PATH
	OffPath bool
	// Commands of it linked into the folder of commands every program's PATH holds, by the names they have among the folders it adds to
	// PATH, such as python3: in the image always, elsewhere while the settings ask for it
	Linked []string
	// File the container image of icebath writes the path of the program of it into, as it lays the program out at build: in the image that
	// program is the one features run, pinned, and the package manager never installs, updates or removes it there
	Baked string
	// Why there is no build of it for a target, Android standing for every target of Termux
	Gaps map[string]string
	// "minor" when an update compares versions by major and minor only, semver otherwise
	Style string
	// Targets running a binary of another architecture under emulation
	Emulated []string
	// Version and archives every target installs, which the user's pins in the package manager's lock override
	Pin Pin
	// Addresses of the archives of a version for a target, in extraction order
	URLs func(version, target string) ([]string, error)
	// Newest first versions upstream offers for a target, asked with the variables of the profile whose update it is, nil for a package
	// pinned by hand
	Latest func(cfg *config.Config, target, locked string) ([]string, error)
	// Digest upstream publishes for an archive, asked with the variables of the profile whose update it is, empty when it publishes none and
	// the archive is hashed instead
	Digest func(cfg *config.Config, version, url string) (string, error)
	// Store entry of a version, name-version-target when nil
	Entry func(version, target string) string
	// Binary relative to the entry, by exact target, else by "win32" or "posix"
	Binary map[string]string
	// Finds the binary when its place in the entry isn't fixed, in place of Binary
	Locate func(entry, target string) string
	// Keeps the archive's own top folder rather than hoisting a lone one
	Nested bool
	// Arguments of the smoke run of the binary on this machine, --version when nil
	Probe []string
	// No smoke run, the binary only checked to be there and of the target's architecture
	NoProbe bool
	// Environment of the smoke run, the installed dependencies' over the variables of this machine when nil
	ProbeEnv func() map[string]string
	// Smoke run from the binary's own folder
	ProbeHere bool
	// Package of Termux's repository serving every target of Termux, its closure planned on the phone
	Termux *Termux
	// Turns one downloaded archive into the staged tree, extraction by file name when nil
	Unpack func(b *Build, archive string) error
	// Readies the staged tree once every archive is in, hoisting a lone top folder when nil
	Stage func(b *Build) error
	// Why an entry does not work on the target, empty when it does; standard runs the usual checks
	Verify func(entry, target string, standard func() string) string
	// Fixes what made a fresh entry fail its checks, returning the checks' new verdict and a remedy for what it could not fix
	Repair func(ctx context.Context, h *Packages, r Reporter, entry, target, reason string) (string, string)
	// Variables the entry gives the programs that use it, its binary's folder on PATH when nil
	Env func(entry, target string) Env
}

A tool or runtime a feature needs, and how the archives of its pin become a working store entry

func (*Package) Missing

func (p *Package) Missing(target string) string

Why there is no build for the target, empty when there is one. A target of Termux the declarations pin nothing for, such as Termux on a 32 bit phone, has a build only from Termux's repository or among the archives every target shares

type Packages

type Packages struct {
	Registry
	// contains filtered or unexported fields
}

The store of pinned tools and the Python environments of this machine

func New

func New(cfg *config.Config) *Packages

func (*Packages) Carried

func (h *Packages) Carried() []string

Packages of this computer each of whose archives the folder of archives holds, which install with no network

func (*Packages) Check

func (h *Packages) Check(ctx context.Context, cfg *config.Config, names []string, r Reporter) (bool, error)

Checks the programs and Python sets of the names, else every installed one, installing again what lost its files, fails its checks, changed since it installed or stands at another version than its pin; with no names it also builds again the Python environments of the profile's features that no longer run and deletes damaged Python downloads. Whether everything checked works now

func (*Packages) Clean

func (h *Packages) Clean(ctx context.Context, cfg *config.Config, r Reporter) (bool, error)

Removes store entries, archives and partials nothing refers to, and generations superseded a day ago or more of the Python sets and of the side environments of the profile's features; whether it worked

func (*Packages) Closures

func (h *Packages) Closures() []Closure

Programs installed from Termux's repository on this phone, by name; none elsewhere

func (*Packages) Dependencies

func (h *Packages) Dependencies(cfg *config.Config) ([]Dependency, error)

Every package of an ecosystem OSV tracks that is installed for the features of the profile, read from the files of the store, of the environments and of the Node folders without running anything: the programs that say where OSV tracks them, the distributions of every Python set installed and of the profile's side environments, and the Node packages of the folders its features installed

func (*Packages) Download

func (h *Packages) Download(env httpx.Env, sources []Source) *Download

Download through the package manager's partials, its requests made in the environment of the profile the files are fetched for

func (*Packages) Ensure

func (h *Packages) Ensure(ctx context.Context, cfg *config.Config, name string, opts Ensuring) (*Runner, error)

Makes a package and what it needs match their pins, installing what is missing when allowed with its downloads made in the profile's environment, and returns its runner. The profile of the settings uses it from then on, which keeps it on this computer while it does

func (*Packages) Env

func (h *Packages) Env(names []string) map[string]string

Variables the installed packages of the names give their programs, every package's when none are named, never this process's

func (*Packages) EnvFor

func (h *Packages) EnvFor(names []string, base map[string]string) map[string]string

Environment of installed packages and what they need over base, the variables of this machine alone when nil, never installing and skipping what is missing

func (*Packages) Environment

func (h *Packages) Environment(ctx context.Context, cfg *config.Config, opts EnvironmentOptions) (string, error)

Makes a named isolated environment of the profile hold the requirements, reusing the generation that already does, and returns its interpreter

func (*Packages) ExtraModule

func (h *Packages) ExtraModule(extra, module string) (string, bool)

Folder of a Python package installed in a provisioned extra's environment, such as the one a native library ships in; false when the extra is not provisioned or holds no such package

func (*Packages) ExtraPython

func (h *Packages) ExtraPython(name string) (string, bool)

Interpreter of a provisioned extra, false when it is unknown or not provisioned

func (*Packages) ExtraStates

func (h *Packages) ExtraStates() ([]ExtraState, error)

How every declared extra stands on this machine, read without running anything: the extras worked out again and the pins read once for all of them

func (*Packages) ExtraTitle

func (h *Packages) ExtraTitle(name string) string

What a person calls an extra, its name for one no feature declares

func (*Packages) ExtraUnsupported

func (h *Packages) ExtraUnsupported(name string) (string, bool)

Why an extra can't be installed on this machine, empty when it can; false for an extra no feature declares

func (*Packages) Failed

func (h *Packages) Failed(err error) (string, bool)

Message of a failure that left an operation: an install failure, or the state folder this user cannot write

func (*Packages) Fetched

func (h *Packages) Fetched() []string

Folders of what the package manager fetched and built, which it fetches and builds again when asked: the store of programs, the downloads not finished, the cache of uv, the indexes of Termux's repository and the environments of the Python sets. The pins and the choices stay with the settings

func (*Packages) GitBash

func (h *Packages) GitBash() string

Bash of the package manager's Git for Windows, the shell commands run with on Windows; empty elsewhere or when it is not installed

func (*Packages) History

func (h *Packages) History(cfg *config.Config) []*Receipt

Past runs a profile started, newest first; a receipt that does not read is left out

func (*Packages) Install

func (h *Packages) Install(ctx context.Context, cfg *config.Config, a InstallArgs, r Reporter) (bool, error)

Installs programs and Python sets by name for the profile of the settings, or with none the programs icebath needs and the defaults the profile did not remove; the profile uses what installed from then on. Whether every one installed

func (*Packages) InstallHint

func (h *Packages) InstallHint(extra string) string

Sentence telling a person where to install an extra, naming it as they know it

func (*Packages) Installed

func (h *Packages) Installed(name string, outdated bool) (*Installed, error)

The entry of an installed package at its current pin, an earlier one when allowed; nil when it is not installed, never installing

func (*Packages) Keepings

func (h *Packages) Keepings(cfg *config.Config) []Keeping

Every keeping of the features

func (*Packages) LazyAllowed

func (h *Packages) LazyAllowed(cfg *config.Config) bool

Whether the profile lets features install what they need the first time they use it: ICEBATH_DISABLE_LAZY_INSTALLS turns that off for every profile

func (*Packages) Linking

func (h *Packages) Linking() bool

Whether the commands of the programs are to be linked onto PATH: always in the image, elsewhere while the settings ask for it

func (h *Packages) Links() []Link

The links made, as last kept

func (*Packages) List

func (h *Packages) List(cfg *config.Config) ([]Program, error)

Every program and Python set a person can install with how each stands and what the profile of the settings chose of it, read once without running, hashing or changing anything

func (*Packages) Log

func (h *Packages) Log(cfg *config.Config, path string) (string, error)

Whole output of a failed step from its log, refusing a file outside the logs folder of the profile

func (*Packages) Lost

func (h *Packages) Lost(name string) string

Why a program the image pins can't run: it is gone from where the image laid it out, as when a volume is mounted over it; empty when it is there, and for a package the image does not pin

func (*Packages) Missing

func (h *Packages) Missing(name string) (string, error)

Why there is no build of a package for this machine, empty when there is one

func (*Packages) Names

func (h *Packages) Names() []string

Names of every declared package, sorted

func (*Packages) OnPath

func (h *Packages) OnPath(path string, env map[string]string) string

First Python 3.8 or newer on the search path, probed with the environment

func (*Packages) Package

func (h *Packages) Package(name string) (*Package, error)

Declaration of a package

func (*Packages) Path

func (h *Packages) Path(path string) string

PATH for the user's own commands: the folders of the installed packages behind the user's entries, so a tool the user installed wins, and the package manager's Python just before the Windows Store alias folder whose python only opens the Store

func (*Packages) Pin

func (h *Packages) Pin(ctx context.Context, cfg *config.Config, name, version string, r Reporter) (bool, error)

Pins a package to a version on this computer, whose pins are its own, and installs that version when the package is installed, or with no version puts back the version this build pins, on a phone the build Termux's repository serves; for a Python set worked out again for newer packages, no version puts back the packages this build pins. Pinning Python works the Python sets out again for its version, the pin put back when they can't be. Every profile of this computer runs the version pinned, as they share the one copy of each program. Whether all of it worked

func (*Packages) Pinned

func (h *Packages) Pinned(name string) (string, bool)

Program the image of icebath laid out at build for the package and pins, as the file the package names says; false outside the image, for a package that names no such file, and in an image that wrote none

func (*Packages) Program

func (h *Packages) Program(ctx context.Context, cfg *config.Config, name, command string, install bool) string

Program a feature runs for the profile: the one of the command's name on the search path of the profile's commands, which it runs with, else the package's in the store, else, when asked and the profile allows installs on demand, the package installed now. Empty when there is none. An answer that installs nothing is kept for programKept, one lookup of it made at a time, and forgotten once anything installs or removes a program

func (*Packages) Provide

func (h *Packages) Provide(ctx context.Context, cfg *config.Config, name string) (string, error)

Installs a package as a person asked, its entry hashed again and repaired, and answers its program

func (*Packages) ProvisionExtra

func (h *Packages) ProvisionExtra(ctx context.Context, cfg *config.Config, name string, r Reporter) (string, error)

Provisions an extra in its own environment, the steps told to the person, and returns its interpreter; a feature switched on runs it

func (*Packages) Python

func (h *Packages) Python(ctx context.Context, cfg *config.Config, env map[string]string, needs string) (string, error)

Python 3.8 or newer that runs what the caller needs, such as "browser_exec runs Python code": the first on the environment's PATH, else icebath's own, installed when missing and the profile allows it

func (*Packages) PythonTool

func (h *Packages) PythonTool(cfg *config.Config, name, executable string) (string, bool, error)

Program a named side environment of the profile installed beside the interpreter of its selected generation, never installing; false when the environment or the program is not there

func (*Packages) RecordTree

func (h *Packages) RecordTree(cfg *config.Config, dir string) error

Records a folder holding a package.json whose Node dependencies a feature of the profile installed with the package manager's npm, so an update of everything in the profile refreshes them; under the record's lock, by every process of the machine

func (*Packages) Register

func (h *Packages) Register(registrant Registrant)

Adds a registrant; a registry nested in the host reaches it through Host

func (*Packages) Remove

func (h *Packages) Remove(ctx context.Context, cfg *config.Config, names []string, r Reporter) (bool, error)

Removes programs and Python sets from the profile of the settings: the profile stops using each, its installs skipping a default it removed until it installs it again by name, and what no other profile uses is deleted from this computer; whether every one was removed

func (*Packages) RemoveExtra

func (h *Packages) RemoveExtra(ctx context.Context, name string) error

Deletes an extra's environment under its install lock, so a build of it in another process finishes first rather than losing its tree midway; the lock file stays for the next build to take

func (*Packages) Shipped

func (h *Packages) Shipped() map[string]Installed

The programs the image pins, by package, each with its program and the version this build pins for it

func (*Packages) Spawning

func (h *Packages) Spawning(env func(cfg *config.Config, extra map[string]string) map[string]string)

Names how the environment of a program the package manager runs for a profile is made, such as uv installing the profile's Python packages or npm updating the Node packages of its features: as the terminal makes its commands', the profile's own variables with the credentials no command sees left out

func (*Packages) Stored

func (h *Packages) Stored(ctx context.Context, cfg *config.Config, name string, install bool) (string, error)

File of the package in the store a feature uses, such as a library it loads that no search path holds: the one installed, else, when asked and the profile allows installs on demand, the package installed now; why there is none when there is none

func (*Packages) Sudoing

func (h *Packages) Sudoing(sudo func(ctx context.Context, cfg *config.Config, argv []string) ([]string, string, error))

Names what runs a program with sudo as it can run here, such as the install of a library Node needs from the distribution, asking the sudo password of whoever sits at a window where sudo needs one

func (*Packages) Trouble

func (h *Packages) Trouble() []string

What the last look at the links found wrong, none when everything stands

func (*Packages) UVLauncher

func (h *Packages) UVLauncher(name string) (string, error)

Installed uv or uvx launcher, empty when uv is not installed

func (h *Packages) Unlink(ctx context.Context) error

Removes every link icebath made of the commands of the programs, as an uninstall does

func (*Packages) Unlinked

func (h *Packages) Unlinked() []string

What keeps the commands of the programs from standing on PATH as they should, read without changing anything, each a whole sentence: a program whose commands can't be found, a command not linked, a file icebath did not make in its place. None while they are not to be linked

func (*Packages) Update

func (h *Packages) Update(ctx context.Context, cfg *config.Config, names []string, r Reporter) (bool, error)

Moves the packages of the names to the newest versions upstream offers and installs them, and works the Python sets of the names out again for the newest packages they allow; with no names every package a person can update, then the Python sets built with older versions than icebath pins now, the Python environments and the Node packages the profile's features installed. Whether all of it worked

func (*Packages) Updates

func (h *Packages) Updates(ctx context.Context, cfg *config.Config, names []string) (*Plan, error)

Looks up what an update of the names would do, changing nothing; with no names every package a person can update and the Python and Node packages the profile's features installed. The lookups upstream stop with the context

func (*Packages) Upkeep

func (h *Packages) Upkeep(ctx context.Context) []string

One look at what the package manager keeps right while icebath runs: in the image, the programs whose archives it carries installed with no network when they are not; the commands of the programs linked onto PATH while they are to be, a link put right whose program moved, and those it made removed once their program went, their folder changed or the links are no longer wanted. The problems it found, which are kept for Trouble

func (*Packages) Usable

func (h *Packages) Usable(python string, env map[string]string) bool

Whether the interpreter is Python 3.8 or newer, probed in the environment it runs in, the variables of this machine alone when nil, and a probe that could not run remembered as neither

func (*Packages) UseExtra

func (h *Packages) UseExtra(ctx context.Context, cfg *config.Config, name string) (string, error)

Interpreter of a Python set a feature of the profile runs its code in: the one installed, else installed now when the profile lets features download what they need; the profile's use of it recorded, so it stays on this computer while the profile uses it. The refusal says where to install it

type Pin

type Pin struct {
	Version   string              `json:"version"`
	Artifacts map[string]Archives `json:"artifacts"`
}

Version and archives of a package, by target in extraction order, "any" holding those every target shares

func (Pin) For

func (p Pin) For(target string) Archives

Archives of a target, those for every target when it has none of its own

type Plan

type Plan struct {
	// Packages that would move, and those whose newest version could not be found
	Packages []Newer
	// Python sets an update installs again, as a person calls them: those named, worked out again for the newest packages they allow, else
	// those built with older versions than icebath pins now
	Sets []string
	// Python packages the profile's features installed in environments of their own, moved to the newest their requirements allow
	Environments []string
	// Node packages the profile's features installed, updated in the folders they are in
	Node []string
}

What an update would do, changing nothing

type Program

type Program struct {
	Name, Title, About, Feature string
	Standing                    Standing
	// Why it can't be installed on this machine, empty when it can
	Unsupported string
	// A Python set rather than a program of its own: installed, updated and removed, never pinned to a version
	Python bool
	// Version installed, empty when none is; the one pinned, empty when there is none; and the one this build pins
	Version, Pinned, Build string
	// Installed only when asked for, and installed with the others though optional
	Optional, Default bool
	// A default the profile removed, which its installs skip
	Removed bool
	// The profile uses it: icebath needs it, it is a default the profile kept, or the profile installed it or a feature of it ran it
	Used bool
	// Another profile uses it, so removing it from this one keeps it on this computer
	Shared bool
	// A Python set worked out again for newer packages than this build pins
	Updated bool
	// What is installed that needs it, as a person calls each, which keeps it from being removed
	NeededBy []string
}

A program a person can install: a package, or a Python set a feature runs in, with how it stands on this computer, the feature that needs it and what the profile chose of it

type Progress

type Progress func(done, total int64, coverage []Coverage) error

Bytes done of every destination and their total, the last coverage being the destination that moved; an error stops the download

type Range

type Range struct{ Start, End int64 }

Half open byte interval

type Receipt

type Receipt struct {
	Schema  int       `json:"schema"`
	Kind    Kind      `json:"kind"`
	Started time.Time `json:"started"`
	// Zero when it did not finish
	Finished time.Time `json:"finished,omitzero"`
	OK       bool      `json:"ok"`
	// Programs it was about, every one when empty
	Names    []string `json:"names"`
	Steps    []Step   `json:"steps"`
	Warnings []string `json:"warnings"`
	// Why it refused to install something, empty when it did not
	Refusal string `json:"refusal,omitempty"`
	// contains filtered or unexported fields
}

Record of one run of the package manager: what it was about, each step, the warnings, any refusal and how it ended

type Registrant

type Registrant interface {
	Packages() []Package
	Extras() []Extra
}

What a feature needs on this machine: the tools it runs and the Python dependency sets it installs on request

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

func (*Registry) Extras

func (r *Registry) Extras() []Extra

func (*Registry) Host

func (r *Registry) Host() *Packages

Host the registry is nested in, through which features install, find and run their packages

func (*Registry) Packages

func (r *Registry) Packages() []Package

func (*Registry) Register

func (r *Registry) Register(registrant Registrant)

type Release

type Release struct {
	Tag    string
	Assets []string
}

One published release of a GitHub repository, with the names of its assets

func GitHubBuilds

func GitHubBuilds(cfg *config.Config, repo string, pages int) ([]Release, error)

Builds of up to pages pages of a GitHub repository, newest first as GitHub lists them, drafts left out: its releases with those marked prerelease, for a project that publishes every build as one

func GitHubReleases

func GitHubReleases(cfg *config.Config, repo string, pages int) ([]Release, error)

Releases of up to pages pages of a GitHub repository, newest first as GitHub lists them, drafts and prereleases left out

type Reporter

type Reporter interface {
	// A line of what happened, in its tone
	Line(text string, tone Tone)
	// What goes on now, shown in place of the last status until the next line; nobody sees it off a terminal
	Status(text string)
	// Whether a terminal shows the statuses, and how wide it is
	Terminal() (bool, int)
}

Where an operation tells the person what it does

type Runner

type Runner struct {
	Name string
	Env  map[string]string
}

A package installed with what it needs, and the environment its programs run in

func (*Runner) Command

func (r *Runner) Command(ctx context.Context, name string, args ...string) *exec.Cmd

Command run with the runner's environment, a bare name found on the runner's PATH

type Settle

type Settle func(ctx context.Context, cfg *config.Config, binary string, r Reporter) error

Readies an installed package for this machine once a person installed it, such as registering it with the system, telling the person what it does; a failure says what is left to do

type Settles

type Settles map[string]Settle

What readies some packages once a person installed them, by package, which the feature that runs them registers

func (Settles) Extras

func (Settles) Extras() []Extra

func (Settles) Packages

func (Settles) Packages() []Package

type Shown

type Shown struct {
	Title, About, Feature string
}

What a person calls a Python set, what it does and the feature that needs it, the heading it is listed under

type Source

type Source struct {
	URL       string
	Dest      string
	SHA256    string
	Fallbacks []string
	// Sent with every request for the file, such as the authorization a private repository of a hub asks for
	Headers map[string]string
}

One file of a download: where it comes from, where it goes, its pinned digest and the pinned mirrors that serve the same bytes

type StaleError

type StaleError struct{ Message string }

A pin another writer changed since this run read the file

func (*StaleError) Error

func (e *StaleError) Error() string

type Standing

type Standing int

Where a package or a Python set stands on this machine

const (
	// Not installed
	Absent Standing = iota
	// Installed as this build pins it
	Current
	// Installed at another version than its pin, or a Python set built with older pins
	Outdated
	// Recorded as installed, but its files are gone or no longer run
	Broken
	// No build of it for this machine
	Unsupported
)

type Step

type Step struct {
	// What a person calls what it was about
	Name string `json:"name"`
	OK   bool   `json:"ok"`
	// What happened, such as the version it moved to, or why it failed
	Detail string `json:"detail,omitempty"`
	// File holding the whole output of what failed, empty when there is none
	Log string    `json:"log,omitempty"`
	At  time.Time `json:"at"`
}

One thing a run did to one program or Python set

type Termux

type Termux struct {
	// Name of the package in Termux's repository, such as nodejs
	Package string
	// Program of it under Termux's prefix, such as bin/node
	Main string
}

Package of Termux's repository a package installs from on Android, with the whole closure of libraries its program needs, unpacked into the package's own entry by ar and tar, never by dpkg or its scripts

type Tone

type Tone int

How a line of what an operation did reads

const (
	TonePlain Tone = iota
	// The heading of a step
	ToneStep
	ToneGood
	ToneWarn
	ToneBad
	// Said by the way, such as where a file is
	ToneDim
)

type UnknownError

type UnknownError struct{ Name string }

A name no declaration carries

func (*UnknownError) Error

func (e *UnknownError) Error() string

type UnsafeMember

type UnsafeMember struct {
	Member string
	Reason string
}

Member refused because it would land outside the destination or is no file, folder or link

func (*UnsafeMember) Error

func (e *UnsafeMember) Error() string

Directories

Path Synopsis
Page of Programs in the settings menu: the programs and Python sets icebath downloads for its features, under the feature that needs each; installing, checking, updating, pinning and removing them, what past runs of the profile did, and the options of the profile the menu shows.
Page of Programs in the settings menu: the programs and Python sets icebath downloads for its features, under the feature that needs each; installing, checking, updating, pinning and removing them, what past runs of the profile did, and the options of the profile the menu shows.
The pm commands: install, check, update and remove the programs icebath keeps on the machine its server runs on, as Programs does
The pm commands: install, check, update and remove the programs icebath keeps on the machine its server runs on, as Programs does
Connect service of the package manager, through which the programs page and the pm commands reach the programs of the machine the server runs on
Connect service of the package manager, through which the programs page and the pm commands reach the programs of the machine the server runs on

Jump to

Keyboard shortcuts

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