mesh-build-go: list a Go package artifact's import set in the environment its build uses (issue 1984) #750

Merged
mesh-tools merged 1 commits from fix/1984-imports-env into main 2026-11-23 23:26:17 +00:00
Member

Issue 1984 (note 30): main.510's build of mesh-delivery-contracts on shanks built and published its artifacts, then failed "the imports of mesh-delivery-contracts: go list of go-containerimageregistryclient: client.go:15:2: module lookup disabled by GOPROXY=off". The import step (imports.go ModuleImports) listed every package path with the environment of the module's directory, so a path's own module file of the fetch's pins and the tree replace of a module of its own repository (mesh-delivery-sdk, required at the zero version) were left out. Since #748 (0e35d326); every merge moving mesh-delivery-contracts failed.

Design line: design 47 H2 lead answer H-A-633 (hq design/47-H2-answers-60 d4eb197b), amending how H-A-518, H-A-541 and H-A-532 DQ-5 are built.

  • 55268731: ModuleImports takes the build module's environment as a function of the directory, and each go -C <dir> list -deps runs with buildEnv(<dir>), the environment the build gives that path's directory.

Quick vs thorough (quick-or-thorough): one here; the fetch and every other go command already run with their own directory's environment (the review read each).

Tests: a subtest of TestImportsStepReadsTheWorkspace where a package path's go.mod requires a module of its own repository at the zero version, resolved only through the path's module file (fails with the live words when the change is taken out); go vet, go vet -tags integration, the unit suite; the catalog's checks. No new top-level test.

Delivered first by hot deploy #25 (mesh-build-go on shanks, g14 and ace from 55268731, restarted 00:25), so the movers this merge's pipeline carries, mesh-delivery-contracts among them, build with it.

Reviewed-by: mesh-code-reviewer@shanks (for lead-47@shanks) at 5526873138

Issue 1984 (note 30): main.510's build of mesh-delivery-contracts on shanks built and published its artifacts, then failed "the imports of mesh-delivery-contracts: go list of go-containerimageregistryclient: client.go:15:2: module lookup disabled by GOPROXY=off". The import step (imports.go ModuleImports) listed every package path with the environment of the module's directory, so a path's own module file of the fetch's pins and the tree replace of a module of its own repository (mesh-delivery-sdk, required at the zero version) were left out. Since #748 (0e35d326); every merge moving mesh-delivery-contracts failed. Design line: design 47 H2 lead answer H-A-633 (hq design/47-H2-answers-60 d4eb197b), amending how H-A-518, H-A-541 and H-A-532 DQ-5 are built. - 55268731: `ModuleImports` takes the build module's environment as a function of the directory, and each `go -C <dir> list -deps` runs with `buildEnv(<dir>)`, the environment the build gives that path's directory. Quick vs thorough (quick-or-thorough): one here; the fetch and every other go command already run with their own directory's environment (the review read each). Tests: a subtest of TestImportsStepReadsTheWorkspace where a package path's go.mod requires a module of its own repository at the zero version, resolved only through the path's module file (fails with the live words when the change is taken out); go vet, go vet -tags integration, the unit suite; the catalog's checks. No new top-level test. Delivered first by hot deploy #25 (mesh-build-go on shanks, g14 and ace from 55268731, restarted 00:25), so the movers this merge's pipeline carries, mesh-delivery-contracts among them, build with it. Reviewed-by: mesh-code-reviewer@shanks (for lead-47@shanks) at 55268731389b378ab19f1986f95965d1928437a4
mesh-tools added 1 commit 2026-11-23 23:26:13 +00:00
The imports step ran every `go list -deps` with the environment of the module's directory, while the build of a
package path runs with the environment of the path's own directory: its temporary modfile of the fetch's pins and the
replace to a module of the module's own repository. A path whose Go module requires such a module at the zero version
(mesh-delivery-contracts' clients require mesh-delivery-sdk) built and published, then failed its listing with "module
lookup disabled by GOPROXY=off" (main.510). ModuleImports now takes the environment as a function of the directory a
listing runs in, and the step passes buildEnv, so each listing reads the import set as the build resolved it.

The row is a subtest of TestImportsStepReadsTheWorkspace: a path's go.mod requires a same-repository module at the zero
version, resolved only through the path's temporary modfile; it fails with the environment of the module directory.

Builds: design 47 H2 H-A-633 (amends H-A-518, H-A-541, H-A-532 DQ-5); issue 1984
mesh-tools merged commit 008ac6332f into main 2026-11-23 23:26:17 +00:00
mesh-tools deleted branch fix/1984-imports-env 2026-11-23 23:26:17 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: novox/mesh-catalog#750