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
Extract dev_deps_repositories() from WORKSPACE and remove //private (bazel-contrib#1656)
* Extract dev_deps_repositories() from WORKSPACE
`dev_deps_repositories()` encapsulates the instantiation of repositories
used only for `rules_scala` development. Also removes the unused
`//private` package and its `WORKSPACE` statements. Part of bazel-contrib#1482.
Both `WORKSPACE` and Bzlmod builds can use this macro, though how Bzlmod
will use it will depend on whether we continue building with Bazel 6.
`@bazel_tools//tools/build_defs/repo:local.bzl` isn't available under
Bazel 6. To continue building with Bazel 6 under Bzlmod, we will need to
call `dev_deps_repositories()` from `WORKSPACE.bzlmod` to continue using
`native.{,new_}local_repository()`.
If we switch to Bazel 7, we can load `local.bzl` and strip the `native.`
prefix from the `{,new_}local_repository()` calls. Then we can call
`dev_deps_repositories()` from a module extension instead of from
`WORKSPACE.bzlmod`.
Another alternative would be updating the local repositories to become
proper nested repositories. Then we can call `local_repository()` from
`WORKSPACE` and call `bazel_dep()` and `local_path_override()` from
`MODULE.bazel`. In that case, we'd remove the `{,new_}local_repository`
calls from `dev_deps_dependencies()`, and remove
`proto_cross_repo_boundary_repository()` entirely.
* Add test local_repository calls to WORKSPACE
Removes `native.{,new_}local_repository()` calls in macros in favor of
`local_repository` calls from `WORKSPACE`. Part of bazel-contrib#1482.
`native.{,new_}local_repository()` isn't available under Bzlmod,
`@bazel_tools//tools/build_defs/repo:local.bzl` with the Starlarkified
definitions isn't available under Bazel 6, and Bazel 8 compatibility
work is imminent. Redefining the repositories in this way will be
compatible with Bazel 6, 7, and 8, both under `WORKSPACE` and Bzlmod.
(`MODULE.bazel` will use a combination of `bazel_dep()` and
`local_path_override()`.)
0 commit comments