bazelbuild / bazel-gazelle

Gazelle is a Bazel build file generator for Bazel projects. It natively supports Go and protobuf, and it may be extended to support new languages and custom rule sets.
Apache License 2.0
1.17k stars 374 forks source link

Gazelle cannot parse new go.mod directives #1825

Open uhthomas opened 2 months ago

uhthomas commented 2 months ago

What version of gazelle are you using?

v0.37.0

What version of rules_go are you using?

v0.48.0

What version of Bazel are you using?

6.5.0

Does this issue reproduce with the latest releases of all the above?

Yes.

What operating system and processor architecture are you using?

Linux x86

What did you do?

bazel run //:gazelle
go 1.22.2

toolchain go1.22.3

What did you expect to see?

What did you see instead?

gazelle: reading module paths from /home/thomas/code/github.com/uhthomas/automata/go.mod: /home/thomas/code/gith
ub.com/uhthomas/automata/go.mod:3: invalid go version '1.22.2': must match format 1.23
/home/thomas/code/github.com/uhthomas/automata/go.mod:5: unknown directive: toolchain
fmeum commented 2 months ago

The go_deps extension with Bzlmod has support for this directive already. Is it possible for you to migrate? Happy to review a PR as well.

uhthomas commented 2 months ago

The go_deps extension with Bzlmod has support for this directive already. Is it possible for you to migrate? Happy to review a PR as well.

I see - I'm still using rules_k8s and rules_docker. I guess I'd need to figure out how to replace them.

fmeum commented 2 months ago

Do they straight up don't work with Bzlmod? You should generally be able to keep them in WORKSPACE or WORKSPACE.bzlmod and just migrate the rest.

uhthomas commented 4 weeks ago

Do they straight up don't work with Bzlmod? You should generally be able to keep them in WORKSPACE or WORKSPACE.bzlmod and just migrate the rest.

I remember trying this on a different repository and it went horribly. Has the situation improved?

fmeum commented 4 weeks ago

I unfortunately don't know, I don't use them myself.