Build a check's builds for its merge where the host's container engine sees them (hq issue 713)

The check built in a temporary directory of the build holder's container, which the
host's engine mounted empty: every check build failed and every walk built again.
This commit is contained in:
2026-10-14 20:14:20 +02:00
parent 622fb1e9cb
commit afed887217
3 changed files with 160 additions and 16 deletions
+5 -1
View File
@@ -70,7 +70,9 @@ func skipsTheBuilds(v CheckVerdict) string {
// buildForTheMerge builds each module the plan moves, tier by tier, into the scratch namespace, and keeps what it
// built under its keys. A module standing after one not built is not built either: what it stands on in the walk
// is not what it would stand on here. tree is the check's clone and merge the merge commit it made there.
// is not what it would stand on here. tree is the check's clone and merge the merge commit it made there; workspace
// is where each build's working copy is made, a directory the host's container engine sees at the same path — the
// builder's own workspace, never a temporary directory of its container (novox/hq issue 713).
func buildForTheMerge(ctx context.Context, run Runner, spec CheckSpec, with CheckBuilding, workspace, tree, merge string,
judged CheckVerdict, forge GitCredential, log Log, say func(step, format string, args ...any)) []CheckBuilt {
if len(spec.Builds) == 0 || with.Publish == nil || with.Scratch == nil {
@@ -80,6 +82,8 @@ func buildForTheMerge(ctx context.Context, run Runner, spec CheckSpec, with Chec
if ref == "" {
ref = spec.Ref
}
// What an earlier check left, ended before it could remove it, is not built on.
_ = os.RemoveAll(filepath.Join(workspace, "for-the-merge"))
held := map[string]string{}
for k, v := range with.Held {
held[k] = v