Skip to content

Commit

Permalink
Merge pull request #56 from lucidsoftware/annex-upgrade
Browse files Browse the repository at this point in the history
Annex upgrade
  • Loading branch information
jjudd authored Nov 18, 2024
2 parents a3048c2 + e726866 commit 5c012e7
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 43 deletions.
5 changes: 4 additions & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
32 changes: 18 additions & 14 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -138,37 +138,35 @@ 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")

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",
Expand All @@ -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_play_routes//scala:zinc_2_13",
"@rules_play_routes//scala:zinc_3",
],
)

# rules_pkg
rules_pkg_version = "1.0.1"
Expand Down
2 changes: 1 addition & 1 deletion play-routes-compiler-cli/play-routes-compiler-cli.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def generate_play_routes_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(
Expand Down
10 changes: 5 additions & 5 deletions play_routes_compiler_cli_2_13_install.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"__AUTOGENERATED_FILE_DO_NOT_MODIFY_THIS_FILE_MANUALLY": "THERE_IS_NO_DATA_ONLY_ZUUL",
"__INPUT_ARTIFACTS_HASH": -1321367170,
"__RESOLVED_ARTIFACTS_HASH": -378258452,
"__INPUT_ARTIFACTS_HASH": 1429549754,
"__RESOLVED_ARTIFACTS_HASH": 1421109904,
"artifacts": {
"com.eed3si9n:shaded-jawn-parser_2.13": {
"shasums": {
Expand Down Expand Up @@ -40,10 +40,10 @@
},
"com.google.protobuf:protobuf-java": {
"shasums": {
"jar": "e8f524c2ad5965aae31b0527bf9d4e3bc19b0dfba8c05aef114fccc7f057c94d",
"sources": "7176e76e9585a151046e456029af87e35957006f5263e1343375cf7bcd871d6e"
"jar": "ba02977c0fef8b40af9f85fe69af362d8e13f2685b49a9752750b18da726157e",
"sources": "d368a684a2fd70c482dc7f842099a939b562effeee45c9a562dba8682f7133bc"
},
"version": "3.19.4"
"version": "4.28.3"
},
"com.lmax:disruptor": {
"shasums": {
Expand Down
10 changes: 5 additions & 5 deletions play_routes_compiler_cli_3_install.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"__AUTOGENERATED_FILE_DO_NOT_MODIFY_THIS_FILE_MANUALLY": "THERE_IS_NO_DATA_ONLY_ZUUL",
"__INPUT_ARTIFACTS_HASH": 1531353200,
"__RESOLVED_ARTIFACTS_HASH": -1522521253,
"__INPUT_ARTIFACTS_HASH": -476889668,
"__RESOLVED_ARTIFACTS_HASH": 838501119,
"artifacts": {
"com.eed3si9n:shaded-jawn-parser_2.13": {
"shasums": {
Expand Down Expand Up @@ -40,10 +40,10 @@
},
"com.google.protobuf:protobuf-java": {
"shasums": {
"jar": "e8f524c2ad5965aae31b0527bf9d4e3bc19b0dfba8c05aef114fccc7f057c94d",
"sources": "7176e76e9585a151046e456029af87e35957006f5263e1343375cf7bcd871d6e"
"jar": "ba02977c0fef8b40af9f85fe69af362d8e13f2685b49a9752750b18da726157e",
"sources": "d368a684a2fd70c482dc7f842099a939b562effeee45c9a562dba8682f7133bc"
},
"version": "3.19.4"
"version": "4.28.3"
},
"com.lmax:disruptor": {
"shasums": {
Expand Down
16 changes: 4 additions & 12 deletions scala/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -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(":version.bzl", "scala_2_13_version", "scala_3_version")

Expand All @@ -17,14 +16,7 @@ runtime_classpath_3 = [
"@play_routes_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 = "@play_routes_compiler_cli_3//:org_scala_lang_scala3_sbt_bridge",
compiler_classpath = compiler_classpath_3,
Expand All @@ -50,7 +42,7 @@ runtime_classpath_2_13 = [
"@play_routes_compiler_cli_2_13//:org_scala_lang_scala_library",
]

configure_zinc_scala(
register_zinc_toolchain(
name = "zinc_2_13",
compiler_bridge = "@play_routes_compiler_cli_2_13//:org_scala_sbt_compiler_bridge_2_13",
compiler_classpath = compiler_classpath_2_13,
Expand Down
8 changes: 4 additions & 4 deletions test/play-routes-compiler-test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def generate_play_routes_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":
play_routes_toolchain_name = "play-routes-3"
Expand Down Expand Up @@ -104,7 +104,7 @@ def generate_play_routes_test_targets(scala_version):
"@play_routes_test_{}//:org_specs2_specs2_core_{}".format(scala_version_underscore, scala_version_underscore),
"@play_routes_test_{}//:org_specs2_specs2_matcher_{}".format(scala_version_underscore, scala_version_underscore),
],
scala = scala,
scala_toolchain_name = scala,
)

play_routes(
Expand Down Expand Up @@ -143,7 +143,7 @@ def generate_play_routes_test_targets(scala_version):
"@play_routes_test_{}//:org_specs2_specs2_core_{}".format(scala_version_underscore, scala_version_underscore),
"@play_routes_test_{}//:org_specs2_specs2_matcher_{}".format(scala_version_underscore, scala_version_underscore),
],
scala = scala,
scala_toolchain_name = scala,
)

scala_library(
Expand All @@ -155,5 +155,5 @@ def generate_play_routes_test_targets(scala_version):
deps = [
"@play_routes_test_{}//:org_playframework_play_{}".format(scala_version_underscore, scala_version_underscore),
],
scala = scala,
scala_toolchain_name = scala,
)
2 changes: 1 addition & 1 deletion workspace.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ load("//scala:version.bzl", "scala_2_13_version", "scala_3_version")

play_version = "3.0.4"
zinc_version = "1.10.1"
protobuf_version = "3.19.4"
protobuf_version = "4.28.3"
scopt_version = "4.1.0"

def play_routes_compiler_cli_3_repositories():
Expand Down

0 comments on commit 5c012e7

Please sign in to comment.