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
- Variables
- func CurrentTarget() string
- func Extract(archive, dest string) error
- func Fetch(cfg *config.Config, rawURL string) ([]byte, error)
- func Flatten(dest string) error
- func GitHubDigests(cfg *config.Config, repo, tag string) (map[string]string, error)
- func GitHubTags(cfg *config.Config, repo, strip string) ([]string, error)
- func InImage() bool
- func IsDownload(err error, kind DownloadKind) bool
- func Keep(cfg *config.Config, step, output string) string
- func Kept(cfg *config.Config) []string
- func LinkFolder() string
- func Lookup(name string, env map[string]string) string
- func Merge(src, dst string) error
- func NodeModules(tree string) [][2]string
- func NpmLatest(cfg *config.Config, name string) (string, error)
- func OnAndroid(target string) bool
- func Pins(data []byte) map[string]Pin
- func Present(bin, entry, target string) string
- func PythonNames() []string
- func Which(name, path string) string
- func WithConsent(ctx context.Context, ask Consent) context.Context
- type Archives
- type Artifact
- type Build
- type Closure
- type ConflictError
- type Consent
- type Coverage
- type Declared
- type Dependency
- type Download
- type DownloadError
- type DownloadKind
- type Ensuring
- type Env
- type EnvironmentOptions
- type Extra
- type ExtraState
- type HTTPError
- type Index
- type InstallArgs
- type InstallError
- type Installed
- type Keeper
- type Keeping
- type Kind
- type Link
- type Locked
- type LockedFile
- type Newer
- type Package
- type Packages
- func (h *Packages) Carried() []string
- func (h *Packages) Check(ctx context.Context, cfg *config.Config, names []string, r Reporter) (bool, error)
- func (h *Packages) Clean(ctx context.Context, cfg *config.Config, r Reporter) (bool, error)
- func (h *Packages) Closures() []Closure
- func (h *Packages) Dependencies(cfg *config.Config) ([]Dependency, error)
- func (h *Packages) Download(env httpx.Env, sources []Source) *Download
- func (h *Packages) Ensure(ctx context.Context, cfg *config.Config, name string, opts Ensuring) (*Runner, error)
- func (h *Packages) Env(names []string) map[string]string
- func (h *Packages) EnvFor(names []string, base map[string]string) map[string]string
- func (h *Packages) Environment(ctx context.Context, cfg *config.Config, opts EnvironmentOptions) (string, error)
- func (h *Packages) ExtraModule(extra, module string) (string, bool)
- func (h *Packages) ExtraPython(name string) (string, bool)
- func (h *Packages) ExtraStates() ([]ExtraState, error)
- func (h *Packages) ExtraTitle(name string) string
- func (h *Packages) ExtraUnsupported(name string) (string, bool)
- func (h *Packages) Failed(err error) (string, bool)
- func (h *Packages) Fetched() []string
- func (h *Packages) GitBash() string
- func (h *Packages) History(cfg *config.Config) []*Receipt
- func (h *Packages) Install(ctx context.Context, cfg *config.Config, a InstallArgs, r Reporter) (bool, error)
- func (h *Packages) InstallHint(extra string) string
- func (h *Packages) Installed(name string, outdated bool) (*Installed, error)
- func (h *Packages) Keepings(cfg *config.Config) []Keeping
- func (h *Packages) LazyAllowed(cfg *config.Config) bool
- func (h *Packages) Linking() bool
- func (h *Packages) Links() []Link
- func (h *Packages) List(cfg *config.Config) ([]Program, error)
- func (h *Packages) Log(cfg *config.Config, path string) (string, error)
- func (h *Packages) Lost(name string) string
- func (h *Packages) Missing(name string) (string, error)
- func (h *Packages) Names() []string
- func (h *Packages) OnPath(path string, env map[string]string) string
- func (h *Packages) Package(name string) (*Package, error)
- func (h *Packages) Path(path string) string
- func (h *Packages) Pin(ctx context.Context, cfg *config.Config, name, version string, r Reporter) (bool, error)
- func (h *Packages) Pinned(name string) (string, bool)
- func (h *Packages) Program(ctx context.Context, cfg *config.Config, name, command string, install bool) string
- func (h *Packages) Provide(ctx context.Context, cfg *config.Config, name string) (string, error)
- func (h *Packages) ProvisionExtra(ctx context.Context, cfg *config.Config, name string, r Reporter) (string, error)
- func (h *Packages) Python(ctx context.Context, cfg *config.Config, env map[string]string, needs string) (string, error)
- func (h *Packages) PythonTool(cfg *config.Config, name, executable string) (string, bool, error)
- func (h *Packages) RecordTree(cfg *config.Config, dir string) error
- func (h *Packages) Register(registrant Registrant)
- func (h *Packages) Remove(ctx context.Context, cfg *config.Config, names []string, r Reporter) (bool, error)
- func (h *Packages) RemoveExtra(ctx context.Context, name string) error
- func (h *Packages) Shipped() map[string]Installed
- func (h *Packages) Spawning(env func(cfg *config.Config, extra map[string]string) map[string]string)
- func (h *Packages) Stored(ctx context.Context, cfg *config.Config, name string, install bool) (string, error)
- func (h *Packages) Sudoing(...)
- func (h *Packages) Trouble() []string
- func (h *Packages) UVLauncher(name string) (string, error)
- func (h *Packages) Unlink(ctx context.Context) error
- func (h *Packages) Unlinked() []string
- func (h *Packages) Update(ctx context.Context, cfg *config.Config, names []string, r Reporter) (bool, error)
- func (h *Packages) Updates(ctx context.Context, cfg *config.Config, names []string) (*Plan, error)
- func (h *Packages) Upkeep(ctx context.Context) []string
- func (h *Packages) Usable(python string, env map[string]string) bool
- func (h *Packages) UseExtra(ctx context.Context, cfg *config.Config, name string) (string, error)
- type Pin
- type Plan
- type Program
- type Progress
- type Range
- type Receipt
- type Registrant
- type Registry
- type Release
- type Reporter
- type Runner
- type Settle
- type Settles
- type Shown
- type Source
- type StaleError
- type Standing
- type Step
- type Termux
- type Tone
- type UnknownError
- type UnsafeMember
Constants ¶
const ( Python = "python" UV = "uv" Node = "node" NPM = "npm" Git = "git" GH = "gh" )
Packages the host itself runs on, declared by it
const Android = "android"
Key of a package's gaps standing for every target of Termux
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
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
const RuntimeDirEnv = "ICEBATH_RUNTIME_DIR"
Environment variable pointing a process at another tool store, such as the one an image ships
Variables ¶
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
var Musl = map[string]bool{"linux-x64-musl": true, "linux-arm64-musl": true}
Linux userlands on musl
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
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 ¶
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 ¶
Body of an upstream index page a package's newest versions are read from, remembered within one operation
func Flatten ¶
Hoists the contents of a lone top folder unless the folder is the layout itself, leaving everything when a name would collide
func GitHubDigests ¶
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 ¶
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 ¶
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 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 ¶
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 NodeModules ¶
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 ¶
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 Pins ¶
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 PythonNames ¶
func PythonNames() []string
Names the interpreter goes by on PATH, in the order they are looked for
Types ¶
type Archives ¶
type Archives []Artifact
Archives of one target, written as one object when there is only one
func (Archives) MarshalJSON ¶
func (*Archives) UnmarshalJSON ¶
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) Entry ¶
Store entry of another installed package on the build's target, for a build that takes from it
func (*Build) NpmInstall ¶
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 Consent ¶
Consent asks whether a feature may install a program it lacks. It returns nil on a yes.
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
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
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 ¶
Variables an entry gives the programs that use it: folders put first on PATH and values set
func (Env) MarshalJSON ¶
func (*Env) UnmarshalJSON ¶
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
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 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 Link ¶
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
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 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
type Packages ¶
type Packages struct {
Registry
// contains filtered or unexported fields
}
The store of pinned tools and the Python environments of this machine
func (*Packages) Carried ¶
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 ¶
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 ¶
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 ¶
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 ¶
Variables the installed packages of the names give their programs, every package's when none are named, never this process's
func (*Packages) EnvFor ¶
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 ¶
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 ¶
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 ¶
What a person calls an extra, its name for one no feature declares
func (*Packages) ExtraUnsupported ¶
Why an extra can't be installed on this machine, empty when it can; false for an extra no feature declares
func (*Packages) Failed ¶
Message of a failure that left an operation: an install failure, or the state folder this user cannot write
func (*Packages) Fetched ¶
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 ¶
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 ¶
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 ¶
Sentence telling a person where to install an extra, naming it as they know it
func (*Packages) Installed ¶
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) LazyAllowed ¶
LazyAllowed reports whether a feature may install a missing program on first use.
func (*Packages) Linking ¶
Whether the commands of the programs are to be linked onto PATH: always in the image, elsewhere while the settings ask for it
func (*Packages) List ¶
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 ¶
Whole output of a failed step from its log, refusing a file outside the logs folder of the profile
func (*Packages) Lost ¶
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 ¶
Why there is no build of a package for this machine, empty when there is one
func (*Packages) Path ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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 ¶
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) UVLauncher ¶
Installed uv or uvx launcher, empty when uv is not installed
func (*Packages) Unlink ¶
Removes every link icebath made of the commands of the programs, as an uninstall does
func (*Packages) Unlinked ¶
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 ¶
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 ¶
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 ¶
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 ¶
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
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
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 ¶
Bytes done of every destination and their total, the last coverage being the destination that moved; an error stops the download
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 ¶
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) Host ¶
Host the registry is nested in, through which features install, find and run their packages
func (*Registry) Register ¶
func (r *Registry) Register(registrant Registrant)
type Release ¶
One published release of a GitHub repository, with the names of its assets
func GitHubBuilds ¶
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
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 Settle ¶
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 ¶
What readies some packages once a person installed them, by package, which the feature that runs them registers
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 UnknownError ¶
type UnknownError struct{ Name string }
A name no declaration carries
func (*UnknownError) Error ¶
func (e *UnknownError) Error() string
type UnsafeMember ¶
Member refused because it would land outside the destination or is no file, folder or link
func (*UnsafeMember) Error ¶
func (e *UnsafeMember) Error() string
Source Files
¶
- arch_other.go
- archive.go
- cache.go
- choices.go
- commands.go
- download.go
- extras.go
- fs.go
- fs_unix.go
- image.go
- index.go
- install.go
- installed.go
- interpreter.go
- kept.go
- links.go
- list.go
- lock.go
- markers.go
- network.go
- node.go
- package.go
- packages.go
- process.go
- program.go
- provisioned.go
- python.go
- receipts.go
- relock.go
- report.go
- runtimes.go
- sources.go
- store.go
- targets.go
- termux.go
- update.go
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 |