diff --git a/.bazelrc b/.bazelrc index 2396a7d..76757fe 100644 --- a/.bazelrc +++ b/.bazelrc @@ -6,7 +6,10 @@ build --strategy=worker,sandboxed,local build --verbose_failures build --incompatible_strict_action_env -build --experimental_worker_multiplex_sandboxing +# Disable multiplex sandboxing because there is a bug that causes files which +# should be in the sandbox to not be. Not sure if this is a Bazel bug or a rule +# set bug. Something we need to deal with either way. +#build --experimental_worker_multiplex_sandboxing build --experimental_worker_cancellation build --worker_sandboxing diff --git a/WORKSPACE b/WORKSPACE index 737118b..abd70e1 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -138,15 +138,18 @@ go_rules_dependencies() go_register_toolchains(version = "1.23.0") -# Also for buildifier. Comes from -# https://github.com/bazelbuild/buildtools/blob/master/buildifier/README.md -protobuf_version = "3.19.4" +# protobuf + +protobuf_tag = "28.3" + +protobuf_sha256 = "5b2ff0f72e85dc1350b7bb1b4ea94d7e92e297f7a58b630e46fa6b430b5b253b" http_archive( name = "com_google_protobuf", - sha256 = "3bd7828aa5af4b13b99c191e8b1e884ebfa9ad371b0ce264605d347f135d2568", - strip_prefix = "protobuf-{}".format(protobuf_version), - url = "https://github.com/protocolbuffers/protobuf/archive/v{}.tar.gz".format(protobuf_version), + sha256 = protobuf_sha256, + strip_prefix = "protobuf-{}".format(protobuf_tag), + type = "zip", + url = "https://github.com/protocolbuffers/protobuf/archive/v{}.zip".format(protobuf_tag), ) load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") @@ -154,21 +157,16 @@ load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") protobuf_deps() # higherkindness/rules_scala -rules_scala_annex_version = "f23c16037db66efb541dbbf5e17e6604886c85ff" +rules_scala_annex_version = "lucid_2024-11-17" http_archive( name = "rules_scala_annex", - integrity = "sha256-b/cPeh6J1Mq63u6fSWdEHAKL/kWfPhZcNL7m9If7PWM=", + integrity = "sha256-+hiIcio0oFrcBvl43W19GzOytd7zSo7oZkU314w/Xf4=", strip_prefix = "rules_scala-{}".format(rules_scala_annex_version), type = "zip", url = "https://github.com/lucidsoftware/rules_scala/archive/{}.zip".format(rules_scala_annex_version), ) -bind( - name = "default_scala", - actual = "//scala:default_scala", -) - load( "@rules_scala_annex//rules/scala:workspace.bzl", "scala_register_toolchains", @@ -181,7 +179,13 @@ load("@annex//:defs.bzl", annex_pinned_maven_install = "pinned_maven_install") annex_pinned_maven_install() -scala_register_toolchains() +scala_register_toolchains( + default_scala_toolchain_name = "zinc_3", + toolchains = [ + "@rules_twirl//scala:zinc_2_13", + "@rules_twirl//scala:zinc_3", + ], +) # rules_pkg rules_pkg_version = "1.0.1" diff --git a/scala/BUILD.bazel b/scala/BUILD.bazel index ec2fdca..4dbf5ca 100644 --- a/scala/BUILD.bazel +++ b/scala/BUILD.bazel @@ -1,7 +1,6 @@ load( - "@rules_scala_annex//rules:scala.bzl", - "configure_bootstrap_scala", - "configure_zinc_scala", + "@rules_scala_annex//rules:register_toolchain.bzl", + "register_zinc_toolchain", ) load("//:workspace.bzl", "scala_2_13_version", "scala_3_version") @@ -17,14 +16,7 @@ runtime_classpath_3 = [ "@twirl_compiler_cli_3//:org_scala_lang_tasty_core_3", ] -configure_bootstrap_scala( - name = "bootstrap_3", - compiler_classpath = compiler_classpath_3, - runtime_classpath = runtime_classpath_3, - version = scala_3_version, -) - -configure_zinc_scala( +register_zinc_toolchain( name = "zinc_3", compiler_bridge = "@twirl_compiler_cli_3//:org_scala_lang_scala3_sbt_bridge", compiler_classpath = compiler_classpath_3, @@ -50,7 +42,7 @@ runtime_classpath_2_13 = [ "@twirl_compiler_cli_2_13//:org_scala_lang_scala_library", ] -configure_zinc_scala( +register_zinc_toolchain( name = "zinc_2_13", compiler_bridge = "@twirl_compiler_cli_2_13//:org_scala_sbt_compiler_bridge_2_13", compiler_classpath = compiler_classpath_2_13, diff --git a/test/twirl-compiler-test.bzl b/test/twirl-compiler-test.bzl index 0664275..2e77cb0 100644 --- a/test/twirl-compiler-test.bzl +++ b/test/twirl-compiler-test.bzl @@ -5,7 +5,7 @@ def generate_twirl_test_targets(scala_version): # For example 2.13 -> 2-13 or 2_13 scala_version_dash = scala_version.replace(".", "-") scala_version_underscore = scala_version.replace(".", "_") - scala = "//scala:zinc_{}".format(scala_version_underscore) + scala = "zinc_{}".format(scala_version_underscore) if scala_version == "3": twirl_toolchain_name = "twirl-3" diff --git a/twirl-compiler-cli/twirl-compiler-cli.bzl b/twirl-compiler-cli/twirl-compiler-cli.bzl index 45da02b..d10c5a8 100644 --- a/twirl-compiler-cli/twirl-compiler-cli.bzl +++ b/twirl-compiler-cli/twirl-compiler-cli.bzl @@ -33,7 +33,7 @@ def generate_twirl_compiler_targets(scala_version): "@rules_scala_annex//src/main/scala/higherkindness/rules_scala/common/sandbox", "@rules_scala_annex//src/main/scala/higherkindness/rules_scala/common/worker", ], - scala = "//scala:zinc_{}".format(scala_version_underscore), + scala_toolchain_name = "zinc_{}".format(scala_version_underscore), ) java_binary( diff --git a/twirl_compiler_cli_2_13_install.json b/twirl_compiler_cli_2_13_install.json index cd3010c..79fbc37 100644 --- a/twirl_compiler_cli_2_13_install.json +++ b/twirl_compiler_cli_2_13_install.json @@ -1,10 +1,7 @@ { "__AUTOGENERATED_FILE_DO_NOT_MODIFY_THIS_FILE_MANUALLY": "THERE_IS_NO_DATA_ONLY_ZUUL", - "__INPUT_ARTIFACTS_HASH": -672116877, - "__RESOLVED_ARTIFACTS_HASH": 1507769908, - "conflict_resolution": { - "com.google.protobuf:protobuf-java:3.19.4": "com.google.protobuf:protobuf-java:3.19.6" - }, + "__INPUT_ARTIFACTS_HASH": 1604980415, + "__RESOLVED_ARTIFACTS_HASH": -512094826, "artifacts": { "com.eed3si9n:shaded-jawn-parser_2.13": { "shasums": { @@ -43,10 +40,10 @@ }, "com.google.protobuf:protobuf-java": { "shasums": { - "jar": "6a9a2dff91dcf71f85be71ae971f6164b5a631dcd34bff08f0618535ca44ad02", - "sources": "98118edf28c74f173b25d8fce03f86ff95d61009df0c66324333573ec842f5d3" + "jar": "ba02977c0fef8b40af9f85fe69af362d8e13f2685b49a9752750b18da726157e", + "sources": "d368a684a2fd70c482dc7f842099a939b562effeee45c9a562dba8682f7133bc" }, - "version": "3.19.6" + "version": "4.28.3" }, "com.lihaoyi:sourcecode_2.13": { "shasums": { diff --git a/twirl_compiler_cli_3_install.json b/twirl_compiler_cli_3_install.json index f1eb9e9..f17579e 100644 --- a/twirl_compiler_cli_3_install.json +++ b/twirl_compiler_cli_3_install.json @@ -1,10 +1,7 @@ { "__AUTOGENERATED_FILE_DO_NOT_MODIFY_THIS_FILE_MANUALLY": "THERE_IS_NO_DATA_ONLY_ZUUL", - "__INPUT_ARTIFACTS_HASH": -99106801, - "__RESOLVED_ARTIFACTS_HASH": 2083207216, - "conflict_resolution": { - "com.google.protobuf:protobuf-java:3.19.4": "com.google.protobuf:protobuf-java:3.19.6" - }, + "__INPUT_ARTIFACTS_HASH": 863368003, + "__RESOLVED_ARTIFACTS_HASH": 1103106450, "artifacts": { "com.eed3si9n:shaded-jawn-parser_2.13": { "shasums": { @@ -43,10 +40,10 @@ }, "com.google.protobuf:protobuf-java": { "shasums": { - "jar": "6a9a2dff91dcf71f85be71ae971f6164b5a631dcd34bff08f0618535ca44ad02", - "sources": "98118edf28c74f173b25d8fce03f86ff95d61009df0c66324333573ec842f5d3" + "jar": "ba02977c0fef8b40af9f85fe69af362d8e13f2685b49a9752750b18da726157e", + "sources": "d368a684a2fd70c482dc7f842099a939b562effeee45c9a562dba8682f7133bc" }, - "version": "3.19.6" + "version": "4.28.3" }, "com.lihaoyi:sourcecode_2.13": { "shasums": { diff --git a/workspace.bzl b/workspace.bzl index fe4b206..4103c66 100644 --- a/workspace.bzl +++ b/workspace.bzl @@ -10,7 +10,7 @@ scala_2_13_version = "2.13.14" twirl_version = "2.0.7" zinc_version = "1.10.1" -protobuf_version = "3.19.4" +protobuf_version = "4.28.3" scopt_version = "4.1.0" def twirl_compiler_cli_3_repositories():