From abc941ac1da5792c5fdb172aa221b938d54e93ec Mon Sep 17 00:00:00 2001 From: Mike Bland Date: Wed, 2 Oct 2024 18:47:35 -0400 Subject: [PATCH 01/10] Bump Bazel and dependencies to prepare for Bzlmod This begins the Bzlmod compatibility migration by updating Bazel to version 7.3.2 and adding initial `MODULE.bazel` and `WORKSPACE.bzlmod` files. Part of: https://github.com/bazelbuild/rules_scala/issues/1482 Though Bzlmod remains disabled, updating to Bazel 7.3.2 requred updating or adding the following packages to maintain `WORKSPACE` compatibility. In `rules_scala_setup()`: - bazel_skylib: 1.4.1 => 1.7.1 - rules_cc: 0.0.6 => 0.0.10 - rules_java: 5.4.1 => 7.9.0 - rules_proto: 5.3.0-21.7 => 6.0.2 Dev dependencies in `WORKSPACE`: - com_google_protobuf: 28.2 - rules_pkg: 1.0.1 - rules_jvm_external: 6.4 - com_google_absl: abseil-cpp-20240722.0 - zlib: 1.3.1 Of all of the new, explicit dev dependencies, only `com_google_protobuf` will be necessary to include in `MODULE.bazel`. The Bzlmod mechanism will discover these other transitive dev dependencies automatically. Also removed the `rules_java_extra` repo from `WORKSPACE`, which appeared unused. --- Though the current `rules_java` version is 7.12.1, and largely works with this repo, it requires a few temporary workarounds. Rather than commit the workarounds, upgrading only to 7.9.0 now seems less crufty. What follows is a very detailed explanation of what happens with 7.12.1 with Bazel 7.3.2, just to have it on the record. --- The workaround is to change a few toolchain and macro file targets from `@bazel_tools//tools/jdk:` to `@rules_java//toolchains:`. This isn't a terribly bad or invasive workaround, but `@bazel_tools//tools/jdk:` is clearly the canonical path. Best to keep it that way, lest we build up technical debt. Without the workaround, these targets would fail: - //test/src/main/resources/java_sources:CompiledWithJava11 - //test/src/main/resources/java_sources:CompiledWithJava8 - //test/toolchains:java21_toolchain - //test:JunitRuntimePlatform - //test:JunitRuntimePlatform_test_runner - //test:scala_binary_jdk_11 with this error: ```txt ERROR: .../external/rules_java_builtin/toolchains/BUILD:254:14: While resolving toolchains for target @@rules_java_builtin//toolchains:platformclasspath (096dcc8): No matching toolchains found for types @@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type. ``` This appears to be a consequence of both upgrading the Bazel version from 6.3.0 to 7.3.2 and updating `rules_java` to 7.12.1. The `rules_java_builtin` repo is part of the `WORKSPACE` prefix that adds implicit dependencies: - https://bazel.build/external/migration#builtin-default-deps This repo was added to 7.0.0-pre.20231011.2 in the following change, mapped to `@rules_java` within the scope of the `@bazel_tools` repo: - bazelbuild/bazel: Add rules_java_builtin to the users of Java modules https://github.com/bazelbuild/bazel/commit/ff1abb29a20c91a3d797842a26fb8a6b6fac48d8 This change tried to ensure `rules_java` remained compatible with earlier Bazel versions. However, it changed all instances of `@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type` to `//toolchains:bootstrap_runtime_toolchain_type`: - bazelbuild/rules_java: Make rules_java backwards compatible with Bazel 6.3.0 https://github.com/bazelbuild/rules_java/commit/30ecf3ff6ee8f30b4df505d9d3bde5bb1c25690b Bazel has bumped `rules_java` in its `workspace_deps.bzl` from 7.9.0 to 7.11.0, but it's only available as of 8.0.0-pre.20240911.1. - bazelbuild/bazel: Update rules_java 7.11.1 / java_tools 13.8 https://github.com/bazelbuild/bazel/pull/23571 https://github.com/bazelbuild/bazel/commit/f92124acf3d0eb99d06570ddc380aca7ab354b90 --- What I believe is happening is, under Bazel 7.3.2 and `rules_java` 7.12.1: - Bazel creates `rules_java` 7.9.0 as `@rules_java_builtin` in the `WORKSPACE` prefix. - `@bazel_tools` has `@rules_java` mapped to `@rules_java_builtin` when initialized during the `WORKSPACE` prefix, during which `@bazel_tools//tools/jdk` registers `alias()` targets to `@rules_java` toolchain targets. These aliased toolchains specify `@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type` in their `toolchains` attribute. - `WORKSPACE` loads `@rules_java` 7.12.1 and registers all its toolchains with type `@rules_java//toolchains:bootstrap_runtime_toolchain_type`. - Some `@rules_java` rules explicitly specifying toolchains from `@bazel_tools//tools/jdk` can't find them, because the `@bazel_tools//tools/jdk` toolchain aliases expect toolchains of type `@bazel_tools//tools/jdk:bootstrap_runtime_toolchain_type`. This has broken other projects in the same way: - bazelbuild/bazel: [Bazel CI] Downstream project broken by rules_java upgrade #23619 https://github.com/bazelbuild/bazel/issues/23619 These problems don't appear under Bzlmod, and `@rules_java_builtin` was never required. This is because `WORKSPACE` executes its statements sequentially, while Bzlmod builds the module dependency graph _before_ instantiating repositories (within module extensions). It seems a fix is on the way that removes `@rules_java_builtin` from the `WORKSPACE` prefix, and adds `@rules_java` to the suffix. At this moment, though, it's not even in a prerelase: - bazelbuild/bazel: Remove rules_java_builtin in WORKSPACE prefix https://github.com/bazelbuild/bazel/commit/750669078e20f2c6ca7b9241e1c80564a1b8668e --- Note that the error message matches that from the following resolved issue, but that issue was for non-Bzlmod child repos when `WORKSPACE` was disabled. - bazelbuild/bazel: Undefined @@rules_java_builtin repository with --noenable_workspace option https://github.com/bazelbuild/bazel/issues/22754 --- .bazelrc | 5 ++ .bazelversion | 2 +- .gitignore | 6 +- MODULE.bazel | 8 +++ WORKSPACE | 73 ++++++++++++++++----- WORKSPACE.bzlmod | 2 + scala/private/macros/scala_repositories.bzl | 23 ++++--- test/proto_cross_repo_boundary/repo.bzl | 2 +- 8 files changed, 88 insertions(+), 33 deletions(-) create mode 100644 MODULE.bazel create mode 100644 WORKSPACE.bzlmod diff --git a/.bazelrc b/.bazelrc index b37b4dc55..cbbbb3f7f 100644 --- a/.bazelrc +++ b/.bazelrc @@ -3,3 +3,8 @@ build --enable_platform_specific_config #Windows needs --worker_quit_after_build due to workers not being shut down when the compiler tools need to be rebuilt (resulting in 'file in use' errors). See Bazel Issue#10498. build:windows --worker_quit_after_build --enable_runfiles + +# Remove these upon completing Bzlmod compatibility work. +# - https://github.com/bazelbuild/rules_scala/issues/1482 +build --noenable_bzlmod +build --enable_workspace diff --git a/.bazelversion b/.bazelversion index 798e38995..eab246c06 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -6.3.0 +7.3.2 diff --git a/.gitignore b/.gitignore index 80489aaf3..2ee329763 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,8 @@ hash2 .vscode unformatted-*.backup.scala .scala-build -test/semanticdb/tempsrc \ No newline at end of file +test/semanticdb/tempsrc + +# Consider removing after Bzlmod conversion is complete. +# - https://github.com/bazelbuild/rules_scala/issues/1482 +MODULE.bazel.lock diff --git a/MODULE.bazel b/MODULE.bazel new file mode 100644 index 000000000..a4f317a91 --- /dev/null +++ b/MODULE.bazel @@ -0,0 +1,8 @@ +"""Bazel module definition for rules_scala""" + +# Bzlmod compatibility work is currently underway. See: +# - https://github.com/bazelbuild/rules_scala/issues/1482 + +module( + name = "rules_scala", version = "6.6.1", repo_name = "io_bazel_rules_scala" +) diff --git a/WORKSPACE b/WORKSPACE index 44de58fe5..42067eb8f 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -34,13 +34,13 @@ rules_scala_setup() rules_scala_toolchain_deps_repositories(fetch_sources = True) -load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains") - -# Declares @com_google_protobuf//:protoc pointing to released binary -# This should stop building protoc during bazel build -# See https://github.com/bazelbuild/rules_proto/pull/36 +load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies") rules_proto_dependencies() +load("@rules_proto//proto:setup.bzl", "rules_proto_setup") +rules_proto_setup() + +load("@rules_proto//proto:toolchains.bzl", "rules_proto_toolchains") rules_proto_toolchains() load("//scala:scala_cross_version.bzl", "default_maven_server_urls") @@ -144,19 +144,6 @@ go_rules_dependencies() go_register_toolchains(version = "1.19.5") -# Explicitly pull in a different (newer) version of rules_java for remote jdks -rules_java_extra_version = "5.1.0" - -rules_java_extra_sha = "d974a2d6e1a534856d1b60ad6a15e57f3970d8596fbb0bb17b9ee26ca209332a" - -rules_java_extra_url = "https://github.com/bazelbuild/rules_java/releases/download/{}/rules_java-{}.tar.gz".format(rules_java_extra_version, rules_java_extra_version) - -http_archive( - name = "rules_java_extra", - sha256 = rules_java_extra_sha, - url = rules_java_extra_url, -) - load("@rules_java//java:repositories.bzl", "remote_jdk8_repos") # We need to select based on platform when we use these @@ -209,3 +196,53 @@ load("//test/toolchains:jdk.bzl", "remote_jdk21_repositories", "remote_jdk21_too remote_jdk21_repositories() remote_jdk21_toolchains() + +http_archive( + name = "com_google_protobuf", + sha256 = "b2340aa47faf7ef10a0328190319d3f3bee1b24f426d4ce8f4253b6f27ce16db", + strip_prefix = "protobuf-28.2", + url = "https://github.com/protocolbuffers/protobuf/releases/download/v28.2/protobuf-28.2.tar.gz", +) + +http_archive( + name = "rules_pkg", + sha256 = "d20c951960ed77cb7b341c2a59488534e494d5ad1d30c4818c736d57772a9fef", + url = "https://github.com/bazelbuild/rules_pkg/releases/download/1.0.1/rules_pkg-1.0.1.tar.gz", +) + +load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") + +rules_pkg_dependencies() + +RULES_JVM_EXTERNAL_TAG = "6.4" +RULES_JVM_EXTERNAL_SHA = "85776be6d8fe64abf26f463a8e12cd4c15be927348397180a01693610da7ec90" + +http_archive( + name = "rules_jvm_external", + strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG, + sha256 = RULES_JVM_EXTERNAL_SHA, + url = "https://github.com/bazel-contrib/rules_jvm_external/releases/download/%s/rules_jvm_external-%s.tar.gz" % (RULES_JVM_EXTERNAL_TAG, RULES_JVM_EXTERNAL_TAG) +) + +load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps") + +rules_jvm_external_deps() + +load("@rules_jvm_external//:setup.bzl", "rules_jvm_external_setup") + +rules_jvm_external_setup() + +http_archive( + name = "com_google_absl", + strip_prefix = "abseil-cpp-20240722.0", + sha256 = "f50e5ac311a81382da7fa75b97310e4b9006474f9560ac46f54a9967f07d4ae3", + url = "https://github.com/abseil/abseil-cpp/releases/download/20240722.0/abseil-cpp-20240722.0.tar.gz", +) + +http_archive( + name = "zlib", + strip_prefix = "zlib-1.3.1", + sha256 = "9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23", + url = "https://github.com/madler/zlib/releases/download/v1.3.1/zlib-1.3.1.tar.gz", + build_file = "@com_google_protobuf//third_party:zlib.BUILD", +) diff --git a/WORKSPACE.bzlmod b/WORKSPACE.bzlmod new file mode 100644 index 000000000..a7355e829 --- /dev/null +++ b/WORKSPACE.bzlmod @@ -0,0 +1,2 @@ +# Bzlmod compatibility work is currently underway. See: +# - https://github.com/bazelbuild/rules_scala/issues/1482 diff --git a/scala/private/macros/scala_repositories.bzl b/scala/private/macros/scala_repositories.bzl index e11f199d5..5417f9c50 100644 --- a/scala/private/macros/scala_repositories.bzl +++ b/scala/private/macros/scala_repositories.bzl @@ -85,38 +85,37 @@ def rules_scala_setup(scala_compiler_srcjar = None): if not native.existing_rule("bazel_skylib"): http_archive( name = "bazel_skylib", - sha256 = "b8a1527901774180afc798aeb28c4634bdccf19c4d98e7bdd1ce79d1fe9aaad7", + sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.4.1/bazel-skylib-1.4.1.tar.gz", - "https://github.com/bazelbuild/bazel-skylib/releases/download/1.4.1/bazel-skylib-1.4.1.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.4.1.tar.gz", + "https://github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz", ], ) if not native.existing_rule("rules_cc"): http_archive( name = "rules_cc", - urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.6/rules_cc-0.0.6.tar.gz"], - sha256 = "3d9e271e2876ba42e114c9b9bc51454e379cbf0ec9ef9d40e2ae4cec61a31b40", - strip_prefix = "rules_cc-0.0.6", + urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.10/rules_cc-0.0.10.tar.gz"], + sha256 = "65b67b81c6da378f136cc7e7e14ee08d5b9375973427eceb8c773a4f69fa7e49", + strip_prefix = "rules_cc-0.0.10", ) if not native.existing_rule("rules_java"): http_archive( name = "rules_java", urls = [ - "https://github.com/bazelbuild/rules_java/releases/download/5.4.1/rules_java-5.4.1.tar.gz", + "https://github.com/bazelbuild/rules_java/releases/download/7.9.0/rules_java-7.9.0.tar.gz", ], - sha256 = "a1f82b730b9c6395d3653032bd7e3a660f9d5ddb1099f427c1e1fe768f92e395", + sha256 = "41131de4417de70b9597e6ebd515168ed0ba843a325dc54a81b92d7af9a7b3ea", ) if not native.existing_rule("rules_proto"): http_archive( name = "rules_proto", - sha256 = "dc3fb206a2cb3441b485eb1e423165b231235a1ea9b031b4433cf7bc1fa460dd", - strip_prefix = "rules_proto-5.3.0-21.7", + sha256 = "6fb6767d1bef535310547e03247f7518b03487740c11b6c6adb7952033fe1295", + strip_prefix = "rules_proto-6.0.2", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_proto/archive/refs/tags/5.3.0-21.7.tar.gz", - "https://github.com/bazelbuild/rules_proto/archive/refs/tags/5.3.0-21.7.tar.gz", + "https://github.com/bazelbuild/rules_proto/releases/download/6.0.2/rules_proto-6.0.2.tar.gz", ], ) diff --git a/test/proto_cross_repo_boundary/repo.bzl b/test/proto_cross_repo_boundary/repo.bzl index 0f19c06d2..fe3fecf04 100644 --- a/test/proto_cross_repo_boundary/repo.bzl +++ b/test/proto_cross_repo_boundary/repo.bzl @@ -2,5 +2,5 @@ def proto_cross_repo_boundary_repository(): native.new_local_repository( name = "proto_cross_repo_boundary", path = "test/proto_cross_repo_boundary/repo", - build_file = "test/proto_cross_repo_boundary/repo/BUILD.repo", + build_file = "//test/proto_cross_repo_boundary:repo/BUILD.repo", ) From ae93717d78ecad40def57d579c5471093e2d4216 Mon Sep 17 00:00:00 2001 From: Mike Bland Date: Wed, 2 Oct 2024 20:59:27 -0400 Subject: [PATCH 02/10] Add toolchain_type to thrift_lib, scrooge aspects This fixes the following error: ```txt Error in create_header_compilation_action: Rule 'thrift_library' in 'rules_scala/test/src/main/scala/scalarules/test/twitter_scrooge/thrift/ thrift_with_compiler_args/BUILD:3:15' must declare '@@bazel_tools//tools/jdk:toolchain_type' toolchain in order to use java_common. See https://github.com/bazelbuild/bazel/issues/18970. ``` Interestingly, adding the toolchain type to `thrift_library` isn't enough; I had to add it to the twitter_scrooge aspects as well. Until I did, it produced the same error message pointing at `thrift_library`, after first reporting: ```txt ERROR: rules_scala/test/src/main/scala/scalarules/test/twitter_scrooge/ thrift/thrift_with_compiler_args/BUILD:3:15: in //twitter_scrooge:twitter_scrooge.bzl%scrooge_java_aspect aspect on thrift_library rule //test/src/main/scala/scalarules/test/twitter_scrooge/thrift/ thrift_with_compiler_args:thrift5: Traceback (most recent call last): File "rules_scala/twitter_scrooge/twitter_scrooge.bzl", line 420, column 49, in _scrooge_java_aspect_impl return _common_scrooge_aspect_implementation(target, ctx, "java", _compile_generated_java) [ ...snip... ] ``` --- scala/private/rules/scala_repl.bzl | 5 ++++- thrift/thrift.bzl | 1 + twitter_scrooge/twitter_scrooge.bzl | 21 ++++++++++++--------- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/scala/private/rules/scala_repl.bzl b/scala/private/rules/scala_repl.bzl index 6d08c8b84..49586da79 100644 --- a/scala/private/rules/scala_repl.bzl +++ b/scala/private/rules/scala_repl.bzl @@ -81,7 +81,10 @@ def make_scala_repl(*extras): common_outputs, *[extra["outputs"] for extra in extras if "outputs" in extra] ), - toolchains = ["@io_bazel_rules_scala//scala:toolchain_type"], + toolchains = [ + "@io_bazel_rules_scala//scala:toolchain_type", + "@bazel_tools//tools/jdk:toolchain_type", + ], cfg = scala_version_transition, incompatible_use_toolchain_transition = True, implementation = _scala_repl_impl, diff --git a/thrift/thrift.bzl b/thrift/thrift.bzl index dacd1050c..350c05bed 100644 --- a/thrift/thrift.bzl +++ b/thrift/thrift.bzl @@ -178,4 +178,5 @@ thrift_library = rule( }, outputs = {"libarchive": "lib%{name}.jar"}, provides = [ThriftInfo], + toolchains = ["@bazel_tools//tools/jdk:toolchain_type"], ) diff --git a/twitter_scrooge/twitter_scrooge.bzl b/twitter_scrooge/twitter_scrooge.bzl index eae327a1f..1bdef6ecd 100644 --- a/twitter_scrooge/twitter_scrooge.bzl +++ b/twitter_scrooge/twitter_scrooge.bzl @@ -443,6 +443,12 @@ common_aspect_providers = [ [ScroogeImport], ] +common_toolchains = [ + "@io_bazel_rules_scala//scala:toolchain_type", + "@io_bazel_rules_scala//twitter_scrooge/toolchain:scrooge_toolchain_type", + "@bazel_tools//tools/jdk:toolchain_type", +] + scrooge_scala_aspect = aspect( implementation = _scrooge_scala_aspect_impl, attr_aspects = ["deps"], @@ -459,10 +465,7 @@ scrooge_scala_aspect = aspect( ), provides = [ScroogeAspectInfo], required_aspect_providers = common_aspect_providers, - toolchains = [ - "@io_bazel_rules_scala//scala:toolchain_type", - "@io_bazel_rules_scala//twitter_scrooge/toolchain:scrooge_toolchain_type", - ], + toolchains = common_toolchains, incompatible_use_toolchain_transition = True, ) @@ -477,10 +480,7 @@ scrooge_java_aspect = aspect( ), provides = [ScroogeAspectInfo], required_aspect_providers = common_aspect_providers, - toolchains = [ - "@io_bazel_rules_scala//scala:toolchain_type", - "@io_bazel_rules_scala//twitter_scrooge/toolchain:scrooge_toolchain_type", - ], + toolchains = common_toolchains, incompatible_use_toolchain_transition = True, fragments = ["java"], ) @@ -557,6 +557,9 @@ scrooge_scala_import = rule( ), }, provides = [ThriftInfo, JavaInfo, ScroogeImport], - toolchains = ["@io_bazel_rules_scala//twitter_scrooge/toolchain:scrooge_toolchain_type"], + toolchains = [ + "@io_bazel_rules_scala//twitter_scrooge/toolchain:scrooge_toolchain_type", + "@bazel_tools//tools/jdk:toolchain_type", + ], incompatible_use_toolchain_transition = True, ) From 550f686762bd2cd3f7cf07d50365b546639d9bbe Mon Sep 17 00:00:00 2001 From: Mike Bland Date: Thu, 3 Oct 2024 13:14:01 -0400 Subject: [PATCH 03/10] Update tools/bazel.rc.buildkite for Bazel 7.3.2 Didn't notice this until a bunch of builds failed on #1618. --- .bazelrc | 3 +-- tools/bazel.rc.buildkite | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.bazelrc b/.bazelrc index cbbbb3f7f..128fb9d38 100644 --- a/.bazelrc +++ b/.bazelrc @@ -6,5 +6,4 @@ build:windows --worker_quit_after_build --enable_runfiles # Remove these upon completing Bzlmod compatibility work. # - https://github.com/bazelbuild/rules_scala/issues/1482 -build --noenable_bzlmod -build --enable_workspace +build --noenable_bzlmod --enable_workspace diff --git a/tools/bazel.rc.buildkite b/tools/bazel.rc.buildkite index 9d784856c..e04b1c9cb 100644 --- a/tools/bazel.rc.buildkite +++ b/tools/bazel.rc.buildkite @@ -1 +1,5 @@ build --strategy=Scalac=worker --strategy=ScroogeRule=worker --worker_max_instances=3 + +# Remove these upon completing Bzlmod compatibility work. +# - https://github.com/bazelbuild/rules_scala/issues/1482 +build --noenable_bzlmod --enable_workspace From 86ec8601bf91278a103ad1f1e0f5c36ca18d8667 Mon Sep 17 00:00:00 2001 From: Mike Bland Date: Thu, 3 Oct 2024 13:23:03 -0400 Subject: [PATCH 04/10] Update BuildKite jobs to use 7.3.2 Didn't notice this until a bunch of builds failed on #1618. --- .bazelci/presubmit.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml index 7556ffcb6..a87b6db97 100644 --- a/.bazelci/presubmit.yml +++ b/.bazelci/presubmit.yml @@ -47,16 +47,16 @@ tasks: platform: windows shell_commands: - "bash test_rules_scala.sh" - test_coverage_linux_6_3_0: + test_coverage_linux_7_3_2: name: "./test_coverage" platform: ubuntu2004 - bazel: 6.3.0 + bazel: 7.3.2 shell_commands: - "./test_coverage.sh" - test_coverage_macos_6.3.0: + test_coverage_macos_7.3.2: name: "./test_coverage" platform: macos - bazel: 6.3.0 + bazel: 7.3.2 shell_commands: - "./test_coverage.sh" test_reproducibility_linux: @@ -82,13 +82,13 @@ tasks: examples_linux: name: "./test_examples" platform: ubuntu2004 - bazel: 6.3.0 + bazel: 7.3.2 shell_commands: - "./test_examples.sh" cross_build_linux: name: "./test_cross_build" platform: ubuntu2004 - bazel: 6.3.0 + bazel: 7.3.2 shell_commands: - "./test_cross_build.sh" lint_linux: From 4a82062ae98d78d020d45cfc4bc3ce598ac885fc Mon Sep 17 00:00:00 2001 From: Mike Bland Date: Thu, 3 Oct 2024 13:35:48 -0400 Subject: [PATCH 05/10] Bump rules_go to 0.50.1, lint_fix WORKSPACE Hoping this will fix the `bazel //tools:lint_check` failures under BuildKite for #1618. Also ran `bazel run //tools:lint_fix` to fix `WORKSPACE` formatting. --- WORKSPACE | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 42067eb8f..01b253b7d 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -35,12 +35,15 @@ rules_scala_setup() rules_scala_toolchain_deps_repositories(fetch_sources = True) load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies") + rules_proto_dependencies() load("@rules_proto//proto:setup.bzl", "rules_proto_setup") + rules_proto_setup() load("@rules_proto//proto:toolchains.bzl", "rules_proto_toolchains") + rules_proto_toolchains() load("//scala:scala_cross_version.bzl", "default_maven_server_urls") @@ -127,10 +130,10 @@ format_repositories() http_archive( name = "io_bazel_rules_go", - sha256 = "dd926a88a564a9246713a9c00b35315f54cbd46b31a26d5d8fb264c07045f05d", + sha256 = "f4a9314518ca6acfa16cc4ab43b0b8ce1e4ea64b81c38d8a3772883f153346b8", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.38.1/rules_go-v0.38.1.zip", - "https://github.com/bazelbuild/rules_go/releases/download/v0.38.1/rules_go-v0.38.1.zip", + "https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.50.1/rules_go-v0.50.1.zip", + "https://github.com/bazelbuild/rules_go/releases/download/v0.50.1/rules_go-v0.50.1.zip", ], ) @@ -215,13 +218,14 @@ load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") rules_pkg_dependencies() RULES_JVM_EXTERNAL_TAG = "6.4" + RULES_JVM_EXTERNAL_SHA = "85776be6d8fe64abf26f463a8e12cd4c15be927348397180a01693610da7ec90" http_archive( name = "rules_jvm_external", - strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG, sha256 = RULES_JVM_EXTERNAL_SHA, - url = "https://github.com/bazel-contrib/rules_jvm_external/releases/download/%s/rules_jvm_external-%s.tar.gz" % (RULES_JVM_EXTERNAL_TAG, RULES_JVM_EXTERNAL_TAG) + strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG, + url = "https://github.com/bazel-contrib/rules_jvm_external/releases/download/%s/rules_jvm_external-%s.tar.gz" % (RULES_JVM_EXTERNAL_TAG, RULES_JVM_EXTERNAL_TAG), ) load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps") @@ -234,15 +238,15 @@ rules_jvm_external_setup() http_archive( name = "com_google_absl", - strip_prefix = "abseil-cpp-20240722.0", sha256 = "f50e5ac311a81382da7fa75b97310e4b9006474f9560ac46f54a9967f07d4ae3", + strip_prefix = "abseil-cpp-20240722.0", url = "https://github.com/abseil/abseil-cpp/releases/download/20240722.0/abseil-cpp-20240722.0.tar.gz", ) http_archive( name = "zlib", - strip_prefix = "zlib-1.3.1", + build_file = "@com_google_protobuf//third_party:zlib.BUILD", sha256 = "9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23", + strip_prefix = "zlib-1.3.1", url = "https://github.com/madler/zlib/releases/download/v1.3.1/zlib-1.3.1.tar.gz", - build_file = "@com_google_protobuf//third_party:zlib.BUILD", ) From 88815f69334c40f88860bec8be7bbc11663b2853 Mon Sep 17 00:00:00 2001 From: Mike Bland Date: Thu, 3 Oct 2024 16:07:04 -0400 Subject: [PATCH 06/10] Update test_version/WORKSPACE.template for 7.3.2 Updated the repo information for `bazel_skylib` and `rules_proto` directly, and copied the `rules_proto` initialization calls from `WORKSPACE`. Implemented the `append_additional_dev_dependencies()` scheme to avoid duplicating the setup for `protobuf` and its dependencies (`rules_pkg`, `rules_java_external`, `com_google_absl`, `zlib`). --- WORKSPACE | 2 ++ test_version.sh | 16 ++++++++++++++++ test_version/WORKSPACE.template | 21 +++++++++++++-------- 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 01b253b7d..39afd404e 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -200,6 +200,8 @@ remote_jdk21_repositories() remote_jdk21_toolchains() +# //test_version:WORKSPACE.template dependencies + http_archive( name = "com_google_protobuf", sha256 = "b2340aa47faf7ef10a0328190319d3f3bee1b24f426d4ce8f4253b6f27ce16db", diff --git a/test_version.sh b/test_version.sh index fab99c78c..d135604ac 100755 --- a/test_version.sh +++ b/test_version.sh @@ -26,6 +26,21 @@ compilation_should_fail() { fi } +append_additional_dev_dependencies() { + local source="$1" + local dest="$2" + local marker='# //test_version:WORKSPACE.template dependencies' + local emit_deps="" + + while IFS="" read line; do + if [[ -n "$emit_deps" ]]; then + echo "$line" >>"$dest" + elif [[ "$line" == "$marker" ]]; then + emit_deps='true' + fi + done <"$source" +} + run_in_test_repo() { local SCALA_VERSION=${SCALA_VERSION:-$SCALA_VERSION_DEFAULT} @@ -44,6 +59,7 @@ run_in_test_repo() { sed \ -e "s%\${twitter_scrooge_repositories}%$TWITTER_SCROOGE_REPOSITORIES%" \ WORKSPACE.template >> $NEW_TEST_DIR/WORKSPACE + append_additional_dev_dependencies '../WORKSPACE' "$NEW_TEST_DIR/WORKSPACE" cp ../.bazelrc $NEW_TEST_DIR/.bazelrc cd $NEW_TEST_DIR diff --git a/test_version/WORKSPACE.template b/test_version/WORKSPACE.template index 34c499f2f..38f8e9469 100644 --- a/test_version/WORKSPACE.template +++ b/test_version/WORKSPACE.template @@ -4,27 +4,32 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "bazel_skylib", - sha256 = "b8a1527901774180afc798aeb28c4634bdccf19c4d98e7bdd1ce79d1fe9aaad7", + sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.4.1/bazel-skylib-1.4.1.tar.gz", - "https://github.com/bazelbuild/bazel-skylib/releases/download/1.4.1/bazel-skylib-1.4.1.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.4.1.tar.gz", + "https://github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz", ], ) http_archive( name = "rules_proto", - sha256 = "8e7d59a5b12b233be5652e3d29f42fba01c7cbab09f6b3a8d0a57ed6d1e9a0da", - strip_prefix = "rules_proto-7e4afce6fe62dbff0a4a03450143146f9f2d7488", + sha256 = "6fb6767d1bef535310547e03247f7518b03487740c11b6c6adb7952033fe1295", + strip_prefix = "rules_proto-6.0.2", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_proto/archive/7e4afce6fe62dbff0a4a03450143146f9f2d7488.tar.gz", - "https://github.com/bazelbuild/rules_proto/archive/7e4afce6fe62dbff0a4a03450143146f9f2d7488.tar.gz", + "https://github.com/bazelbuild/rules_proto/releases/download/6.0.2/rules_proto-6.0.2.tar.gz", ], ) -load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains") +load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies") rules_proto_dependencies() +load("@rules_proto//proto:setup.bzl", "rules_proto_setup") + +rules_proto_setup() + +load("@rules_proto//proto:toolchains.bzl", "rules_proto_toolchains") + rules_proto_toolchains() local_repository( From c7e5ca7fda0f199ecd490e797ed4246da0091d6e Mon Sep 17 00:00:00 2001 From: Mike Bland Date: Thu, 3 Oct 2024 16:52:06 -0400 Subject: [PATCH 07/10] Add/update .bazelrc, WORKSPACE in examples/testing Copied the `build --noenable_bzlmod --enable_workspace` flags into the `.bazelrc` files. Updated the `rules_proto` initialization stanzas. --- examples/testing/multi_frameworks_toolchain/.bazelrc | 4 ++++ examples/testing/multi_frameworks_toolchain/WORKSPACE | 8 +++++++- examples/testing/scalatest_repositories/.bazelrc | 3 +++ examples/testing/scalatest_repositories/WORKSPACE | 8 +++++++- examples/testing/specs2_junit_repositories/.bazelrc | 6 +++++- examples/testing/specs2_junit_repositories/WORKSPACE | 8 +++++++- 6 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 examples/testing/scalatest_repositories/.bazelrc diff --git a/examples/testing/multi_frameworks_toolchain/.bazelrc b/examples/testing/multi_frameworks_toolchain/.bazelrc index 6cd4a6699..ea2d01c3f 100644 --- a/examples/testing/multi_frameworks_toolchain/.bazelrc +++ b/examples/testing/multi_frameworks_toolchain/.bazelrc @@ -1,2 +1,6 @@ build --enable_platform_specific_config windows:build --enable_runfiles + +# Remove these upon completing Bzlmod compatibility work. +# - https://github.com/bazelbuild/rules_scala/issues/1482 +build --noenable_bzlmod --enable_workspace diff --git a/examples/testing/multi_frameworks_toolchain/WORKSPACE b/examples/testing/multi_frameworks_toolchain/WORKSPACE index ea4eb2f35..99070db6f 100644 --- a/examples/testing/multi_frameworks_toolchain/WORKSPACE +++ b/examples/testing/multi_frameworks_toolchain/WORKSPACE @@ -30,10 +30,16 @@ rules_scala_setup() rules_scala_toolchain_deps_repositories(fetch_sources = True) -load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains") +load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies") rules_proto_dependencies() +load("@rules_proto//proto:setup.bzl", "rules_proto_setup") + +rules_proto_setup() + +load("@rules_proto//proto:toolchains.bzl", "rules_proto_toolchains") + rules_proto_toolchains() load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains") diff --git a/examples/testing/scalatest_repositories/.bazelrc b/examples/testing/scalatest_repositories/.bazelrc new file mode 100644 index 000000000..c1a736cf2 --- /dev/null +++ b/examples/testing/scalatest_repositories/.bazelrc @@ -0,0 +1,3 @@ +# Remove these upon completing Bzlmod compatibility work. +# - https://github.com/bazelbuild/rules_scala/issues/1482 +build --noenable_bzlmod --enable_workspace diff --git a/examples/testing/scalatest_repositories/WORKSPACE b/examples/testing/scalatest_repositories/WORKSPACE index 546f9e00b..cf4f74009 100644 --- a/examples/testing/scalatest_repositories/WORKSPACE +++ b/examples/testing/scalatest_repositories/WORKSPACE @@ -30,10 +30,16 @@ rules_scala_setup() rules_scala_toolchain_deps_repositories(fetch_sources = True) -load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains") +load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies") rules_proto_dependencies() +load("@rules_proto//proto:setup.bzl", "rules_proto_setup") + +rules_proto_setup() + +load("@rules_proto//proto:toolchains.bzl", "rules_proto_toolchains") + rules_proto_toolchains() load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains") diff --git a/examples/testing/specs2_junit_repositories/.bazelrc b/examples/testing/specs2_junit_repositories/.bazelrc index 80890a133..ea2d01c3f 100644 --- a/examples/testing/specs2_junit_repositories/.bazelrc +++ b/examples/testing/specs2_junit_repositories/.bazelrc @@ -1,2 +1,6 @@ build --enable_platform_specific_config -windows:build --enable_runfiles \ No newline at end of file +windows:build --enable_runfiles + +# Remove these upon completing Bzlmod compatibility work. +# - https://github.com/bazelbuild/rules_scala/issues/1482 +build --noenable_bzlmod --enable_workspace diff --git a/examples/testing/specs2_junit_repositories/WORKSPACE b/examples/testing/specs2_junit_repositories/WORKSPACE index 3d67bf00d..8bbce2ccf 100644 --- a/examples/testing/specs2_junit_repositories/WORKSPACE +++ b/examples/testing/specs2_junit_repositories/WORKSPACE @@ -30,10 +30,16 @@ rules_scala_setup() rules_scala_toolchain_deps_repositories(fetch_sources = True) -load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains") +load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies") rules_proto_dependencies() +load("@rules_proto//proto:setup.bzl", "rules_proto_setup") + +rules_proto_setup() + +load("@rules_proto//proto:toolchains.bzl", "rules_proto_toolchains") + rules_proto_toolchains() load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains") From 8d8525220ec28f5614978428464152ca032c0f6f Mon Sep 17 00:00:00 2001 From: Mike Bland Date: Thu, 3 Oct 2024 22:30:18 -0400 Subject: [PATCH 08/10] Bump bazel_skylib in WORKSPACE, call protobuf_deps --- WORKSPACE | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 39afd404e..37e83a6d9 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -4,10 +4,10 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "bazel_skylib", - sha256 = "b8a1527901774180afc798aeb28c4634bdccf19c4d98e7bdd1ce79d1fe9aaad7", + sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.4.1/bazel-skylib-1.4.1.tar.gz", - "https://github.com/bazelbuild/bazel-skylib/releases/download/1.4.1/bazel-skylib-1.4.1.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz", + "https://github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz", ], ) @@ -252,3 +252,7 @@ http_archive( strip_prefix = "zlib-1.3.1", url = "https://github.com/madler/zlib/releases/download/v1.3.1/zlib-1.3.1.tar.gz", ) + +load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") + +protobuf_deps() From 10647bacf3dcaa2228eea4ea30bf926b462ee756 Mon Sep 17 00:00:00 2001 From: Mike Bland Date: Fri, 4 Oct 2024 15:18:15 -0400 Subject: [PATCH 09/10] Fix all test_examples and test_version WORKSPACEs Updated the `WORKSPACE` to import fewer protobuf deps, which required importing an up to date `@platforms` and `@rules_pkg` earlier in the file. Copied these setup stanzas to all the testing example projects that need it. `./test_examples.sh` now passes completely. `bazel build //test/...` and `./test_version.sh` still hang, but the latter doesn't break on its `WORKSPACE` configuration. --- My working theory is that this breakage from `bazel build //test/proto3:all` provides a hint as to why the other protoc jobs hang: ```txt ERROR: .../test/proto3/BUILD:14:14: ProtoScalaPBRule test/proto3/generated-proto-lib_jvm_extra_protobuf_generator_scalapb.srcjar failed: (Exit 1): scalapb_worker failed: error executing ProtoScalaPBRule command (from target //test/proto3:generated-proto-lib) bazel-out/darwin_arm64-opt-exec-ST-a828a81199fe/bin/src/scala/scripts/scalapb_worker ... (remaining 2 arguments skipped) Could not find file in descriptor database: bazel-out/darwin_arm64-fastbuild/bin/test/proto3/generated.proto: No such file or directory java.lang.RuntimeException: Exit with code 1 at scala.sys.package$.error(package.scala:30) at scripts.ScalaPBWorker$.work(ScalaPBWorker.scala:44) at io.bazel.rulesscala.worker.Worker.persistentWorkerMain(Worker.java:96) at io.bazel.rulesscala.worker.Worker.workerMain(Worker.java:49) at scripts.ScalaPBWorker$.main(ScalaPBWorker.scala:39) at scripts.ScalaPBWorker.main(ScalaPBWorker.scala) Use --verbose_failures to see the command lines of failed build steps. ERROR: .../test/proto3/BUILD:14:14 Building source jar bazel-out/darwin_arm64-fastbuild/bin/test/proto3/generated-proto-lib_scalapb-src.jar failed: (Exit 1): scalapb_worker failed: error executing ProtoScalaPBRule command (from target //test/proto3:generated-proto-lib) bazel-out/darwin_arm64-opt-exec-ST-a828a81199fe/bin/src/scala/scripts/scalapb_worker ... (remaining 2 arguments skipped) ``` If we can fix this, I think we might fix the hanging jobs, too. --- I'm focusing on this problem because migrating to Bzlmod will require using these newer versions of `@rules_proto` and `@com_google_protobuf`. It's the same problem I saw after successfully building the rest of the repo under Bzlmod, and it keeps these dependencies revlocked even under `WORKSPACE`. It's a problem that we need to solve one way or the other. I also tried to revert everything else to master but `@rules_proto` and `@com_google_protobuf`, but that didn't work. I wound up having to creep up the versions of other packages until I'd updated most of them again. I can try to update Bazel and all the dependencies _other_ than `@rules_proto` and `@com_google_protobuf` and get those merged first, if that's possible. Then I can try to create a pull request focused only on the protobuf problem. --- On another note: Now I know why `WORKSPACE` must be destroyed. I tried creating macros for these protobuf dependency stanzas, but was stymied by repo ordering errors. Duplicating all these stanzas has made me feel rather filthy. Bzlmod is definitely a superior experience once it's implemented. All of this config will just live in the top level rules_scala module. These example projects won't have to duplicate anything but the statements required to import it. --- WORKSPACE | 87 +++++++------------ examples/crossbuild/.bazelrc | 3 + examples/crossbuild/WORKSPACE | 45 +++++++++- examples/scala3/.bazelrc | 3 + examples/scala3/WORKSPACE | 45 +++++++++- examples/semanticdb/.bazelrc | 3 + examples/semanticdb/WORKSPACE | 45 ++++++++-- .../multi_frameworks_toolchain/WORKSPACE | 36 +++++++- .../testing/scalatest_repositories/WORKSPACE | 36 +++++++- .../specs2_junit_repositories/WORKSPACE | 36 +++++++- test_version.sh | 16 ---- test_version/WORKSPACE.template | 30 +++++++ 12 files changed, 289 insertions(+), 96 deletions(-) create mode 100644 examples/crossbuild/.bazelrc create mode 100644 examples/scala3/.bazelrc create mode 100644 examples/semanticdb/.bazelrc diff --git a/WORKSPACE b/WORKSPACE index 37e83a6d9..e6684eb01 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -2,6 +2,15 @@ workspace(name = "io_bazel_rules_scala") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +http_archive( + name = "platforms", + urls = [ + "https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz", + "https://github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz", + ], + sha256 = "218efe8ee736d26a3572663b374a253c012b716d8af0c07e842e82f238a0a7ee", +) + http_archive( name = "bazel_skylib", sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f", @@ -15,6 +24,16 @@ load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") bazel_skylib_workspace() +http_archive( + name = "rules_pkg", + sha256 = "d20c951960ed77cb7b341c2a59488534e494d5ad1d30c4818c736d57772a9fef", + url = "https://github.com/bazelbuild/rules_pkg/releases/download/1.0.1/rules_pkg-1.0.1.tar.gz", +) + +load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") + +rules_pkg_dependencies() + _build_tools_release = "5.1.0" http_archive( @@ -46,6 +65,17 @@ load("@rules_proto//proto:toolchains.bzl", "rules_proto_toolchains") rules_proto_toolchains() +http_archive( + name = "com_google_protobuf", + sha256 = "b2340aa47faf7ef10a0328190319d3f3bee1b24f426d4ce8f4253b6f27ce16db", + strip_prefix = "protobuf-28.2", + url = "https://github.com/protocolbuffers/protobuf/releases/download/v28.2/protobuf-28.2.tar.gz", +) + +load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") + +protobuf_deps() + load("//scala:scala_cross_version.bzl", "default_maven_server_urls") load("//twitter_scrooge:twitter_scrooge.bzl", "twitter_scrooge") @@ -199,60 +229,3 @@ load("//test/toolchains:jdk.bzl", "remote_jdk21_repositories", "remote_jdk21_too remote_jdk21_repositories() remote_jdk21_toolchains() - -# //test_version:WORKSPACE.template dependencies - -http_archive( - name = "com_google_protobuf", - sha256 = "b2340aa47faf7ef10a0328190319d3f3bee1b24f426d4ce8f4253b6f27ce16db", - strip_prefix = "protobuf-28.2", - url = "https://github.com/protocolbuffers/protobuf/releases/download/v28.2/protobuf-28.2.tar.gz", -) - -http_archive( - name = "rules_pkg", - sha256 = "d20c951960ed77cb7b341c2a59488534e494d5ad1d30c4818c736d57772a9fef", - url = "https://github.com/bazelbuild/rules_pkg/releases/download/1.0.1/rules_pkg-1.0.1.tar.gz", -) - -load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") - -rules_pkg_dependencies() - -RULES_JVM_EXTERNAL_TAG = "6.4" - -RULES_JVM_EXTERNAL_SHA = "85776be6d8fe64abf26f463a8e12cd4c15be927348397180a01693610da7ec90" - -http_archive( - name = "rules_jvm_external", - sha256 = RULES_JVM_EXTERNAL_SHA, - strip_prefix = "rules_jvm_external-%s" % RULES_JVM_EXTERNAL_TAG, - url = "https://github.com/bazel-contrib/rules_jvm_external/releases/download/%s/rules_jvm_external-%s.tar.gz" % (RULES_JVM_EXTERNAL_TAG, RULES_JVM_EXTERNAL_TAG), -) - -load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps") - -rules_jvm_external_deps() - -load("@rules_jvm_external//:setup.bzl", "rules_jvm_external_setup") - -rules_jvm_external_setup() - -http_archive( - name = "com_google_absl", - sha256 = "f50e5ac311a81382da7fa75b97310e4b9006474f9560ac46f54a9967f07d4ae3", - strip_prefix = "abseil-cpp-20240722.0", - url = "https://github.com/abseil/abseil-cpp/releases/download/20240722.0/abseil-cpp-20240722.0.tar.gz", -) - -http_archive( - name = "zlib", - build_file = "@com_google_protobuf//third_party:zlib.BUILD", - sha256 = "9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23", - strip_prefix = "zlib-1.3.1", - url = "https://github.com/madler/zlib/releases/download/v1.3.1/zlib-1.3.1.tar.gz", -) - -load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") - -protobuf_deps() diff --git a/examples/crossbuild/.bazelrc b/examples/crossbuild/.bazelrc new file mode 100644 index 000000000..c1a736cf2 --- /dev/null +++ b/examples/crossbuild/.bazelrc @@ -0,0 +1,3 @@ +# Remove these upon completing Bzlmod compatibility work. +# - https://github.com/bazelbuild/rules_scala/issues/1482 +build --noenable_bzlmod --enable_workspace diff --git a/examples/crossbuild/WORKSPACE b/examples/crossbuild/WORKSPACE index 4711fc376..448c0200e 100644 --- a/examples/crossbuild/WORKSPACE +++ b/examples/crossbuild/WORKSPACE @@ -2,15 +2,34 @@ workspace(name = "cross_build") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +http_archive( + name = "platforms", + urls = [ + "https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz", + "https://github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz", + ], + sha256 = "218efe8ee736d26a3572663b374a253c012b716d8af0c07e842e82f238a0a7ee", +) + http_archive( name = "bazel_skylib", - sha256 = "d00f1389ee20b60018e92644e0948e16e350a7707219e7a390fb0a99b6ec9262", + sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.7.0/bazel-skylib-1.7.0.tar.gz", - "https://github.com/bazelbuild/bazel-skylib/releases/download/1.7.0/bazel-skylib-1.7.0.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz", + "https://github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz", ], ) +http_archive( + name = "rules_pkg", + sha256 = "d20c951960ed77cb7b341c2a59488534e494d5ad1d30c4818c736d57772a9fef", + url = "https://github.com/bazelbuild/rules_pkg/releases/download/1.0.1/rules_pkg-1.0.1.tar.gz", +) + +load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") + +rules_pkg_dependencies() + local_repository( name = "io_bazel_rules_scala", path = "../..", @@ -37,12 +56,30 @@ rules_scala_setup() rules_scala_toolchain_deps_repositories() -load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains") +load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies") rules_proto_dependencies() +load("@rules_proto//proto:setup.bzl", "rules_proto_setup") + +rules_proto_setup() + +load("@rules_proto//proto:toolchains.bzl", "rules_proto_toolchains") + rules_proto_toolchains() +http_archive( + name = "com_google_protobuf", + sha256 = "b2340aa47faf7ef10a0328190319d3f3bee1b24f426d4ce8f4253b6f27ce16db", + strip_prefix = "protobuf-28.2", + url = "https://github.com/protocolbuffers/protobuf/releases/download/v28.2/protobuf-28.2.tar.gz", +) + +load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") + +protobuf_deps() + + load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains") scala_register_toolchains() diff --git a/examples/scala3/.bazelrc b/examples/scala3/.bazelrc new file mode 100644 index 000000000..c1a736cf2 --- /dev/null +++ b/examples/scala3/.bazelrc @@ -0,0 +1,3 @@ +# Remove these upon completing Bzlmod compatibility work. +# - https://github.com/bazelbuild/rules_scala/issues/1482 +build --noenable_bzlmod --enable_workspace diff --git a/examples/scala3/WORKSPACE b/examples/scala3/WORKSPACE index 07933b4b7..121f0964c 100644 --- a/examples/scala3/WORKSPACE +++ b/examples/scala3/WORKSPACE @@ -2,15 +2,34 @@ workspace(name = "specs2_junit_repositories") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +http_archive( + name = "platforms", + urls = [ + "https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz", + "https://github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz", + ], + sha256 = "218efe8ee736d26a3572663b374a253c012b716d8af0c07e842e82f238a0a7ee", +) + http_archive( name = "bazel_skylib", - sha256 = "b8a1527901774180afc798aeb28c4634bdccf19c4d98e7bdd1ce79d1fe9aaad7", + sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.4.1/bazel-skylib-1.4.1.tar.gz", - "https://github.com/bazelbuild/bazel-skylib/releases/download/1.4.1/bazel-skylib-1.4.1.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz", + "https://github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz", ], ) +http_archive( + name = "rules_pkg", + sha256 = "d20c951960ed77cb7b341c2a59488534e494d5ad1d30c4818c736d57772a9fef", + url = "https://github.com/bazelbuild/rules_pkg/releases/download/1.0.1/rules_pkg-1.0.1.tar.gz", +) + +load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") + +rules_pkg_dependencies() + local_repository( name = "io_bazel_rules_scala", path = "../..", @@ -30,12 +49,30 @@ rules_scala_setup() rules_scala_toolchain_deps_repositories(fetch_sources = True) -load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains") +load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies") rules_proto_dependencies() +load("@rules_proto//proto:setup.bzl", "rules_proto_setup") + +rules_proto_setup() + +load("@rules_proto//proto:toolchains.bzl", "rules_proto_toolchains") + rules_proto_toolchains() +http_archive( + name = "com_google_protobuf", + sha256 = "b2340aa47faf7ef10a0328190319d3f3bee1b24f426d4ce8f4253b6f27ce16db", + strip_prefix = "protobuf-28.2", + url = "https://github.com/protocolbuffers/protobuf/releases/download/v28.2/protobuf-28.2.tar.gz", +) + +load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") + +protobuf_deps() + + load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains") scala_register_toolchains() diff --git a/examples/semanticdb/.bazelrc b/examples/semanticdb/.bazelrc new file mode 100644 index 000000000..c1a736cf2 --- /dev/null +++ b/examples/semanticdb/.bazelrc @@ -0,0 +1,3 @@ +# Remove these upon completing Bzlmod compatibility work. +# - https://github.com/bazelbuild/rules_scala/issues/1482 +build --noenable_bzlmod --enable_workspace diff --git a/examples/semanticdb/WORKSPACE b/examples/semanticdb/WORKSPACE index 99b58d10b..6a90c228e 100644 --- a/examples/semanticdb/WORKSPACE +++ b/examples/semanticdb/WORKSPACE @@ -2,18 +2,34 @@ workspace(name = "specs2_junit_repositories") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -skylib_version = "1.4.1" +http_archive( + name = "platforms", + urls = [ + "https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz", + "https://github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz", + ], + sha256 = "218efe8ee736d26a3572663b374a253c012b716d8af0c07e842e82f238a0a7ee", +) http_archive( name = "bazel_skylib", - sha256 = "b8a1527901774180afc798aeb28c4634bdccf19c4d98e7bdd1ce79d1fe9aaad7", - type = "tar.gz", + sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/{}/bazel-skylib-{}.tar.gz".format(skylib_version, skylib_version), - "https://github.com/bazelbuild/bazel-skylib/releases/download/{}/bazel-skylib-{}.tar.gz".format(skylib_version, skylib_version), + "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz", + "https://github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz", ], ) +http_archive( + name = "rules_pkg", + sha256 = "d20c951960ed77cb7b341c2a59488534e494d5ad1d30c4818c736d57772a9fef", + url = "https://github.com/bazelbuild/rules_pkg/releases/download/1.0.1/rules_pkg-1.0.1.tar.gz", +) + +load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") + +rules_pkg_dependencies() + local_repository( name = "io_bazel_rules_scala", path = "../..", @@ -33,12 +49,29 @@ rules_scala_setup() rules_scala_toolchain_deps_repositories(fetch_sources = True) -load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains") +load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies") rules_proto_dependencies() +load("@rules_proto//proto:setup.bzl", "rules_proto_setup") + +rules_proto_setup() + +load("@rules_proto//proto:toolchains.bzl", "rules_proto_toolchains") + rules_proto_toolchains() +http_archive( + name = "com_google_protobuf", + sha256 = "b2340aa47faf7ef10a0328190319d3f3bee1b24f426d4ce8f4253b6f27ce16db", + strip_prefix = "protobuf-28.2", + url = "https://github.com/protocolbuffers/protobuf/releases/download/v28.2/protobuf-28.2.tar.gz", +) + +load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") + +protobuf_deps() + #Register and use the custom toolchain that has semanticdb enabled register_toolchains( "//:semanticdb_toolchain", diff --git a/examples/testing/multi_frameworks_toolchain/WORKSPACE b/examples/testing/multi_frameworks_toolchain/WORKSPACE index 99070db6f..5af282e6e 100644 --- a/examples/testing/multi_frameworks_toolchain/WORKSPACE +++ b/examples/testing/multi_frameworks_toolchain/WORKSPACE @@ -2,15 +2,34 @@ workspace(name = "multi_frameworks_toolchain") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +http_archive( + name = "platforms", + urls = [ + "https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz", + "https://github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz", + ], + sha256 = "218efe8ee736d26a3572663b374a253c012b716d8af0c07e842e82f238a0a7ee", +) + http_archive( name = "bazel_skylib", - sha256 = "b8a1527901774180afc798aeb28c4634bdccf19c4d98e7bdd1ce79d1fe9aaad7", + sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.4.1/bazel-skylib-1.4.1.tar.gz", - "https://github.com/bazelbuild/bazel-skylib/releases/download/1.4.1/bazel-skylib-1.4.1.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz", + "https://github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz", ], ) +http_archive( + name = "rules_pkg", + sha256 = "d20c951960ed77cb7b341c2a59488534e494d5ad1d30c4818c736d57772a9fef", + url = "https://github.com/bazelbuild/rules_pkg/releases/download/1.0.1/rules_pkg-1.0.1.tar.gz", +) + +load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") + +rules_pkg_dependencies() + local_repository( name = "io_bazel_rules_scala", path = "../../..", @@ -42,6 +61,17 @@ load("@rules_proto//proto:toolchains.bzl", "rules_proto_toolchains") rules_proto_toolchains() +http_archive( + name = "com_google_protobuf", + sha256 = "b2340aa47faf7ef10a0328190319d3f3bee1b24f426d4ce8f4253b6f27ce16db", + strip_prefix = "protobuf-28.2", + url = "https://github.com/protocolbuffers/protobuf/releases/download/v28.2/protobuf-28.2.tar.gz", +) + +load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") + +protobuf_deps() + load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains") scala_register_toolchains() diff --git a/examples/testing/scalatest_repositories/WORKSPACE b/examples/testing/scalatest_repositories/WORKSPACE index cf4f74009..0bfee8880 100644 --- a/examples/testing/scalatest_repositories/WORKSPACE +++ b/examples/testing/scalatest_repositories/WORKSPACE @@ -2,15 +2,34 @@ workspace(name = "scalatest_repositories") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +http_archive( + name = "platforms", + urls = [ + "https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz", + "https://github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz", + ], + sha256 = "218efe8ee736d26a3572663b374a253c012b716d8af0c07e842e82f238a0a7ee", +) + http_archive( name = "bazel_skylib", - sha256 = "b8a1527901774180afc798aeb28c4634bdccf19c4d98e7bdd1ce79d1fe9aaad7", + sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.4.1/bazel-skylib-1.4.1.tar.gz", - "https://github.com/bazelbuild/bazel-skylib/releases/download/1.4.1/bazel-skylib-1.4.1.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz", + "https://github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz", ], ) +http_archive( + name = "rules_pkg", + sha256 = "d20c951960ed77cb7b341c2a59488534e494d5ad1d30c4818c736d57772a9fef", + url = "https://github.com/bazelbuild/rules_pkg/releases/download/1.0.1/rules_pkg-1.0.1.tar.gz", +) + +load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") + +rules_pkg_dependencies() + local_repository( name = "io_bazel_rules_scala", path = "../../..", @@ -42,6 +61,17 @@ load("@rules_proto//proto:toolchains.bzl", "rules_proto_toolchains") rules_proto_toolchains() +http_archive( + name = "com_google_protobuf", + sha256 = "b2340aa47faf7ef10a0328190319d3f3bee1b24f426d4ce8f4253b6f27ce16db", + strip_prefix = "protobuf-28.2", + url = "https://github.com/protocolbuffers/protobuf/releases/download/v28.2/protobuf-28.2.tar.gz", +) + +load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") + +protobuf_deps() + load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains") scala_register_toolchains() diff --git a/examples/testing/specs2_junit_repositories/WORKSPACE b/examples/testing/specs2_junit_repositories/WORKSPACE index 8bbce2ccf..e158c6306 100644 --- a/examples/testing/specs2_junit_repositories/WORKSPACE +++ b/examples/testing/specs2_junit_repositories/WORKSPACE @@ -2,15 +2,34 @@ workspace(name = "specs2_junit_repositories") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +http_archive( + name = "platforms", + urls = [ + "https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz", + "https://github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz", + ], + sha256 = "218efe8ee736d26a3572663b374a253c012b716d8af0c07e842e82f238a0a7ee", +) + http_archive( name = "bazel_skylib", - sha256 = "b8a1527901774180afc798aeb28c4634bdccf19c4d98e7bdd1ce79d1fe9aaad7", + sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f", urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.4.1/bazel-skylib-1.4.1.tar.gz", - "https://github.com/bazelbuild/bazel-skylib/releases/download/1.4.1/bazel-skylib-1.4.1.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz", + "https://github.com/bazelbuild/bazel-skylib/releases/download/1.7.1/bazel-skylib-1.7.1.tar.gz", ], ) +http_archive( + name = "rules_pkg", + sha256 = "d20c951960ed77cb7b341c2a59488534e494d5ad1d30c4818c736d57772a9fef", + url = "https://github.com/bazelbuild/rules_pkg/releases/download/1.0.1/rules_pkg-1.0.1.tar.gz", +) + +load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") + +rules_pkg_dependencies() + local_repository( name = "io_bazel_rules_scala", path = "../../..", @@ -42,6 +61,17 @@ load("@rules_proto//proto:toolchains.bzl", "rules_proto_toolchains") rules_proto_toolchains() +http_archive( + name = "com_google_protobuf", + sha256 = "b2340aa47faf7ef10a0328190319d3f3bee1b24f426d4ce8f4253b6f27ce16db", + strip_prefix = "protobuf-28.2", + url = "https://github.com/protocolbuffers/protobuf/releases/download/v28.2/protobuf-28.2.tar.gz", +) + +load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") + +protobuf_deps() + load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains") scala_register_toolchains() diff --git a/test_version.sh b/test_version.sh index d135604ac..fab99c78c 100755 --- a/test_version.sh +++ b/test_version.sh @@ -26,21 +26,6 @@ compilation_should_fail() { fi } -append_additional_dev_dependencies() { - local source="$1" - local dest="$2" - local marker='# //test_version:WORKSPACE.template dependencies' - local emit_deps="" - - while IFS="" read line; do - if [[ -n "$emit_deps" ]]; then - echo "$line" >>"$dest" - elif [[ "$line" == "$marker" ]]; then - emit_deps='true' - fi - done <"$source" -} - run_in_test_repo() { local SCALA_VERSION=${SCALA_VERSION:-$SCALA_VERSION_DEFAULT} @@ -59,7 +44,6 @@ run_in_test_repo() { sed \ -e "s%\${twitter_scrooge_repositories}%$TWITTER_SCROOGE_REPOSITORIES%" \ WORKSPACE.template >> $NEW_TEST_DIR/WORKSPACE - append_additional_dev_dependencies '../WORKSPACE' "$NEW_TEST_DIR/WORKSPACE" cp ../.bazelrc $NEW_TEST_DIR/.bazelrc cd $NEW_TEST_DIR diff --git a/test_version/WORKSPACE.template b/test_version/WORKSPACE.template index 38f8e9469..44a23b7e4 100644 --- a/test_version/WORKSPACE.template +++ b/test_version/WORKSPACE.template @@ -2,6 +2,15 @@ workspace(name = "io_bazel_rules_scala_test") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +http_archive( + name = "platforms", + urls = [ + "https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz", + "https://github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz", + ], + sha256 = "218efe8ee736d26a3572663b374a253c012b716d8af0c07e842e82f238a0a7ee", +) + http_archive( name = "bazel_skylib", sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f", @@ -11,6 +20,16 @@ http_archive( ], ) +http_archive( + name = "rules_pkg", + sha256 = "d20c951960ed77cb7b341c2a59488534e494d5ad1d30c4818c736d57772a9fef", + url = "https://github.com/bazelbuild/rules_pkg/releases/download/1.0.1/rules_pkg-1.0.1.tar.gz", +) + +load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") + +rules_pkg_dependencies() + http_archive( name = "rules_proto", sha256 = "6fb6767d1bef535310547e03247f7518b03487740c11b6c6adb7952033fe1295", @@ -32,6 +51,17 @@ load("@rules_proto//proto:toolchains.bzl", "rules_proto_toolchains") rules_proto_toolchains() +http_archive( + name = "com_google_protobuf", + sha256 = "b2340aa47faf7ef10a0328190319d3f3bee1b24f426d4ce8f4253b6f27ce16db", + strip_prefix = "protobuf-28.2", + url = "https://github.com/protocolbuffers/protobuf/releases/download/v28.2/protobuf-28.2.tar.gz", +) + +load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") + +protobuf_deps() + local_repository( name = "io_bazel_rules_scala", path = "../../" From 6268e9015ad5a86b724ed843f32ffd2d750c3f19 Mon Sep 17 00:00:00 2001 From: Mike Bland Date: Fri, 4 Oct 2024 15:49:52 -0400 Subject: [PATCH 10/10] Fix formatting of @platforms 0.0.10 stanzas Forgot to run `bazel run //tools:lint_fix` first. --- WORKSPACE | 2 +- examples/crossbuild/WORKSPACE | 3 +-- examples/scala3/WORKSPACE | 3 +-- examples/semanticdb/WORKSPACE | 2 +- examples/testing/multi_frameworks_toolchain/WORKSPACE | 2 +- examples/testing/scalatest_repositories/WORKSPACE | 2 +- examples/testing/specs2_junit_repositories/WORKSPACE | 2 +- 7 files changed, 7 insertions(+), 9 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index e6684eb01..965864f7d 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -4,11 +4,11 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "platforms", + sha256 = "218efe8ee736d26a3572663b374a253c012b716d8af0c07e842e82f238a0a7ee", urls = [ "https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz", "https://github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz", ], - sha256 = "218efe8ee736d26a3572663b374a253c012b716d8af0c07e842e82f238a0a7ee", ) http_archive( diff --git a/examples/crossbuild/WORKSPACE b/examples/crossbuild/WORKSPACE index 448c0200e..f7dbc86a0 100644 --- a/examples/crossbuild/WORKSPACE +++ b/examples/crossbuild/WORKSPACE @@ -4,11 +4,11 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "platforms", + sha256 = "218efe8ee736d26a3572663b374a253c012b716d8af0c07e842e82f238a0a7ee", urls = [ "https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz", "https://github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz", ], - sha256 = "218efe8ee736d26a3572663b374a253c012b716d8af0c07e842e82f238a0a7ee", ) http_archive( @@ -79,7 +79,6 @@ load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") protobuf_deps() - load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains") scala_register_toolchains() diff --git a/examples/scala3/WORKSPACE b/examples/scala3/WORKSPACE index 121f0964c..69e049b29 100644 --- a/examples/scala3/WORKSPACE +++ b/examples/scala3/WORKSPACE @@ -4,11 +4,11 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "platforms", + sha256 = "218efe8ee736d26a3572663b374a253c012b716d8af0c07e842e82f238a0a7ee", urls = [ "https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz", "https://github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz", ], - sha256 = "218efe8ee736d26a3572663b374a253c012b716d8af0c07e842e82f238a0a7ee", ) http_archive( @@ -72,7 +72,6 @@ load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") protobuf_deps() - load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains") scala_register_toolchains() diff --git a/examples/semanticdb/WORKSPACE b/examples/semanticdb/WORKSPACE index 6a90c228e..4df2c5f11 100644 --- a/examples/semanticdb/WORKSPACE +++ b/examples/semanticdb/WORKSPACE @@ -4,11 +4,11 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "platforms", + sha256 = "218efe8ee736d26a3572663b374a253c012b716d8af0c07e842e82f238a0a7ee", urls = [ "https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz", "https://github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz", ], - sha256 = "218efe8ee736d26a3572663b374a253c012b716d8af0c07e842e82f238a0a7ee", ) http_archive( diff --git a/examples/testing/multi_frameworks_toolchain/WORKSPACE b/examples/testing/multi_frameworks_toolchain/WORKSPACE index 5af282e6e..342c5ed54 100644 --- a/examples/testing/multi_frameworks_toolchain/WORKSPACE +++ b/examples/testing/multi_frameworks_toolchain/WORKSPACE @@ -4,11 +4,11 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "platforms", + sha256 = "218efe8ee736d26a3572663b374a253c012b716d8af0c07e842e82f238a0a7ee", urls = [ "https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz", "https://github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz", ], - sha256 = "218efe8ee736d26a3572663b374a253c012b716d8af0c07e842e82f238a0a7ee", ) http_archive( diff --git a/examples/testing/scalatest_repositories/WORKSPACE b/examples/testing/scalatest_repositories/WORKSPACE index 0bfee8880..dbbb87cfa 100644 --- a/examples/testing/scalatest_repositories/WORKSPACE +++ b/examples/testing/scalatest_repositories/WORKSPACE @@ -4,11 +4,11 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "platforms", + sha256 = "218efe8ee736d26a3572663b374a253c012b716d8af0c07e842e82f238a0a7ee", urls = [ "https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz", "https://github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz", ], - sha256 = "218efe8ee736d26a3572663b374a253c012b716d8af0c07e842e82f238a0a7ee", ) http_archive( diff --git a/examples/testing/specs2_junit_repositories/WORKSPACE b/examples/testing/specs2_junit_repositories/WORKSPACE index e158c6306..bde42c4f8 100644 --- a/examples/testing/specs2_junit_repositories/WORKSPACE +++ b/examples/testing/specs2_junit_repositories/WORKSPACE @@ -4,11 +4,11 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "platforms", + sha256 = "218efe8ee736d26a3572663b374a253c012b716d8af0c07e842e82f238a0a7ee", urls = [ "https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz", "https://github.com/bazelbuild/platforms/releases/download/0.0.10/platforms-0.0.10.tar.gz", ], - sha256 = "218efe8ee736d26a3572663b374a253c012b716d8af0c07e842e82f238a0a7ee", ) http_archive(