bazelbuild / rules_scala

Scala rules for Bazel
Apache License 2.0
363 stars 275 forks source link

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

Open nlou9 opened 2 months ago

nlou9 commented 2 months ago

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",
    }
    }
)
lukaszwawrzyk commented 2 months ago

Handling artifact override seems to be a missed feature during multiversion implementation. Until fixed you need to stay with versions that are hardcoded in rules_scala.

The good news is that we will soon bump the scala versions. Additionally we hope to implement a solution that will make the bumps delivered faster. The specific issue under this ticket should be fixed as well.

nlou9 commented 2 months ago

good to know version bump to 2.13.14 is on the way. Do you have the ETA?

lukaszwawrzyk commented 2 months ago

https://github.com/bazelbuild/rules_scala/pull/1597 PR is here, so it is the matter if getting it through CI, review and a release.

simuons commented 2 months ago

@nlou9 sorry for delay. Version bump PR was merged. Thanks @lukaszwawrzyk