Help us shape the future of Go! Take the 2026 Go Developer Survey

builder

package
v0.53.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HarnessEnv = "NFLOW_HARNESS"
	// HarnessFallbackExitCode is reserved for thin-harness refusal; workflow
	// execution must not return it because the CLI treats it as a retry request.
	HarnessFallbackExitCode = 125
)

HarnessEnv marks a process as running inside an external-module harness.

Variables

View Source
var (
	Version = "dev"
	Commit  = unknownValue
	BuiltAt = unknownValue
)

Functions

func EnsureHarness

func EnsureHarness(reqs []require.Requirement, flowPath ...string) (string, error)

func EnsureHarnessCLIContext added in v0.48.0

func EnsureHarnessCLIContext(ctx context.Context, reqs []require.Requirement, flowPath ...string) (string, error)

EnsureHarnessCLIContext builds the compatibility harness that delegates to the full CLI. It is used when the thin runner cannot preserve CLI semantics.

func EnsureHarnessContext

func EnsureHarnessContext(ctx context.Context, reqs []require.Requirement, flowPath ...string) (string, error)

func EnsureThinHarnessContext added in v0.48.0

func EnsureThinHarnessContext(ctx context.Context, reqs []require.Requirement, flowPath ...string) (string, error)

EnsureThinHarnessContext builds the optimized runner for supported run invocations only.

func ExecHarness

func ExecHarness(bin string, args []string) int

func ExecHarnessContext

func ExecHarnessContext(ctx context.Context, bin string, args []string) int

func FlowModuleRoot

func FlowModuleRoot() (string, error)

FlowModuleRoot locates the Nexss Flow source module using the running executable or current working directory. It is shared by the CLI and the builder so both use the same module-root detection logic.

func GitCommit

func GitCommit(ctx context.Context, dir string) string

GitCommit returns the short revision for a source directory.

func GitDescribe

func GitDescribe(ctx context.Context, dir string) string

GitDescribe returns the closest tag or revision for a source directory.

func Print

func Print(w interface{ Write([]byte) (int, error) })

Print writes a multi-line build summary to w.

func ResetRequirementSource added in v0.37.0

func ResetRequirementSource(ctx context.Context, file string) error

ResetRequirementSource restores the last pre-change bytes and consumes the optional backup. No resolver, lockfile, or Go metadata is involved.

func ResolvedBuildInfo

func ResolvedBuildInfo() (version, commit, builtAt string)

func RunBuild

func RunBuild(ctx context.Context, args []string, sourceRequires func(context.Context, string) ([]require.Requirement, error)) int

RunBuild builds the workflow binary using the supplied requirement resolver. The resolver is injected by the CLI so its active native bundle set is honored.

func SourceRequires

func SourceRequires(ctx context.Context, path string) ([]require.Requirement, error)

SourceRequires resolves @require declarations using the shipped native directives.

func WithGoDiagnostics added in v0.39.0

func WithGoDiagnostics(ctx context.Context) context.Context

WithGoDiagnostics starts a fresh warning scope. Call once per CLI invocation, sharing the returned context across all dependency-resolution and build steps.

Types

type RequirementChange added in v0.37.0

type RequirementChange struct {
	Import, Selector, Current, Latest, Target, Reason string
	Line                                              int
}

RequirementChange describes a direct declaration in the named source file. Skipped declarations have a Reason; no provider metadata is persisted.

type RequirementSourceResult added in v0.37.0

type RequirementSourceResult struct {
	Changes []RequirementChange
	Changed bool
	Backup  string
}

RequirementSourceResult is an inspection or a completed source edit.

func ManageRequirementSource added in v0.37.0

func ManageRequirementSource(ctx context.Context, file, operation, pattern string, table *compiler.DirectiveTable) (RequirementSourceResult, error)

ManageRequirementSource shares parsing, provider selection and writing across check, update and pin. The supplied directive table preserves CLI extensions. Only direct declarations in file are edited; imported sources are untouched.

Jump to

Keyboard shortcuts

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