Files
mesh-delivery/modules/mesh-delivery-builder/internal/build/candidates.go
T
jschoubben 62e56af786 Builder: the dead candidate machinery goes
Builder.Candidate, ForgetCandidate, considerCandidate, trunkHead, TrunkMoved, the cands and via
maps, the package-member wait that read via.Members (memberBuilds, memberEnded, MemberBoundEnded,
the member bound key) and the committed build output modules/mesh-delivery-builder/mesh-delivery-builder
are removed. Nothing fed Candidate in the process: the builder follows no candidate and learns a
run's builds from the build step ask. Their tests go with them.

Builds: design 47 G A-84 (the builder follows no candidate), §194, §348, §473
Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
2026-11-12 01:04:23 +01:00

33 lines
1.0 KiB
Go

package build
import (
"context"
"git.novox.be/novox/mesh-delivery/modules/mesh-delivery-builder/builds"
"git.novox.be/novox/mesh-delivery/sdk/buildstep"
)
// agreedFor are the toolchains the build nodes agree on now, for the languages of the manifest's plan: the toolchains the
// candidate's fingerprint was computed with, as the indexer recomputes it whenever they change. A language with none agreed
// is left out, and the build then waits for it as the trunk's does.
func (b *Builder) agreedFor(ctx context.Context, manifest string) map[string]builds.ToolchainUsed {
plan, err, _ := b.planOf(ctx, manifest)
if err != nil {
return nil
}
out := map[string]builds.ToolchainUsed{}
for _, bm := range plan.Modules() {
if !plan.NeedsToolchain(bm) {
continue
}
language, _ := b.Seats.LanguageOf(bm)
if tc, none := buildstep.AgreedToolchain(b.Toolchains.Entries(language)); none == "" {
out[language] = builds.ToolchainUsed{Version: tc.Version, Recipe: tc.Recipe}
}
}
if len(out) == 0 {
return nil
}
return out
}