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
jparraga@U-1DJORH1PD9VGC:~/code/rules_go_issue$ bazel build ...
ERROR: /home/jparraga/code/rules_go_issue/BUILD.bazel:12:11: no such package '@[unknown repo 'org_golang_x_exp' requested from @]//slog': The repository '@[unknown repo 'org_golang_x_exp' requested from @]' could not be resolved: No repository visible as '@org_golang_x_exp' from main repository and referenced by '//:rules_go_issue_lib'
ERROR: Analysis of target '//:rules_go_issue_lib' failed; build aborted: Analysis failed
INFO: Elapsed time: 0.138s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (2 packages loaded, 2 targets configured)
This error message implies that the repository has not been added, so once I do add the repository I get this error.
jparraga@U-1DJORH1PD9VGC:~/code/rules_go_issue$ bazel build ...
ERROR: Analysis of target '//:rules_go_issue_lib' failed; build aborted: module extension "go_deps" from "@gazelle~0.30.0//:extensions.bzl" does not generate repository "org_golang_x_exp", yet it is imported as "org_golang_x_exp"in the usage at <root>/MODULE.bazel:11:24 (did you mean 'org_golang_x_text'?)
INFO: Elapsed time: 1.318s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (63 packages loaded, 353 targets configured)
In a separate project with a lot more dependencies I get the following error:
ERROR: <redacted>/BUILD.bazel:3:11: no such package '@org_golang_x_exp//slog': BUILD file not found in directory 'slog' of external repository @org_golang_x_exp. Add a BUILD file to a directory to mark it as a package. and referenced by '<redacted>'
This error seems to be similar to bazel-contrib/bazel-gazelle#1468 but I'm unsure how to solve it since I'm using bzlmod instead.
The text was updated successfully, but these errors were encountered:
Your go.mod doesn't list any dependencies, in particular not on golang.org/x/exp. After adding "org_golang_x_exp" to use_repo and running bazel run @rules_go//go -- get golang.org/x/exp, the build passes.
Hope that helped, please reopen if the issue persists.
Hope that helped, please reopen if the issue persists.
Thanks that worked. On the example project I did later get a prompt to modify my go.mod but for some reason never got that prompt on the larger project I'm working on. I thought maybe it didn't have to be imported since it could have been part of the standard library. Regardless, it works in both cases so thank you.
What version of rules_go are you using?
0.39.1
What version of gazelle are you using?
0.30.0
What version of Bazel are you using?
6.2
Does this issue reproduce with the latest releases of all the above?
Yes
What operating system and processor architecture are you using?
x86 Ubuntu
What did you do?
I tried to use
slog
which is an experimental package.What did you expect to see?
I would expect
slog
to work just like any other part of the standard library.What did you see instead?
I am not able to use
slog
a project is configured using bzlmod. Sample project: https://github.com/Sovietaced/rules_go_issueThis error message implies that the repository has not been added, so once I do add the repository I get this error.
In a separate project with a lot more dependencies I get the following error:
This error seems to be similar to bazel-contrib/bazel-gazelle#1468 but I'm unsure how to solve it since I'm using bzlmod instead.
The text was updated successfully, but these errors were encountered: