rules_scala icon indicating copy to clipboard operation
rules_scala copied to clipboard

Update repo name handling for Bzlmod compatibility

Open mbland opened this issue 1 year ago • 3 comments
trafficstars

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_deps attribute in repositories() to add the Scala version suffix, just like deps.

  • Added a fail() message to repositories() to make it more clear which Scala version dictionary is missing an artifact.

  • Removed unnecessary internal uses of the @io_bazel_rules_scala repo name, applying Label() where necessary.

  • Updated the construction of dep_providers in _default_dep_providers to 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.

mbland avatar Oct 14 '24 21:10 mbland