A build is taken in where its outcome is heard, and the build tool answers at once (issue 176)
The console's `build` tool answered "no build machine answered within 0s", handed a forge path to git as written, and a build heard afterwards was recorded and never registered: recording and registration lived only in the waiting caller, and the tool did not wait. Now one function takes a build's outcome in — records it, parses the manifest, refuses a definition naming an installation, registers the module with its source as the seat and path the request carried — and both the waiting command and the daemon that follows the role's `built` event call it. `build --wait 0` asks and returns with the id; `builds --log <id>` follows it. The seat verb says `--self` for a repository given without a scheme.
This commit is contained in:
@@ -241,6 +241,21 @@ func parseAround(set *flag.FlagSet, args []string) ([]string, error) {
|
||||
}
|
||||
}
|
||||
|
||||
// Built is the daemon hearing a build's outcome on the bus — its own asking, an announcement's, or
|
||||
// a tool's that did not wait (novox/hq issue 176) — and taking it in: recorded, and the module
|
||||
// registered, the same as the waiting command does. Said either way, so the daemon's log tells what
|
||||
// became of a build nobody was watching.
|
||||
func (b builds) Built(ctx context.Context, result link.BuildResult) error {
|
||||
return b.inv.RecordBuild(ctx, buildFrom(result))
|
||||
manifest, _, err := takeIn(ctx, b.inv, result)
|
||||
switch {
|
||||
case err != nil && result.Failed != "":
|
||||
fmt.Printf("%s: %v\n", result.ID, err)
|
||||
return nil
|
||||
case err != nil:
|
||||
fmt.Printf("%s: heard and recorded, and not registered: %v\n", result.ID, err)
|
||||
return nil
|
||||
}
|
||||
fmt.Printf("%s: %s %s registered, built on %s from %s\n",
|
||||
result.ID, manifest.Module, manifest.Version, result.On, short(result.Commit))
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user