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?
Probably yes, I can try later but my understanding of the code is that it is a problem with how GOPACKAGESDRIVER_BAZEL_QUERY_SCOPE was implemented.
What operating system and processor architecture are you using?
Linux AMD64
Any other potentially useful information about your toolchain?
N/A
What did you do?
While trying to use rules_go gopackagedriver with VSCode IDE, I noticed that if GOPACKAGESDRIVER_BAZEL_QUERY_SCOPE is used we seem to be getting no results back.
Using a wrapper script I was able to determine what the arguments VSCode (through gopls) give to rules_go's gopackagedriver. The arguments were "./..." and "bultin".
Below is the minimum reproducible snippet:
echo {} | GOPACKAGESDRIVER_BAZEL_QUERY_SCOPE=//path/to/my/target bazel run -- @io_bazel_rules_go//go/tools/gopackagesdriver ./... builtin
I believe the comment in this PR by @fmeum : https://github.com/bazelbuild/rules_go/pull/3688/files#r1321005945 is particularly relevant. There is an implicit assumption that if GOPACKAGESDRIVER_BAZEL_QUERY_SCOPE all queries need to be kind("%s", attr(importpath, "%s", deps(%s))) type of query. I would argue the right behavior is actually intersection with deps($GOPACKAGESDRIVER_BAZEL_QUERY_SCOPE) which seems related to what the comment suggested
You can see in the output above that for handling the builtin request we should definetly not be using kind("go_library", attr(importpath, "builtin", deps(//path/to/my/target)) as searching on importpath = bultin is probably not what was intended.
What did you expect to see?
I was expecting to have at least some packages returned back and for them to be transitive dependencies of the target I gave as the GOPACKAGESDRIVER_BAZEL_QUERY_SCOPE env variable
What did you see instead?
No packages returned.
The text was updated successfully, but these errors were encountered:
waltercacau
changed the title
GOPACKAGESDRIVER_BAZEL_QUERY_SCOPE implementation is not compatible with multiple requests from gopls
GOPACKAGESDRIVER_BAZEL_QUERY_SCOPE implementation is not with "./..." and "bultin" args at the same time
Jul 31, 2024
What version of rules_go are you using?
v0.46.0
What version of gazelle are you using?
v0.35.0
What version of Bazel are you using?
6.3.2
Does this issue reproduce with the latest releases of all the above?
Probably yes, I can try later but my understanding of the code is that it is a problem with how GOPACKAGESDRIVER_BAZEL_QUERY_SCOPE was implemented.
What operating system and processor architecture are you using?
Linux AMD64
Any other potentially useful information about your toolchain?
N/A
What did you do?
While trying to use rules_go gopackagedriver with VSCode IDE, I noticed that if GOPACKAGESDRIVER_BAZEL_QUERY_SCOPE is used we seem to be getting no results back.
Using a wrapper script I was able to determine what the arguments VSCode (through gopls) give to rules_go's gopackagedriver. The arguments were "./..." and "bultin".
Below is the minimum reproducible snippet:
Result:
I believe the comment in this PR by @fmeum : https://github.com/bazelbuild/rules_go/pull/3688/files#r1321005945 is particularly relevant. There is an implicit assumption that if GOPACKAGESDRIVER_BAZEL_QUERY_SCOPE all queries need to be
kind("%s", attr(importpath, "%s", deps(%s)))
type of query. I would argue the right behavior is actually intersection withdeps($GOPACKAGESDRIVER_BAZEL_QUERY_SCOPE)
which seems related to what the comment suggestedYou can see in the output above that for handling the builtin request we should definetly not be using
kind("go_library", attr(importpath, "builtin", deps(//path/to/my/target))
as searching on importpath = bultin is probably not what was intended.What did you expect to see?
I was expecting to have at least some packages returned back and for them to be transitive dependencies of the target I gave as the
GOPACKAGESDRIVER_BAZEL_QUERY_SCOPE
env variableWhat did you see instead?
No packages returned.
The text was updated successfully, but these errors were encountered: