rules_scala
rules_scala copied to clipboard
Update repo name handling for Bzlmod compatibility
Description
Fixes various repository name related errors when building under Bzlmod, while remaining backwards compatible with WORKSPACE. See the first commit message for details on the problems solved by this change.
This change also includes a couple of other minor touch-ups:
-
Updated the
runtime_depsattribute inrepositories()to add the Scala version suffix, just likedeps. -
Added a
fail()message torepositories()to make it more clear which Scala version dictionary is missing an artifact. -
Removed unnecessary internal uses of the
@io_bazel_rules_scalarepo name, applyingLabel()where necessary. -
Updated the construction of
dep_providersin_default_dep_providersto remove the repo name, reduce duplication, and make the upcoming toolchain update slightly cleaner.
Motivation
Part of adding Bzlmod support per #1482.
I've created bazelbuild/bazel-skylib#548 containing the apparent_repo_name macro with full unit tests. If the maintainers accept that change, we can bump our bazel_skylib version to use the macro from there, and remove the bzlmod.bzl file.