// Release next test to start (test2json.NewConverter writes the start event).
close(r.next)
- if a.Failed {
+ if a.Failed != nil {
// We were unable to build the binary.
- a.Failed = false
+ a.Failed = nil
fmt.Fprintf(stdout, "FAIL\t%s [build failed]\n", a.Package.ImportPath)
// Tell the JSON converter that this was a failure, not a passing run.
err = errors.New("build failed")
// Execution state.
pending int // number of deps yet to complete
priority int // relative execution priority
- Failed bool // whether the action failed
+ Failed *Action // set to root cause if the action failed
json *actionJSON // action graph information
nonGoOverlay map[string]string // map from non-.go source files to copied files in objdir. Nil if no overlay is used.
traceSpan *trace.Span
Args: a.Args,
Objdir: a.Objdir,
Target: a.Target,
- Failed: a.Failed,
+ Failed: a.Failed != nil,
Priority: a.priority,
Built: a.built,
VetxOnly: a.VetxOnly,
a.json.TimeStart = time.Now()
}
var err error
- if a.Actor != nil && (!a.Failed || a.IgnoreFail) {
+ if a.Actor != nil && (a.Failed == nil || a.IgnoreFail) {
// TODO(matloob): Better action descriptions
desc := "Executing action (" + a.Mode
if a.Package != nil {
sh := b.Shell(a)
sh.Errorf("%s", err)
}
- a.Failed = true
+ if a.Failed == nil {
+ a.Failed = a
+ }
}
for _, a0 := range a.triggers {
- if a.Failed {
- a0.Failed = true
+ if a.Failed != nil {
+ a0.Failed = a.Failed
}
if a0.pending--; a0.pending == 0 {
b.ready.push(a0)
// a.Deps[0] is the build of the package being vetted.
// a.Deps[1] is the build of the "fmt" package.
- a.Failed = false // vet of dependency may have failed but we can still succeed
+ a.Failed = nil // vet of dependency may have failed but we can still succeed
- if a.Deps[0].Failed {
+ if a.Deps[0].Failed != nil {
// The build of the package has failed. Skip vet check.
// Vet could return export data for non-typecheck errors,
// but we ignore it because the package cannot be compiled.