Documentation ¶
Index ¶
- Constants
- func Resolve(imgDir string, pkgs []string, prune string) ([]string, error)
- func TrimArchiveSuffix(fn string) string
- type Ctx
- func (b *Ctx) Build(ctx context.Context, buildLog io.Writer) (*pb.Meta, error)
- func (b *Ctx) Builddeps(p *pb.Build) ([]string, error)
- func (b *Ctx) Builderdeps(p *pb.Build) []string
- func (b *Ctx) Clone() *Ctx
- func (b *Ctx) Digest() (string, error)
- func (b *Ctx) Download(fn string) error
- func (b *Ctx) Extract() error
- func (b *Ctx) FullName() string
- func (b *Ctx) Glob(imgDir string, pkgs []string) ([]string, error)
- func (b *Ctx) Glob1(imgDir, pkg string) (string, error)
- func (b *Ctx) GlobAndResolve(repo string, deps []string, prune string) ([]string, error)
- func (b *Ctx) Hash(fn string) (string, error)
- func (b *Ctx) MakeEmpty() error
- func (b *Ctx) Package() error
- func (b *Ctx) PkgSource() error
Constants ¶
const NT_GNU_BUILD_ID = 3
from binutils/include/elf/common.h
Variables ¶
This section is empty.
Functions ¶
func Resolve ¶
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 ¶
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 (*Ctx) Builderdeps ¶
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) GlobAndResolve ¶
GlobAndResolve is a convenience function to call Glob followed by Resolve.