-
Notifications
You must be signed in to change notification settings - Fork 367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'invalid use of internal package' in IDE in external tests #1778
Comments
@JamyDev Did we run into this issue? If so, how did you solve it? |
This may still be an outstanding issue in our setup. Will have a look when I have time. |
After a quick sanity check, it does not seem to be related to bazelbuild/rules_go#3845. @scaiper could you somehow set up a repro repository? Our initial sanity check seemed to give proper results for the PkgPath for the ext test. |
@JamyDev Here is the demo repository https://github.com/scaiper/pkg_path_demo
|
What version of gazelle are you using?
v0.36.0
What version of rules_go are you using?
v0.46.0
What version of Bazel are you using?
7.1.1
Does this issue reproduce with the latest releases of all the above?
Yes
What operating system and processor architecture are you using?
Linux amd64
What did you do?
Created external go test inside some
internal
package.Run gazelle.
Open IDE using gopls with gopackagesdriver from rules_go.
What did you expect to see?
Code navigation should work as usual.
What did you see instead?
An "invalid use of internal package" errors in imports.
This happens due to incorrect PkgPath in gopackagesdriver output. Gazelle do not specify importpath for
go_test
targets, as a result gopackagesdriver in rules_go is unable to infer correct importpath.While correct importpath is not needed to build or test
go_test
targets, I do not know how to fix this issue without specifying it.Maybe relevant bazelbuild/rules_go#3845
The text was updated successfully, but these errors were encountered: