Extract dev_deps_repositories()
from WORKSPACE and remove //private
#1656
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
dev_deps_repositories()
encapsulates the instantiation of repositories used only forrules_scala
development. Also removes the unused//private
package and itsWORKSPACE
statements. Part of #1482 and #1652.Replaces existing
new_local_repository
calls with complete nested repositories (with their ownWORKSPACE
files) andlocal_repository
calls in the mainWORKSPACE
file. The first commit, however, callsnative.{,new_}local_repository
insidedev_deps_repositories()
, in case we wish to use that implementation instead.Motivation
Both
WORKSPACE
and Bzlmod builds can use this macro. However, the two commits in this pull request reflect different strategies towards handling the existingnew_local_repository
calls.Either way, we need to update the
new_local_repository
calls because:native.{,new_}local_repository()
aren't available under Bzlmod (Support Bzlmod and add rules_scala to bazel-central-registry #1482).@bazel_tools//tools/build_defs/repo:local.bzl
with the Starlarkified definitions isn't available under Bazel 6.There are two paths we can go by (but in the long run, there's still time to change the road we're on):
Replacing the
new_local_repository
instances with complete nested repositories is compatible with Bazel 6, 7, and 8, both underWORKSPACE
and Bzlmod. (MODULE.bazel
will use a combination ofbazel_dep()
andlocal_path_override()
.) That's the change reflected by the pull request as a whole.If keeping the
new_local_repository
calls is preferable, we'll have to usenative.new_local_repository
andnative.local_repository
indev_deps_repositories()
. Then, when we switch to building with Bazel 7 by default, we'll have to loadlocal.bzl
and strip thenative.
prefixes.