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
1 Commits
Author SHA1 Message Date
jschoubben 5526873138 mesh-build-go: the imports step lists each package path in the environment its build uses (issue 1984, H-A-633)
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
2026-11-24 00:19:56 +01:00