rules_scala icon indicating copy to clipboard operation
rules_scala copied to clipboard

Use version-aware naming for artifact repositories

Open aszady opened this issue 1 year ago • 1 comments
trafficstars

Description

It enables the logic implemented in #1562. The choice of toolchains to cover is the same as in #1566.

Now, e.g., instead of referring to the artifact's repository @io_bazel_rules_scala_scala_compiler, we ~need to~ may use the version-aware name, like @io_bazel_rules_scala_scala_compiler_3_3_0.

In future this may require an update in client's code. In particular in cases they don't use the default toolchains provided by the rules, and construct their own dependency providers. One would need to manually add the version suffix to the repository names, or use a construction like + version_suffix(SCALA_VERSION) in their code.

For now a backward compatibility layer is provided in a shape of repository with aliases, pointing to artifacts for the default Scala version.

Motivation

#1290

aszady avatar May 08 '24 13:05 aszady

Added. Out of possible solutions, two aliases worked the best for me. I also tried sth like using scala_library with single dependency, though it didn't work well with dependency checker (suggesting unused dependency). @simuons, please take a look at the revised version.

Now this PR consists of three commits:

  1. Preparation: add alias repo for backward compatibility.
  2. Do the actual change (this state demonstrates that aliases work).
  3. Cleanup: migrate all the internal rules' deps to suffixed repos.

Do you prefer to have them merged together or separately?

aszady avatar May 09 '24 14:05 aszady