You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does this issue reproduce with the latest releases of all the above?
Yes.
What operating system and processor architecture are you using?
MacOS/x86_64
What did you do?
I want to build a Go package with an executable (e.g. github.com/ekalinin/github-markdown-toc.go). The dependencies for this package are defined in the main package of the executable. As a result, running go get github.com/ekalinin/github-markdown-toc.go in my repo does not populate my go.mod with the transitive dependencies for the package. It merely adds the github.com/ekalinin/github-markdown-toc.go. After running update-repos and //:gazelle (i.e. update build files), executing the build fails because the transitive dependencies for github.com/ekalinin/github-markdown-toc.go are not found.
Note: I am running with bzlmod enabled.
What did you expect to see?
With bzlmod enabled, I expected update-repos to resolve all of the transitive dependencies for my dependency, just like it does when generating the legacy go_deps.bzl.
Reworked the Go dependencies for this repository so that we do not need
to list the transitive dependencies in `MODULE.bazel`. Because
`github.com/ekalinin/github-markdown-toc.go` references its dependencies
in its `main` package, `go get ...` does not add the transitive
dependencies to `go.mod`. The bzlmod-aware `update-repos` does not find
the transitive dependencies. To fix this, we add direct dependency for
`github.com/ekalinin/github-markdown-toc.go` to this repo and use it in
`cmd/go_deps`.
Related to bazel-contrib/bazel-gazelle#1585.
What version of gazelle are you using?
0.31.1
What version of rules_go are you using?
0.40.1
What version of Bazel are you using?
6.2.1
Does this issue reproduce with the latest releases of all the above?
Yes.
What operating system and processor architecture are you using?
MacOS/x86_64
What did you do?
I want to build a Go package with an executable (e.g. github.com/ekalinin/github-markdown-toc.go). The dependencies for this package are defined in the
main
package of the executable. As a result, runninggo get github.com/ekalinin/github-markdown-toc.go
in my repo does not populate mygo.mod
with the transitive dependencies for the package. It merely adds thegithub.aaakk.us.kg/ekalinin/github-markdown-toc.go
. After runningupdate-repos
and//:gazelle
(i.e. update build files), executing the build fails because the transitive dependencies forgithub.aaakk.us.kg/ekalinin/github-markdown-toc.go
are not found.Note: I am running with bzlmod enabled.
What did you expect to see?
With bzlmod enabled, I expected
update-repos
to resolve all of the transitive dependencies for my dependency, just like it does when generating the legacygo_deps.bzl
.What did you see instead?
See above.
Related Slack thread
The text was updated successfully, but these errors were encountered: