From c88ad3164c0a4d2bdbffc74bf56432056fe1e448 Mon Sep 17 00:00:00 2001 From: shrijeet-tesla <55768965+shrijeet-tesla@users.noreply.github.com> Date: Thu, 2 Jun 2022 15:59:32 -0700 Subject: [PATCH] Upgrade bazel to latest stable release (#57) --- .bazelversion | 2 +- WORKSPACE | 91 +++++++++++++++++++++++++++++++-------------------- 2 files changed, 57 insertions(+), 36 deletions(-) diff --git a/.bazelversion b/.bazelversion index 47b322c..ac14c3d 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -3.4.1 +5.1.1 diff --git a/WORKSPACE b/WORKSPACE index c1b4a1d..60fe077 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -1,22 +1,44 @@ -# Maven load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file") load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") load("//3rdparty:workspace.bzl", "maven_dependencies") +#-- Skylib begin --# +http_archive( + name = "bazel_skylib", + sha256 = "f7be3474d42aae265405a592bb7da8e171919d74c16f082a5457840f06054728", + url = "https://github.com/bazelbuild/bazel-skylib/releases/download/1.2.1/bazel-skylib-1.2.1.tar.gz", +) + +load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") + +bazel_skylib_workspace() + +load("@bazel_skylib//lib:versions.bzl", "versions") + +versions.check( + # Maximum version is inclusive, so set the maximum minor version to 99. + # This allows us to freely switch between minor versions without touching the WORKSPACE file. + maximum_bazel_version = "5.99.0", + minimum_bazel_version = "5.0.0", +) +#-- Skylib end --# + +#-- Maven start --# maven_dependencies() git_repository( name = "com_github_johnynek_bazel_jar_jar", commit = "171f268569384c57c19474b04aebe574d85fde0d", - remote = "git://github.com/johnynek/bazel_jar_jar.git", + remote = "https://github.com/johnynek/bazel_jar_jar.git", shallow_since = "1594234634 -1000", ) load("@com_github_johnynek_bazel_jar_jar//:jar_jar.bzl", "jar_jar_repositories") jar_jar_repositories() +#-- Maven end --# -# Build tools +#-- Build tools start --# http_file( name = "buildifier_linux", executable = True, @@ -30,53 +52,52 @@ http_file( sha256 = "677a4e6dd247bee0ea336e7bdc94bc0b62d8f92c9f6a2f367b9a3ae1468b27ac", urls = ["https://github.com/bazelbuild/buildtools/releases/download/0.25.0/buildifier.mac"], ) +#-- Build tools end --# #-- Scala begin --# # version of the rules themselves, update this as needed to match the bazel version, # based on https://github.com/bazelbuild/rules_scala#bazel-compatible-versions -rules_scala_version = "a2f5852902f5b9f0302c727eead52ca2c7b6c3e2" # update this as needed +RULES_SCALA_VERSION = "d789f0a4f1e2bd8b2be7ba2fe07473fcc6832c6f" http_archive( name = "io_bazel_rules_scala", - sha256 = "8c48283aeb70e7165af48191b0e39b7434b0368718709d1bced5c3781787d8e7", - strip_prefix = "rules_scala-%s" % rules_scala_version, - type = "zip", - url = "https://github.com/bazelbuild/rules_scala/archive/%s.zip" % rules_scala_version, + sha256 = "93bb60b8cfaadf2fa5d8211602cc096f6abc10793894497f96f02f992a8e222f", + strip_prefix = "rules_scala-%s" % RULES_SCALA_VERSION, + url = "https://github.com/bazelbuild/rules_scala/archive/%s.tar.gz" % RULES_SCALA_VERSION, ) -#-- Skylib begin --# -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +load("@io_bazel_rules_scala//:scala_config.bzl", "scala_config") -http_archive( - name = "bazel_skylib", - sha256 = "97e70364e9249702246c0e9444bccdc4b847bed1eb03c5a3ece4f83dfe6abc44", - urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz", - "https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz", - ], -) +scala_config(scala_version = "2.11.12") -load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") +load("@io_bazel_rules_scala//scala:scala.bzl", "scala_repositories") -bazel_skylib_workspace() -#-- Skylib end --# +scala_repositories() -# register default scala toolchain load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains") scala_register_toolchains() -load("@io_bazel_rules_scala//scala:scala.bzl", "scala_repositories") +load("@io_bazel_rules_scala//testing:scalatest.bzl", "scalatest_repositories", "scalatest_toolchain") + +scalatest_repositories() + +scalatest_toolchain() +#-- Scala end --# + +#-- Protobuf begin --# +RULES_PROTO_VERSION = "c0b62f2f46c85c16cb3b5e9e921f0d00e3101934" + +http_archive( + name = "rules_proto", + sha256 = "84a2120575841cc99789353844623a2a7b51571a54194a54fc41fb0a51454069", + strip_prefix = "rules_proto-%s" % RULES_PROTO_VERSION, + url = "https://github.com/bazelbuild/rules_proto/archive/%s.zip" % RULES_PROTO_VERSION, +) + +load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains") + +rules_proto_dependencies() -# Specific SHA256 version of scala from maven, eg. https://repo1.maven.org/maven2/org/scala-lang/scala-library/2.11.12/, -# then get the JAR and run `sha256sum` to generate the SHA here. These are the current defaults, but are specified here -# against future upgrades and compatibility. See https://github.com/bazelbuild/rules_scala#selecting-scala-version for -# more details. -scala_repositories(( - "2.11.12", - { - "scala_compiler": "3e892546b72ab547cb77de4d840bcfd05c853e73390fed7370a8f19acb0735a0", - "scala_library": "0b3d6fd42958ee98715ba2ec5fe221f4ca1e694d7c981b0ae0cd68e97baf6dce", - "scala_reflect": "6ba385b450a6311a15c918cf8688b9af9327c6104f0ecbd35933cfcd3095fe04", - }, -)) +rules_proto_toolchains() +#-- Protobuf end --#