diff --git a/modules/mesh-build-go/cmd/mesh-build-go/fetch.go b/modules/mesh-build-go/cmd/mesh-build-go/fetch.go index 95acdde8f..1a17af061 100644 --- a/modules/mesh-build-go/cmd/mesh-build-go/fetch.go +++ b/modules/mesh-build-go/cmd/mesh-build-go/fetch.go @@ -334,10 +334,11 @@ func (m *Module) goEnv() []string { // The Go seat first, the public proxy second, the forge's git last (CAT-BG3, E11: direct goes in the first // change after mesh-sdk's and mesh-contracts' first numbered versions are in the Go seat); no GOPRIVATE, and // the checksum database off for the forge's paths, which go.sum and the builder's h1: digest guard instead. - // The separator is "|", not ",": with "," go goes on only after a 404 or 410, so a seat that does not hold a - // package (a contracts package not published yet) and a public proxy the node cannot reach stopped the fetch - // before "direct" (issue 1966); with "|" any failure goes on to the next, and direct reaches the forge's git. - env = append(env, "GOPROXY="+proxy+"|"+PublicGoProxy+"|direct", "GONOSUMDB="+ForgeGoPaths, "GOPRIVATE=") + // The seat goes on to the public proxy only on a 404 or 410 (",": a package it does not hold), so a seat that + // fails otherwise (5xx, refused, timeout) fails the fetch loudly; the public proxy goes on to direct on any + // failure ("|"): a public proxy the node cannot reach stopped the fetch before direct, and direct reaches the + // forge's git for a package the seat does not hold (issue 1966, ADR 0605 ยง6). + env = append(env, "GOPROXY="+proxy+","+PublicGoProxy+"|direct", "GONOSUMDB="+ForgeGoPaths, "GOPRIVATE=") } else { env = append(env, "GOPRIVATE="+ForgeGoPaths) } diff --git a/modules/mesh-build-go/cmd/mesh-build-go/fetch_test.go b/modules/mesh-build-go/cmd/mesh-build-go/fetch_test.go index f1387604c..d76472a6f 100644 --- a/modules/mesh-build-go/cmd/mesh-build-go/fetch_test.go +++ b/modules/mesh-build-go/cmd/mesh-build-go/fetch_test.go @@ -153,7 +153,7 @@ func TestFetchAsksGitForTheSshRemoteAndDownloadsEachModule(t *testing.T) { } m.GoSeatFile = seat env := strings.Join(m.goEnv(), " ") - for _, want := range []string{"GOPROXY=http://forge.mesh:3000/api/packages/novox/go|https://proxy.golang.org|direct", "GONOSUMDB=git.novox.be", "GOPRIVATE= "} { + for _, want := range []string{"GOPROXY=http://forge.mesh:3000/api/packages/novox/go,https://proxy.golang.org|direct", "GONOSUMDB=git.novox.be", "GOPRIVATE= "} { if !strings.Contains(env+" ", want) { t.Errorf("with the Go seat bound the environment lacks %q: %s", want, env) }