rules_scala icon indicating copy to clipboard operation
rules_scala copied to clipboard

Bump the scala version to 2.13.14 with rules_scala_toolchain_deps_repositories for multi-version

Open nlou9 opened this issue 1 year ago • 4 comments
trafficstars

The new release 6.6.0 support cross-compilation. I want to bump the scala version to 2.13.14 by overriding the artifacts. It turns out that it will override for both 2.12.18 and 2.13.14 with the artifacts which are supposed to be just for 2.13.14.
I think it is due to the hardcoded artifacts id https://github.com/bazelbuild/rules_scala/blob/6c6ba4e31cb56c038fe9967efd222007d73fd5cf/scala/private/macros/scala_repositories.bzl#L126 which doesn't have version suffix.

Is there a way to achieve it to use scala 2.13.14?

scala_config(
    scala_version = "2.13.14", # Default Scala version
    scala_versions = [
        "2.12.18",
        "2.13.14",
    ],
)
scala_version = "2.13.14"
rules_scala_toolchain_deps_repositories(
    fetch_sources = True,
    overriden_artifacts = {
    "io_bazel_rules_scala_scala_library": {
        "artifact": "org.scala-lang:scala-library:%s" % scala_version,
        "sha256": "43e0ca1583df1966eaf02f0fbddcfb3784b995dd06bfc907209347758ce4b7e3",
    },
    "io_bazel_rules_scala_scala_compiler": {
        "artifact": "org.scala-lang:scala-compiler:%s" % scala_version,
        "sha256": "17b7e1dd95900420816a3bc2788c8c7358c2a3c42899765a5c463a46bfa569a6",
    },
    "io_bazel_rules_scala_scala_reflect": {
        "artifact": "org.scala-lang:scala-reflect:%s" % scala_version,
        "sha256": "8846baaa8cf43b1b19725ab737abff145ca58d14a4d02e75d71ca8f7ca5f2926",
    }
    }
)

nlou9 avatar Aug 08 '24 16:08 nlou9