rules_go icon indicating copy to clipboard operation
rules_go copied to clipboard

`nogo`: Issue with `isolated` extension and separate `go.mod` with `tools.go`

Open albertocavalcante opened this issue 8 months ago • 1 comments

When using a tools.go approach and having a separate go.mod with a separate go_deps usage via --experimental_isolated_extension_usages as documented at: https://github.com/bazel-contrib/rules_go/blob/v0.53.0/docs/go/core/bzlmod.md#depending-on-tools, my project fails.

I intend to add more details to this issue but for now I have a reproducible: https://github.com/albertocavalcante/tools-nogo-issue

And these are the error messages: https://github.com/albertocavalcante/tools-nogo-issue/blob/main/STDERR.md

albertocavalcante avatar Mar 27 '25 16:03 albertocavalcante

nogo links in x/tools from rules_go's go.mod, which results in issues if you also link in your own separate copy.

Since rules_go having a baked in dependency on x/tools is troublesome, it would be worth rethinking this. Maybe we should let the user supply the requires deps? It's not that easy though since the package sees frequent breaking changes and the sources for the nogo tool shipped with rules_go would need to be compatible.

fmeum avatar Mar 28 '25 08:03 fmeum