selfcompose: the one place says its source at every caller, reads the have's build, answers HoldsData; the tool composition reads it outside the agent's lock (A-484, A-482)
Builds: design 47 G A-484, A-484a, A-482
This commit is contained in:
@@ -49,7 +49,7 @@ type runningAnswer struct {
|
||||
RunFP string
|
||||
// NeedTrunk says the trunk manifest is the one source left and is not held yet: the composer asks it beside the pass.
|
||||
NeedTrunk bool
|
||||
// Said is the line to say, once per module and source (principle 3); empty when it was said before.
|
||||
// Said is the line saying the source, for sayOnceEach (once per module and source, principle 3); empty when none answered.
|
||||
Said string
|
||||
}
|
||||
|
||||
@@ -70,6 +70,7 @@ func (c *Composer) runningFpsLocked(running []engcomp.Composed, node, module, hi
|
||||
return fps
|
||||
}
|
||||
add(hint)
|
||||
add(c.haveFp[module]) // the build its have names (A-482)
|
||||
for _, r := range running {
|
||||
if r.Module == module {
|
||||
add(r.FP)
|
||||
@@ -162,15 +163,12 @@ func (c *Composer) runningLocked(running []engcomp.Composed, node, module, hint
|
||||
}
|
||||
}
|
||||
if a.Source != "" {
|
||||
line := fmt.Sprintf("%s runs a build whose manifest is read from %s", module, a.Source)
|
||||
key := "running-manifest:" + node + "/" + module + "/" + a.Source
|
||||
if c.told == nil {
|
||||
c.told = map[string]bool{}
|
||||
}
|
||||
if !c.told[key] {
|
||||
c.told[key] = true
|
||||
a.Said = line
|
||||
// Said once per module and source by sayOnceEach, by whoever uses the answer (principle 3).
|
||||
where := ""
|
||||
if node != c.env.Node {
|
||||
where = " on " + node
|
||||
}
|
||||
a.Said = fmt.Sprintf("%s%s runs a build whose manifest is read from %s", module, where, a.Source)
|
||||
}
|
||||
return a
|
||||
}
|
||||
@@ -185,7 +183,7 @@ func (c *Composer) runningManifest(node, module, hint string) runningAnswer {
|
||||
a := c.runningLocked(running, node, module, hint)
|
||||
c.mu.Unlock()
|
||||
if a.Said != "" {
|
||||
c.env.Say(a.Said)
|
||||
c.sayOnceEach(a.Said)
|
||||
}
|
||||
return a
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user