Skip to content

Bazel build: No repository visible as '@rules_go' #4460

@lschlacher

Description

@lschlacher

The following bazel build error was received when trying to update from github.com/open-policy-agent/opa v0.70.0 to github.com/open-policy-agent/opa v1.8.0. It targets a Go Monorepo with Bazel + Gazelle + rules_go (Bzlmod enabled).

ERROR: error loading package '@@gazelle~~go_deps~com_github_lestrrat_go_jwx_v3//jwk': Unable to find package for @@[unknown repo 'rules_go' requested from @@gazelle~~go_deps~com_github_lestrrat_go_jwx_v3 (did you mean 'rules_cc'?)]//go:def.bzl: The repository '@@[unknown repo 'rules_go' requested from @@gazelle~~go_deps~com_github_lestrrat_go_jwx_v3 (did you mean 'rules_cc'?)]' could not be resolved: No repository visible as '@rules_go' from repository '@@gazelle~~go_deps~com_github_lestrrat_go_jwx_v3'. ERROR: /home/lukas/.cache/bazel/_bazel_lukas/900f15fa8982dac93cf1f3f7d5adf494/external/gazelle~~go_deps~com_github_open_policy_agent_opa/v1/topdown/BUILD.bazel:3:11: error loading package '@@gazelle~~go_deps~com_github_lestrrat_go_jwx_v3//jwk': Unable to find package for @@[unknown repo 'rules_go' requested from @@gazelle~~go_deps~com_github_lestrrat_go_jwx_v3 (did you mean 'rules_cc'?)]//go:def.bzl: The repository '@@[unknown repo 'rules_go' requested from @@gazelle~~go_deps~com_github_lestrrat_go_jwx_v3 (did you mean 'rules_cc'?)]' could not be resolved: No repository visible as '@rules_go' from repository '@@gazelle~~go_deps~com_github_lestrrat_go_jwx_v3'. and referenced by '@@gazelle~~go_deps~com_github_open_policy_agent_opa//v1/topdown:topdown' ERROR: Analysis of target '//bzlmod:go_default_library' failed; build aborted: Analysis failed INFO: Elapsed time: 2.102s, Critical Path: 0.04s INFO: 1 process: 1 internal. ERROR: Build did NOT complete successfully

A minimal example is given in this repository.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions