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
Fix @rules_proto circular dep under WORKSPACE
Fixed by using `scala_proto_default_repositories` directly instead of
the `scala_proto_repositories` wrapper macro.
The problem was that `scala/private/macros/toolchains.bzl` had to load
`scala_proto/scala_proto.bzl` to get the previous macro definition. That
file defines `scala_proto_library` as a wrapper around a macro of the
same name from `scala_proto/private/scala_proto.bzl`. That file, in
turn, loads `@rules_proto//proto:defs.bzl`.
However, `scala_toolchains` from `scala/private/macros/toolchains.bzl`
is what now calls `scala_repositories`, which calls `rules_scala_setup`,
which instantiates the `rules_scala` repo. This wasn't a problem under
Bzlmod, but when building with `--noenable_bzlmod --enable_workspace`,
this happened:
```txt
ERROR: Failed to load Starlark extension
'@@rules_proto//proto:repositories.bzl'.
Cycle in the workspace file detected.
This indicates that a repository is used prior to being defined.
The following chain of repository dependencies lead to the missing definition.
- @@rules_proto
This could either mean you have to add the '@@rules_proto' repository
with a statement like `http_archive` in your WORKSPACE file
(note that transitive dependencies are not added automatically),
or move an existing definition earlier in your WORKSPACE file.
ERROR: Error computing the main repository mapping:
cycles detected during computation of main repo mapping
```
0 commit comments