From c16e07ba0e7f292eb49db98676352c175dd8f199 Mon Sep 17 00:00:00 2001 From: jochen Date: Tue, 10 Nov 2026 17:32:21 +0100 Subject: [PATCH] B-D14b/W4.8: the toolchain gate takes the build modules a part finds, as it finds them (issue 1966) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Design 47 *A module's registration*, "No part fixes a name" (b229f5c4 lines 482-485): the indexer finds the build modules from the seat list's acts and the manifests, after the gate is made, so the gate takes them by UseModules and passes its reports on again. Row in TestToolchainGate: a module given later passes on at the assignments only once given (fails without UseModules). Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ Builds: design 47 G §364, §428, §535 --- .../mesh-delivery-builder/buildrun/standing.go | 13 +++++++++++++ .../buildrun/standing_test.go | 17 +++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/modules/mesh-delivery-builder/buildrun/standing.go b/modules/mesh-delivery-builder/buildrun/standing.go index e921c781..bc469fc9 100644 --- a/modules/mesh-delivery-builder/buildrun/standing.go +++ b/modules/mesh-delivery-builder/buildrun/standing.go @@ -60,6 +60,19 @@ func NewToolchainGate(modules []string, forward func(module, key string, value [ return g } +// UseModules replaces the build modules whose reports the gate passes on again when the assignments moves (a part that +// finds them from the seat list and the manifests, as the indexer does, gives them at each change), and passes every +// report it holds on again. It answers whether what it passed on changed. +func (g *ToolchainGate) UseModules(modules []string) bool { + g.mu.Lock() + defer g.mu.Unlock() + g.modules = map[string]bool{} + for _, m := range modules { + g.modules[m] = true + } + return g.all() +} + // Toolchain takes one change of a build module's toolchains bucket in and answers whether what it passed on changed. func (g *ToolchainGate) Toolchain(module, key string, value []byte, deleted bool) bool { g.mu.Lock() diff --git a/modules/mesh-delivery-builder/buildrun/standing_test.go b/modules/mesh-delivery-builder/buildrun/standing_test.go index 506d0da2..cf875aa6 100644 --- a/modules/mesh-delivery-builder/buildrun/standing_test.go +++ b/modules/mesh-delivery-builder/buildrun/standing_test.go @@ -112,6 +112,23 @@ func TestToolchainGate(t *testing.T) { } }) + t.Run("build modules given later pass their reports on when the assignments moves", func(t *testing.T) { + set := &ToolchainSet{} + gate := NewToolchainGate(nil, set.Put, func(string, ...any) {}) + gate.Settled() + k, v := placing(t, "novox", GoBuildModule) + gate.Assignments(k, v, false, old) + key, value := gateReport(t, "ace", "v26.12.1", placed.Add(time.Minute)) + gate.Toolchain(NodeBuildModule, key, value, false) // ace is not placed: left out + k, v = placing(t, "ace", NodeBuildModule) + if gate.Assignments(k, v, false, placed) || len(set.Entries("typescript")) != 0 { + t.Fatalf("a module the gate was not given passed on at the assignments: %v", set.Entries("typescript")) + } + if !gate.UseModules([]string{NodeBuildModule}) || len(set.Entries("typescript")) != 1 { + t.Fatalf("given mesh-build-node, ace's report placed since is passed on; entries %v", set.Entries("typescript")) + } + }) + for _, c := range []struct { name string at time.Time // when ace wrote its report