From 39bd8420f6b9147af6ba3cff7bcb6fcda65f202d Mon Sep 17 00:00:00 2001 From: Mike Bland Date: Wed, 4 Dec 2024 20:13:36 -0500 Subject: [PATCH] Move `scala/{private/macros/,}toolchains_repo.bzl` Like "Move `scala_toolchains` to `scala/toolchains.bzl`", removes the `scala_toolchains_repo` symbol from `scala/scala.bzl` and makes it available from `scala/toolchains_repo.bzl`. This avoids a future `test_scala_version 2.12.20` failure during Bazel 8 builds after adding `twitter_scrooge` toolchain support in the new `test_version/version_specific_tests_dir/scrooge_repositories.bzl` file. Otherwise, this new file would load `toolchains_repo` from `scala/scala.bzl`. The `test_version/test_scala_version_.../WORKSPACE` file generated from `test_version/WORKSPACE.template` would then transitively load `.bzl` files with `rules_java` symbols, breaking the test. ```txt $ RULES_SCALA_TEST_ONLY="test_scala_version 2.12.20" ./test_version.sh ERROR: Traceback (most recent call last): File ".../external/rules_scala/scala/private/common_attributes.bzl", line 18, column 28, in "deps": attr.label_list( Error in label_list: Illegal argument: element in 'providers' is of unexpected type. Either all elements should be providers, or all elements should be lists of providers, but got list with an element of type NoneType. ERROR: Error computing the main repository mapping: at test_version/test_scala_version_.../scrooge_repositories.bzl:1:6: at .../scala/scala.bzl:30:5: at .../scala/private/rules/scala_junit_test.bzl:5:5: initialization of module 'scala/private/common_attributes.bzl' failed ``` --- scala/scala.bzl | 5 ----- scala/toolchains.bzl | 2 +- scala/{private/macros => }/toolchains_repo.bzl | 0 3 files changed, 1 insertion(+), 6 deletions(-) rename scala/{private/macros => }/toolchains_repo.bzl (100%) diff --git a/scala/scala.bzl b/scala/scala.bzl index 3e8d5187e..643b655d1 100644 --- a/scala/scala.bzl +++ b/scala/scala.bzl @@ -2,10 +2,6 @@ load( "//specs2:specs2_junit.bzl", _specs2_junit_dependencies = "specs2_junit_dependencies", ) -load( - "//scala/private:macros/toolchains_repo.bzl", - _scala_toolchains_repo = "scala_toolchains_repo", -) load( "//scala/private:macros/scala_repositories.bzl", _rules_scala_setup = "rules_scala_setup", @@ -80,4 +76,3 @@ rules_scala_toolchain_deps_repositories = _rules_scala_toolchain_deps_repositori scala_test = _scala_test scala_test_suite = _scala_test_suite setup_scala_toolchain = _setup_scala_toolchain -scala_toolchains_repo = _scala_toolchains_repo diff --git a/scala/toolchains.bzl b/scala/toolchains.bzl index a3a14e1e9..07816e384 100644 --- a/scala/toolchains.bzl +++ b/scala/toolchains.bzl @@ -2,7 +2,7 @@ load("//junit:junit.bzl", "junit_artifact_ids") load("//scala/private:macros/scala_repositories.bzl", "scala_repositories") -load("//scala/private:macros/toolchains_repo.bzl", "scala_toolchains_repo") +load("//scala:toolchains_repo.bzl", "scala_toolchains_repo") load("//scala:scala_cross_version.bzl", "default_maven_server_urls") load("//scalatest:scalatest.bzl", "scalatest_artifact_ids") load("//specs2:specs2.bzl", "specs2_artifact_ids") diff --git a/scala/private/macros/toolchains_repo.bzl b/scala/toolchains_repo.bzl similarity index 100% rename from scala/private/macros/toolchains_repo.bzl rename to scala/toolchains_repo.bzl