builddeps

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AtomicReplaceDir

func AtomicReplaceDir(src, dest string) error

AtomicReplaceDir swaps dest with src by renaming src into place. If dest already exists, it is first moved aside and restored if the final rename fails. src must already exist on the same filesystem as dest.

func AtomicWriteFile

func AtomicWriteFile(path string, data []byte, perm os.FileMode) error

AtomicWriteFile writes content to path via a temp file in the same directory.

func Download

func Download(ctx context.Context, client *http.Client, url, destPath string) error

Download downloads url to destPath using the provided client.

func ExtractTarGz

func ExtractTarGz(archivePath, destDir string) error

ExtractTarGz extracts a .tar.gz archive into destDir.

func ExtractZip

func ExtractZip(archivePath, destDir string) error

ExtractZip extracts a .zip archive into destDir.

func GenerateLarkSkill

func GenerateLarkSkill(sourceSkillsDir, destDir, sourceRef string) error

func GitHubReleaseAssetURL

func GitHubReleaseAssetURL(repo, tag, file string) string

GitHubReleaseAssetURL builds the direct release asset URL for repo/tag/file.

func SyncEmbeddedTools

func SyncEmbeddedTools(ctx context.Context, cfg Config) error

SyncEmbeddedTools downloads and stores the embedded third-party binaries for the target platform. Downloads are integrity-checked only by HTTPS + GitHub's own release infrastructure; no additional SHA256 manifest is verified. This is acceptable for a dev-time build tool but should be revisited if this path ever runs with write access to a production artifact store.

func SyncSystemSkills

func SyncSystemSkills(ctx context.Context, cfg Config) error

Types

type Config

type Config struct {
	WorkDir string

	SyncSkills bool
	SyncTools  bool

	GOOS   string
	GOARCH string

	LarkRef string
}

Config describes one pre-build third-party dependency sync run.

func (Config) Normalized

func (c Config) Normalized() Config

Normalized returns a copy with runtime defaults filled in.

func (Config) Platform

func (c Config) Platform() string

Platform returns the target platform key used by embedded binaries.

func (Config) Validate

func (c Config) Validate() error

Validate checks that the sync request is internally consistent.

type SkillSyncFunc

type SkillSyncFunc func(context.Context, Config) error

SkillSyncFunc performs host-side skill synchronization.

type Syncer

type Syncer struct {
	SyncSkills SkillSyncFunc
	SyncTools  ToolSyncFunc
}

Syncer orchestrates pre-build dependency sync phases.

func (Syncer) Run

func (s Syncer) Run(ctx context.Context, cfg Config) error

Run normalizes cfg (filling in runtime GOOS/GOARCH/WorkDir defaults), validates it, and executes the selected sync phases. Sync funcs receive the already-normalized Config.

type ToolSyncFunc

type ToolSyncFunc func(context.Context, Config) error

ToolSyncFunc performs target-specific embedded binary synchronization.

Jump to

Keyboard shortcuts

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