Skip to content
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

go-jsonnet fails as a dependency in bzlmod using Gazelle #779

Open
antholeole opened this issue Dec 18, 2024 · 0 comments
Open

go-jsonnet fails as a dependency in bzlmod using Gazelle #779

antholeole opened this issue Dec 18, 2024 · 0 comments

Comments

@antholeole
Copy link

antholeole commented Dec 18, 2024

x-post from stackoverflow

I've put together an MVP for a build failure relating to gazelle and com_github_google_go_jsonnet: https://github.com/antholeole/bug-repro/tree/bazel

in short, I have a BUILD.bazel that looks like this:

go_library(
    name = "src_lib",
    srcs = ["main.go"],
    importpath = "repro/src",
    visibility = ["//visibility:private"],
    deps = ["@com_github_google_go_jsonnet//:go-jsonnet"],
)

building the target (in the repro, //src:src) gives the following output:

no such package '@@[unk
nown repo 'cpp_jsonnet' requested from @@gazelle++go_deps+com_github_google_go_jsonnet]//stdlib': The repository '@@[unknown repo 'cpp_jsonnet' requested from @@gazelle++go_deps+com_
github_google_go_jsonnet]' could not be resolved: No repository visible as '@cpp_jsonnet' from repository '@@gazelle++go_deps+com_github_google_go_jsonnet' and referenced by '@@gazel
le++go_deps+com_github_google_go_jsonnet//astgen:dumpstdlibast'

is there any way to supply the dependency with @cpp_jsonnet? I've tried to add a module that looks like that to the MODULE.bazel (the error changed but did not go away completely), but it smells like an antipattern. Hopefully there's an easier way to get jsonnet with gazelle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant