inspect

package
v0.21.3 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package inspect walks installed gale packages and reports linkage issues: unresolvable @rpath references, stale rpath entries, and mismatches between a binary's dep references and its recipe's declared deps.

Pure read-only. No state changes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Issue

type Issue struct {
	Kind    Kind   `json:"kind"`
	Package string `json:"package"`
	Version string `json:"version"`
	Binary  string `json:"binary,omitempty"`
	Details string `json:"details,omitempty"`
}

Issue describes one linkage problem found in an installed package.

func ScanInstalled

func ScanInstalled(
	prefix, name, version string, r *recipe.Recipe,
) ([]Issue, error)

ScanInstalled scans one installed package. r may be nil, in which case checks that require the recipe (undeclared-dep, over-declared-dep) are skipped.

prefix is the install directory (e.g. ~/.gale/pkg/curl/8.19.0). name and version are used only for populating Issue fields.

type Kind

type Kind string

Kind identifies a type of linkage issue.

const (
	// KindUnresolvableRef means a binary references
	// @rpath/libX and no rpath entry resolves to an
	// existing libX file.
	KindUnresolvableRef Kind = "unresolvable-ref"

	// KindStaleRpath means an LC_RPATH or RUNPATH entry
	// points to a path that does not exist.
	KindStaleRpath Kind = "stale-rpath"

	// KindUndeclaredDep means a binary references a gale
	// store dir for package X, but X is not listed in the
	// recipe's [dependencies] build or runtime.
	KindUndeclaredDep Kind = "undeclared-dep"

	// KindOverDeclaredDep means the recipe declares a dep
	// that no binary under the install references via rpath.
	KindOverDeclaredDep Kind = "over-declared-dep"

	// KindVersionSkew means two binaries under the same
	// install reference different versions of the same
	// gale-managed dep.
	KindVersionSkew Kind = "version-skew"
)

func (Kind) Severity

func (k Kind) Severity() string

Severity groups issue kinds by severity.

Jump to

Keyboard shortcuts

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