diff --git a/modules/mesh-build-go/cmd/mesh-build-go/isolate.go b/modules/mesh-build-go/cmd/mesh-build-go/isolate.go index 99591841..7a9c309c 100644 --- a/modules/mesh-build-go/cmd/mesh-build-go/isolate.go +++ b/modules/mesh-build-go/cmd/mesh-build-go/isolate.go @@ -43,16 +43,15 @@ func (m *Module) isolation(workspace string, write bool) buildstep.Isolation { Env: append([]string{"PATH=" + path, "LC_ALL=C"}, m.threadEnv()...), } if !write { - // What one command of the ask compiles is kept for its later commands (the vet, the unit tests, the integration - // level's compile), in the workspace and gone with it (issue 1921, try speed S2). - iso.CacheLayer = filepath.Join(iso.Workspace, cacheLayerDir) + // What one command of the ask compiles into the build cache is kept for its later commands (the digests, the unit + // tests, the integration level's compile), beside the workspace, out of every step's reach, and gone with it + // (issue 1921, try speed S2); the module cache keeps its throwaway layer. + iso.CacheLayer = m.spaces().CacheLayer(workspace) + iso.LayerCaches = []string{filepath.Join(m.Cache, "gobuild")} } return iso } -// cacheLayerDir is the directory in a workspace's root where an ask keeps what its commands wrote into the caches. -const cacheLayerDir = "cachelayer" - // stepRunner is the runner of a run step of the workspace: buildstep.Isolated over m.Run, so every command it runs is // shut off; write is true for a trunk build and for a check's go vet, compile steps that run nothing of the change (ADR 0541 ยง2). Inside is the // integration level's own process, already running shut off (level.go): it runs its commands as they are. diff --git a/modules/mesh-build-go/cmd/mesh-build-go/isolate_test.go b/modules/mesh-build-go/cmd/mesh-build-go/isolate_test.go index e97ee68f..fc23861d 100644 --- a/modules/mesh-build-go/cmd/mesh-build-go/isolate_test.go +++ b/modules/mesh-build-go/cmd/mesh-build-go/isolate_test.go @@ -111,9 +111,12 @@ func checkShutOff(t *testing.T, m *Module, s shutOff, write bool) { t.Errorf("a trunk build's %s does not write the shared cache %s (bound %v, layered %v)", s.command, c, bound, layered) case !write && (bound || !layered): t.Errorf("%s may write the shared cache %s (bound %v, layered %v): only a trunk build does", s.command, c, bound, layered) - case !write && !strings.HasPrefix(s.uppers[c], filepath.Join(m.Work, "ws1", "cachelayer")+"/"): - // 1921/S2: what one command of the ask compiles is kept for its later commands, in the workspace - t.Errorf("%s writes the cache %s into %q, not the ask's cache layer in its workspace", s.command, c, s.uppers[c]) + case !write && c == filepath.Join(m.Cache, "gobuild") && !strings.HasPrefix(s.uppers[c], filepath.Join(m.Work, "ws1.cachelayer")+"/"): + // 1921/S2: what one command of the ask compiles is kept for its later commands, beside the workspace + t.Errorf("%s writes the build cache %s into %q, not the ask's cache layer beside its workspace", s.command, c, s.uppers[c]) + case !write && c != filepath.Join(m.Cache, "gobuild") && s.uppers[c] != "": + // the module cache keeps its throwaway layer + t.Errorf("%s keeps what it writes into the module cache %s (in %q)", s.command, c, s.uppers[c]) } } if want := filepath.Join(m.Work, "ws1"); !slices.Contains(s.binds, want) { diff --git a/modules/mesh-build-go/go.mod b/modules/mesh-build-go/go.mod index ecfb3b2b..354eeee0 100644 --- a/modules/mesh-build-go/go.mod +++ b/modules/mesh-build-go/go.mod @@ -3,7 +3,7 @@ module meshbuildgo go 1.26.0 require ( - git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261028235320-62a50ebcf822 + git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261029000420-979f2cd71819 github.com/distribution/distribution/v3 v3.1.2 github.com/nats-io/nats-server/v2 v2.11.17 github.com/nats-io/nats.go v1.54.0 diff --git a/modules/mesh-build-go/go.sum b/modules/mesh-build-go/go.sum index 5ddb5386..7ecd672e 100644 --- a/modules/mesh-build-go/go.sum +++ b/modules/mesh-build-go/go.sum @@ -2,6 +2,8 @@ git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261028230718-261f41aec1ae h1:bwcj9Nnf git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261028230718-261f41aec1ae/go.mod h1:ouERNpZizzwZ0HLEtAypsY9FR20FyUgUYRni6J7kVCY= git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261028235320-62a50ebcf822 h1:od9tMSw9yHRLe4c03/u9EVr7TpXZ+pEJa2XY5evx6Ho= git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261028235320-62a50ebcf822/go.mod h1:ouERNpZizzwZ0HLEtAypsY9FR20FyUgUYRni6J7kVCY= +git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261029000420-979f2cd71819 h1:ypKERyJAbbsydMKLlPmWKU++wU2YCPLzGC0nzdw6QvQ= +git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261029000420-979f2cd71819/go.mod h1:ouERNpZizzwZ0HLEtAypsY9FR20FyUgUYRni6J7kVCY= github.com/alicebob/miniredis/v2 v2.35.0 h1:QwLphYqCEAo1eu1TqPRN2jgVMPBweeQcR21jeqDCONI= github.com/alicebob/miniredis/v2 v2.35.0/go.mod h1:TcL7YfarKPGDAthEtl5NBeHZfeUQj6OXMm/+iu5cLMM= github.com/antithesishq/antithesis-sdk-go v0.7.0-default-no-op h1:Z/MZK75wC/NSrkgqeNIa7jexam9uWzhLmFTSCPI/kn0= diff --git a/modules/mesh-build-node/go.mod b/modules/mesh-build-node/go.mod index a72064c5..1955c59c 100644 --- a/modules/mesh-build-node/go.mod +++ b/modules/mesh-build-node/go.mod @@ -3,7 +3,7 @@ module meshbuildnode go 1.26.0 require ( - git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261028235320-62a50ebcf822 + git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261029000420-979f2cd71819 github.com/distribution/distribution/v3 v3.1.2 github.com/nats-io/nats.go v1.54.0 ) diff --git a/modules/mesh-build-node/go.sum b/modules/mesh-build-node/go.sum index a7f3f51e..93044ba4 100644 --- a/modules/mesh-build-node/go.sum +++ b/modules/mesh-build-node/go.sum @@ -2,6 +2,8 @@ git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261028230718-261f41aec1ae h1:bwcj9Nnf git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261028230718-261f41aec1ae/go.mod h1:ouERNpZizzwZ0HLEtAypsY9FR20FyUgUYRni6J7kVCY= git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261028235320-62a50ebcf822 h1:od9tMSw9yHRLe4c03/u9EVr7TpXZ+pEJa2XY5evx6Ho= git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261028235320-62a50ebcf822/go.mod h1:ouERNpZizzwZ0HLEtAypsY9FR20FyUgUYRni6J7kVCY= +git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261029000420-979f2cd71819 h1:ypKERyJAbbsydMKLlPmWKU++wU2YCPLzGC0nzdw6QvQ= +git.novox.be/novox/mesh-sdk/go v0.1.14-0.20261029000420-979f2cd71819/go.mod h1:ouERNpZizzwZ0HLEtAypsY9FR20FyUgUYRni6J7kVCY= github.com/alicebob/miniredis/v2 v2.35.0 h1:QwLphYqCEAo1eu1TqPRN2jgVMPBweeQcR21jeqDCONI= github.com/alicebob/miniredis/v2 v2.35.0/go.mod h1:TcL7YfarKPGDAthEtl5NBeHZfeUQj6OXMm/+iu5cLMM= github.com/antithesishq/antithesis-sdk-go v0.7.0-default-no-op h1:Z/MZK75wC/NSrkgqeNIa7jexam9uWzhLmFTSCPI/kn0=