build

package
v0.0.0-...-ef90cfb Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: BSD-3-Clause Imports: 47 Imported by: 0

Documentation

Index

Constants

View Source
const NT_GNU_BUILD_ID = 3

from binutils/include/elf/common.h

Variables

This section is empty.

Functions

func Resolve

func Resolve(imgDir string, pkgs []string, prune string) ([]string, error)

resolve returns the transitive closure of runtime dependencies for the specified packages.

E.g., if iptables depends on libnftnl, which depends on libmnl, resolve("iptables") will return ["iptables", "libnftnl", "libmnl"].

TODO: remove this recursion: runtime deps are stored fully resolved

func TrimArchiveSuffix

func TrimArchiveSuffix(fn string) string

TrimArchiveSuffix removes file extensions such as .tar, .gz, etc.

Types

type Ctx

type Ctx struct {
	Proto     *pb.Build `json:"-"`
	PkgDir    string    // e.g. /home/michael/distri/pkgs/busybox
	Pkg       string    // e.g. busybox
	Arch      string    // e.g. amd64
	Version   string    // e.g. 1.29.2
	SourceDir string    // e.g. /home/michael/distri/build/busybox/busybox-1.29.2
	BuildDir  string    // e.g. /tmp/distri-build-8123911
	DestDir   string    // e.g. /tmp/distri-dest-3129384/tmp
	Prefix    string    // e.g. /ro/busybox-1.29.2
	Hermetic  bool
	// Debug is one of after-steps, after-install, after-wrapper,
	// after-loopmount, after-elf, after-libfarm
	Debug       string
	FUSE        bool
	ChrootDir   string // only set if Hermetic is enabled
	Jobs        int
	InputDigest string // opaque result of digest()
	Repo        string

	ArtifactWriter io.Writer                                `json:"-"`
	GlobHook       func(imgDir, pkg string) (string, error) `json:"-"`
	// contains filtered or unexported fields
}

Ctx is a build context: it contains state about a build.

func NewCtx

func NewCtx() (*Ctx, error)

func (*Ctx) Build

func (b *Ctx) Build(ctx context.Context, buildLog io.Writer) (*pb.Meta, error)

func (*Ctx) Builddeps

func (b *Ctx) Builddeps(p *pb.Build) ([]string, error)

Builddeps globs and resolves Builderdeps() and proto build dependencies.

func (*Ctx) Builderdeps

func (b *Ctx) Builderdeps(p *pb.Build) []string

Builderdeps returns specified builder’s (e.g. cmake builder, or perl builder) dependencies. E.g., the Go builder declares a dependency on golang.

Almost all builders include the C builder’s dependencies, as most languages have a C interface.

func (*Ctx) Clone

func (b *Ctx) Clone() *Ctx

func (*Ctx) Digest

func (b *Ctx) Digest() (string, error)

func (*Ctx) Download

func (b *Ctx) Download(fn string) error

func (*Ctx) Extract

func (b *Ctx) Extract() error

func (*Ctx) FullName

func (b *Ctx) FullName() string

func (*Ctx) Glob

func (b *Ctx) Glob(imgDir string, pkgs []string) ([]string, error)

func (*Ctx) Glob1

func (b *Ctx) Glob1(imgDir, pkg string) (string, error)

func (*Ctx) GlobAndResolve

func (b *Ctx) GlobAndResolve(repo string, deps []string, prune string) ([]string, error)

GlobAndResolve is a convenience function to call Glob followed by Resolve.

func (*Ctx) Hash

func (b *Ctx) Hash(fn string) (string, error)

func (*Ctx) MakeEmpty

func (b *Ctx) MakeEmpty() error

func (*Ctx) Package

func (b *Ctx) Package() error

func (*Ctx) PkgSource

func (b *Ctx) PkgSource() error

Jump to

Keyboard shortcuts

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