Documentation
¶
Overview ¶
Package toolenv prepares retained, version-isolated packages and native build environments. Preparation never changes the worker's process environment.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Diagnostics ¶
type Diagnostics struct {
TaskOrdinal *int64 `json:"task_ordinal,omitempty"`
WallMS int64 `json:"wall_ms"`
Tools []ToolDiagnostic `json:"tools,omitempty"`
Error string `json:"error,omitempty"`
Repository *RepositoryDiagnostic `json:"repository,omitempty"`
Native *NativeDiagnostic `json:"native,omitempty"`
}
type Environment ¶
type Environment struct {
Path string `json:"path"`
Tools []Tool `json:"tools"`
Variables map[string]string `json:"variables,omitempty"`
Native *nativeEnvironment `json:"native,omitempty"`
}
func (Environment) Bind ¶ added in v0.0.108
func (e Environment) Bind(ctx context.Context) context.Context
Bind applies both executable selection and native activation to one op.
func (Environment) Ready ¶
func (e Environment) Ready() bool
Ready is strictly local and read-only. False means return to setup, never install or resolve a package inside the task's execution budget.
type Manager ¶
type Manager struct{ Root string }
Manager owns only a local cache. Providers can retain/mount Root at the same absolute path. Package managers and their runtimes must exist in the base.
func (*Manager) Prepare ¶
func (m *Manager) Prepare(ctx context.Context, scopes []Scope) (env Environment, diag Diagnostics, err error)
Prepare resolves each declaration on first use, sharing completed entries across scopes/invocations. No manager runs on a warm hit.
func (*Manager) PrepareNixPackage ¶
func (m *Manager) PrepareNixPackage(ctx context.Context, p NixPackage) (root string, reused bool, err error)
PrepareNixPackage realizes only the pinned output, with a retained GC root. It never re-evaluates the original selector or builds missing outputs.
type NativeDiagnostic ¶ added in v0.0.108
type NixPackage ¶
type NixPackage struct {
StorePath string `json:"store_path"`
System string `json:"system"`
Manifest json.RawMessage `json:"manifest"`
}
NixPackage is evaluation metadata, not an installed package. StorePath pins realization to exactly the output described by Manifest, even if a ref moves.
func DescribeNixPackage ¶
func DescribeNixPackage(ctx context.Context, reference, baseDir string) (*NixPackage, error)
DescribeNixPackage evaluates passthru.c2j and the output identity together. Import-from-derivation is forbidden: metadata inspection cannot realize code.
func (NixPackage) Validate ¶
func (p NixPackage) Validate() error
type RepositoryDiagnostic ¶ added in v0.0.108
type RepositoryDiagnostic struct {
config.PackageSource
Scope string `json:"scope"`
Repository string `json:"repository,omitempty"`
Snapshot string `json:"snapshot,omitempty"`
}