Documentation
¶
Index ¶
- Constants
- func EdgeWeightHeuristic(edge *graph.Edge) int64
- type Builder
- func (b *Builder) AddTarget(target *graph.Node) (bool, error)
- func (b *Builder) AddTargetByName(name string) (*graph.Node, error)
- func (b *Builder) AlreadyUpToDate() bool
- func (b *Builder) Build() (exit_status.ExitStatusType, error)
- func (b *Builder) Cleanup()
- func (b *Builder) Close()
- func (b *Builder) Dump()
- func (b *Builder) ExtractDeps(result *spawn.Result, depsType, depsPrefix string) ([]*graph.Node, error)
- func (b *Builder) FinishCommand(result *spawn.Result) (bool, error)
- func (b *Builder) GetExitCode() exit_status.ExitStatusType
- func (b *Builder) LoadDyndeps(node *graph.Node) error
- func (b *Builder) SetFailureCode(code exit_status.ExitStatusType)
- func (b *Builder) SetJobserverClient(jobserver jobserver.Client)
- func (b *Builder) StartEdge(edge *graph.Edge) (bool, error)
- func (b *Builder) TestOnlyPlan() *Plan
- func (b *Builder) TestOnlySetCommandRunner(runner CommandRunner)
- type CachingCommandRunner
- type CancellableCommandRunner
- type CommandRunner
- type DryCommandRunner
- func (d *DryCommandRunner) Abort()
- func (d *DryCommandRunner) CanRunMore() int
- func (r *DryCommandRunner) ClearJobTokens()
- func (d *DryCommandRunner) GetActiveEdges() []*graph.Edge
- func (d *DryCommandRunner) StartCommand(edge *graph.Edge) error
- func (d *DryCommandRunner) WaitForCommand() *spawn.Result
- type EdgeResult
- type Plan
- func (p *Plan) AddSubTarget(node, dependent *graph.Node, dyndepWalk map[*graph.Edge]struct{}) (bool, error)
- func (p *Plan) AddTarget(target *graph.Node) (bool, error)
- func (p *Plan) CleanNode(scan *dependency_scan.DependencyScan, node *graph.Node) bool
- func (p *Plan) CommandEdgeCount() int
- func (p *Plan) ComputeCriticalPath()
- func (p *Plan) Dump()
- func (p *Plan) DyndepsLoaded(scan *dependency_scan.DependencyScan, node *graph.Node, ddf dyndep.DyndepFile) (bool, error)
- func (p *Plan) EdgeFinished(edge *graph.Edge, result EdgeResult) (bool, error)
- func (p *Plan) EdgeMaybeReady(edge *graph.Edge, want Want) (bool, error)
- func (p *Plan) EdgeWanted(edge *graph.Edge)
- func (p *Plan) FindWork() *graph.Edge
- func (p *Plan) MoreToDo() bool
- func (p *Plan) NodeFinished(node *graph.Node) (bool, error)
- func (p *Plan) PrepareQueue()
- func (p *Plan) RefreshDyndepDependents(scan *dependency_scan.DependencyScan, node *graph.Node) (bool, error)
- func (p *Plan) Reset()
- func (p *Plan) ScheduleInitialEdges()
- func (p *Plan) ScheduleWork(edge *graph.Edge, want Want)
- func (p *Plan) UnmarkDependents(node *graph.Node, dependents map[*graph.Node]struct{})
- type RealCommandRunner
- func (r *RealCommandRunner) Abort()
- func (r *RealCommandRunner) CanRunMore() int
- func (r *RealCommandRunner) ClearJobTokens()
- func (r *RealCommandRunner) GetActiveEdges() []*graph.Edge
- func (r *RealCommandRunner) StartCommand(edge *graph.Edge) error
- func (r *RealCommandRunner) WaitForCommand() *spawn.Result
- type RemoteCachingCommandRunner
- func (r *RemoteCachingCommandRunner) Abort()
- func (r *RemoteCachingCommandRunner) CacheResult(result *spawn.Result, depsNodes []*graph.Node) error
- func (r *RemoteCachingCommandRunner) CanRunMore() int
- func (r *RemoteCachingCommandRunner) Cancel()
- func (r *RemoteCachingCommandRunner) ClearJobTokens()
- func (r *RemoteCachingCommandRunner) GetActiveEdges() []*graph.Edge
- func (r *RemoteCachingCommandRunner) StartCommand(edge *graph.Edge) error
- func (r *RemoteCachingCommandRunner) WaitForCommand() *spawn.Result
- func (r *RemoteCachingCommandRunner) WaitForUploads() error
- type RemoteCommandRunner
- func (r *RemoteCommandRunner) Abort()
- func (r *RemoteCommandRunner) CanRunMore() int
- func (r *RemoteCommandRunner) Cancel()
- func (r *RemoteCommandRunner) ClearJobTokens()
- func (r *RemoteCommandRunner) GetActiveEdges() []*graph.Edge
- func (r *RemoteCommandRunner) StartCommand(edge *graph.Edge) error
- func (r *RemoteCommandRunner) WaitForCommand() *spawn.Result
- type RunningEdgeMap
- type TopoSort
- type Want
Constants ¶
const ( // We do not want to build the edge, but we might want to build one of // its dependents. WantNothing = iota // We want to build the edge, but have not yet scheduled it. WantToStart // We want to build the edge, have scheduled it, and are waiting // for it to complete. WantToFinish )
const ( EdgeFailed = iota EdgeSucceeded )
Variables ¶
This section is empty.
Functions ¶
func EdgeWeightHeuristic ¶
Heuristic for edge priority weighting. Phony edges are free (0 cost), all other edges are weighted equally.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func NewBuilder ¶
func (*Builder) AddTargetByName ¶
func (*Builder) AlreadyUpToDate ¶
func (*Builder) Build ¶
func (b *Builder) Build() (exit_status.ExitStatusType, error)
func (*Builder) ExtractDeps ¶
func (*Builder) GetExitCode ¶
func (b *Builder) GetExitCode() exit_status.ExitStatusType
func (*Builder) SetFailureCode ¶
func (b *Builder) SetFailureCode(code exit_status.ExitStatusType)
func (*Builder) SetJobserverClient ¶
func (*Builder) TestOnlyPlan ¶
func (*Builder) TestOnlySetCommandRunner ¶
func (b *Builder) TestOnlySetCommandRunner(runner CommandRunner)
type CachingCommandRunner ¶
type CancellableCommandRunner ¶
type CancellableCommandRunner interface {
Cancel()
}
CancellableCommandRunner is an optional interface that command runners can implement to support cancelling in-flight work without a full abort. This is used to stop pending remote actions promptly when the failure budget is exhausted, rather than waiting for all of them to complete.
type CommandRunner ¶
type CommandRunner interface {
CanRunMore() int
StartCommand(edge *graph.Edge) error
WaitForCommand() *spawn.Result
GetActiveEdges() []*graph.Edge
Abort()
ClearJobTokens()
}
func NewRealCommandRunner ¶
func NewRealCommandRunner(config *build_config.Config, jobserver jobserver.Client) CommandRunner
type DryCommandRunner ¶
type DryCommandRunner struct {
// contains filtered or unexported fields
}
func NewDryCommandRunner ¶
func NewDryCommandRunner() *DryCommandRunner
func (*DryCommandRunner) Abort ¶
func (d *DryCommandRunner) Abort()
func (*DryCommandRunner) CanRunMore ¶
func (d *DryCommandRunner) CanRunMore() int
CanRunMore always returns true for dry run
func (*DryCommandRunner) ClearJobTokens ¶
func (r *DryCommandRunner) ClearJobTokens()
func (*DryCommandRunner) GetActiveEdges ¶
func (d *DryCommandRunner) GetActiveEdges() []*graph.Edge
func (*DryCommandRunner) StartCommand ¶
func (d *DryCommandRunner) StartCommand(edge *graph.Edge) error
StartCommand simulates starting a command
func (*DryCommandRunner) WaitForCommand ¶
func (d *DryCommandRunner) WaitForCommand() *spawn.Result
type EdgeResult ¶
type EdgeResult int
type Plan ¶
type Plan struct {
// contains filtered or unexported fields
}
Plan stores the state of a build plan: what we intend to build, which steps we're ready to execute.
func (*Plan) AddSubTarget ¶
func (*Plan) AddTarget ¶
Add a target to our plan (including all its dependencies). Returns false if we don't need to build this target.
func (*Plan) CleanNode ¶
func (p *Plan) CleanNode(scan *dependency_scan.DependencyScan, node *graph.Node) bool
func (*Plan) CommandEdgeCount ¶
func (*Plan) ComputeCriticalPath ¶
func (p *Plan) ComputeCriticalPath()
func (*Plan) DyndepsLoaded ¶
func (p *Plan) DyndepsLoaded(scan *dependency_scan.DependencyScan, node *graph.Node, ddf dyndep.DyndepFile) (bool, error)
func (*Plan) EdgeFinished ¶
func (*Plan) EdgeMaybeReady ¶
func (*Plan) EdgeWanted ¶
func (*Plan) FindWork ¶
Pop a ready edge off the queue of edges to build. Returns NULL if there's no work to do.
func (*Plan) PrepareQueue ¶
func (p *Plan) PrepareQueue()
func (*Plan) RefreshDyndepDependents ¶
func (p *Plan) RefreshDyndepDependents(scan *dependency_scan.DependencyScan, node *graph.Node) (bool, error)
func (*Plan) ScheduleInitialEdges ¶
func (p *Plan) ScheduleInitialEdges()
type RealCommandRunner ¶
type RealCommandRunner struct {
// contains filtered or unexported fields
}
func (*RealCommandRunner) Abort ¶
func (r *RealCommandRunner) Abort()
func (*RealCommandRunner) CanRunMore ¶
func (r *RealCommandRunner) CanRunMore() int
func (*RealCommandRunner) ClearJobTokens ¶
func (r *RealCommandRunner) ClearJobTokens()
func (*RealCommandRunner) GetActiveEdges ¶
func (r *RealCommandRunner) GetActiveEdges() []*graph.Edge
func (*RealCommandRunner) StartCommand ¶
func (r *RealCommandRunner) StartCommand(edge *graph.Edge) error
func (*RealCommandRunner) WaitForCommand ¶
func (r *RealCommandRunner) WaitForCommand() *spawn.Result
type RemoteCachingCommandRunner ¶
type RemoteCachingCommandRunner struct {
// contains filtered or unexported fields
}
func NewRemoteCachingCommandRunner ¶
func NewRemoteCachingCommandRunner(config *build_config.Config, jobserver jobserver.Client) *RemoteCachingCommandRunner
func (*RemoteCachingCommandRunner) Abort ¶
func (r *RemoteCachingCommandRunner) Abort()
func (*RemoteCachingCommandRunner) CacheResult ¶
func (*RemoteCachingCommandRunner) CanRunMore ¶
func (r *RemoteCachingCommandRunner) CanRunMore() int
func (*RemoteCachingCommandRunner) Cancel ¶
func (r *RemoteCachingCommandRunner) Cancel()
func (*RemoteCachingCommandRunner) ClearJobTokens ¶
func (r *RemoteCachingCommandRunner) ClearJobTokens()
func (*RemoteCachingCommandRunner) GetActiveEdges ¶
func (r *RemoteCachingCommandRunner) GetActiveEdges() []*graph.Edge
func (*RemoteCachingCommandRunner) StartCommand ¶
func (r *RemoteCachingCommandRunner) StartCommand(edge *graph.Edge) error
func (*RemoteCachingCommandRunner) WaitForCommand ¶
func (r *RemoteCachingCommandRunner) WaitForCommand() *spawn.Result
func (*RemoteCachingCommandRunner) WaitForUploads ¶
func (r *RemoteCachingCommandRunner) WaitForUploads() error
type RemoteCommandRunner ¶
type RemoteCommandRunner struct {
// contains filtered or unexported fields
}
func NewRemoteCommandRunner ¶
func NewRemoteCommandRunner(config *build_config.Config, jobserver jobserver.Client) *RemoteCommandRunner
func (*RemoteCommandRunner) Abort ¶
func (r *RemoteCommandRunner) Abort()
func (*RemoteCommandRunner) CanRunMore ¶
func (r *RemoteCommandRunner) CanRunMore() int
func (*RemoteCommandRunner) Cancel ¶
func (r *RemoteCommandRunner) Cancel()
func (*RemoteCommandRunner) ClearJobTokens ¶
func (r *RemoteCommandRunner) ClearJobTokens()
func (*RemoteCommandRunner) GetActiveEdges ¶
func (r *RemoteCommandRunner) GetActiveEdges() []*graph.Edge
func (*RemoteCommandRunner) StartCommand ¶
func (r *RemoteCommandRunner) StartCommand(edge *graph.Edge) error
func (*RemoteCommandRunner) WaitForCommand ¶
func (r *RemoteCommandRunner) WaitForCommand() *spawn.Result
type TopoSort ¶
type TopoSort struct {
// contains filtered or unexported fields
}
func NewTopoSort ¶
func NewTopoSort() *TopoSort