install

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: MIT Imports: 26 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

Package install downloads prebuilt libds4 release assets for the ds4go CLI.

Index

Constants

View Source
const (
	// MetadataFileName is the name of the JSON metadata file written
	// alongside libds4 to record what is installed.
	MetadataFileName = "ds4go-install.json"

	// KindRelease marks metadata for a prebuilt asset downloaded from
	// GitHub. An empty Kind is treated as release for back-compat with
	// metadata written before pinning existed.
	KindRelease = "release"

	// KindPinned marks metadata for a developer-supplied libds4 copied in
	// via `install --pin`.
	KindPinned = "pinned"
)
View Source
const (
	// DefaultRepo is the GitHub repository used for prebuilt libds4 binaries.
	DefaultRepo = "NimbleMarkets/ds4"
)

Variables

This section is empty.

Functions

func DefaultLibraryPath added in v0.7.0

func DefaultLibraryPath() string

DefaultLibraryPath is where `ds4go install` puts libds4 for this host: $DS4_DIR/lib or ~/.ds4/lib, with the platform's library file name.

func FindDirHolders added in v0.4.0

func FindDirHolders(dirPath string) (map[int][]string, error)

FindDirHolders finds processes holding any files under dirPath. It returns a map of PID to a list of file paths they hold under that directory.

func PrintCatalog added in v0.5.1

func PrintCatalog(out io.Writer, catalog *CatalogResult)

PrintCatalog writes a human-readable install catalog.

func Status added in v0.4.0

func Status(ctx context.Context, opts Options) error

Status finds and displays processes holding the library.

func Uninstall added in v0.3.0

func Uninstall(ctx context.Context, opts Options) error

Uninstall removes the installed libds4 shared library, sidecar, and metadata files from opts.DestDir.

func Validate added in v0.3.0

func Validate(ctx context.Context, opts Options) error

Types

type CatalogAsset added in v0.5.1

type CatalogAsset struct {
	Name     string `json:"name"`
	URL      string `json:"url"`
	Digest   string `json:"digest,omitempty"`
	GOOS     string `json:"goos,omitempty"`
	GOARCH   string `json:"goarch,omitempty"`
	Backend  string `json:"backend,omitempty"`
	Variant  string `json:"variant,omitempty"`
	Archive  string `json:"archive,omitempty"`
	Parsed   bool   `json:"parsed"`
	Selected bool   `json:"selected"`
}

CatalogAsset describes one installable libds4 release asset.

type CatalogResult added in v0.5.1

type CatalogResult struct {
	Repo    string         `json:"repo"`
	Version string         `json:"version"`
	Assets  []CatalogAsset `json:"assets"`
}

CatalogResult describes the libds4 release assets available for installation.

func Catalog added in v0.5.1

func Catalog(ctx context.Context, opts Options) (*CatalogResult, error)

Catalog fetches the selected GitHub release and lists available libds4 assets. Empty GOOS, GOARCH, and Backend fields mean no filter. Backend "auto" is also treated as no filter because the catalog is informational.

type InstallMetadata added in v0.3.0

type InstallMetadata struct {
	Kind      string `json:"kind,omitempty"`
	Repo      string `json:"repo,omitempty"`
	Version   string `json:"version,omitempty"`
	AssetName string `json:"asset_name,omitempty"`
	AssetURL  string `json:"asset_url,omitempty"`
	Source    string `json:"source,omitempty"`
	Backend   string `json:"backend"`
	Variant   string `json:"variant,omitempty"`
	GOOS      string `json:"goos"`
	GOARCH    string `json:"goarch"`
	Digest    string `json:"digest,omitempty"`
	SHA256    string `json:"sha256"`
	// ROCmArchs lists the AMD GPU architectures a ROCm library was
	// compiled for, as read from the library at install time. It is empty
	// for non-ROCm builds and when the library does not record its list.
	ROCmArchs   []string  `json:"rocm_archs,omitempty"`
	InstalledAt time.Time `json:"installed_at"`
}

InstallMetadata holds information about the installed libds4.

Kind discriminates between the supported install sources:

  • "release" (or "" for back-compat with metadata written by older ds4go versions): a prebuilt asset downloaded from GitHub. Repo/Version/ AssetName/AssetURL/Digest are populated.
  • "pinned": a developer-supplied file copied in via `install --pin`. Source holds the absolute path the file was copied from.

type LsofProcess added in v0.4.0

type LsofProcess struct {
	PID   int
	Name  string
	Files []string
}

LsofProcess represents a process and its open files parsed from lsof.

type Options

type Options struct {
	Repo    string
	Version string
	Backend string
	// Variant selects a hardware-specific build of a backend where the
	// release publishes one: "gb10" for the DGX Spark's linux-arm64-gb10-cuda
	// asset (sm_121a kernels), "sbsa" for the generic arm64 CUDA build, or ""
	// to detect. Only linux/arm64/cuda has variants today.
	Variant      string
	GOOS         string
	GOARCH       string
	DestDir      string
	URL          string
	Pin          string // local libds4 file to copy in and mark pinned
	Asset        string
	Token        string
	Force        bool
	DryRun       bool
	SkipChecksum bool
	Out          io.Writer
	ProgressOut  io.Writer
	HTTPClient   *http.Client
	In           io.Reader
	Confirm      func(prompt string, defaultYes bool) (bool, error)
}

Options configures a libds4 installation.

type ProcessInfo added in v0.4.0

type ProcessInfo struct {
	PID  int
	Name string
}

ProcessInfo represents a process holding or using a shared library.

func FindLibraryHolders added in v0.4.0

func FindLibraryHolders(libPath string) ([]ProcessInfo, error)

FindLibraryHolders finds all processes holding onto the library path.

type Result

type Result struct {
	Repo       string
	Version    string
	Backend    string
	Variant    string
	GOOS       string
	GOARCH     string
	AssetName  string
	AssetURL   string
	Library    string
	ChecksumOK bool
	DryRun     bool
}

Result describes the installed release asset.

func Run

func Run(ctx context.Context, opts Options) (*Result, error)

Run downloads, verifies when possible, and extracts a prebuilt libds4 asset.

Jump to

Keyboard shortcuts

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