From a2c994107508f86692e19fcd86d272cd3cc88db7 Mon Sep 17 00:00:00 2001 From: Ivan Subotic <400790+subotic@users.noreply.github.com> Date: Thu, 10 Dec 2020 22:11:57 +0100 Subject: [PATCH] DSP-1099 Update Bazel maven rules (#1761) --- .bazelversion | 2 +- WORKSPACE | 35 ++++++++++++-------- docs/05-internals/development/third-party.md | 17 ++++++++++ 3 files changed, 40 insertions(+), 14 deletions(-) diff --git a/.bazelversion b/.bazelversion index 7c69a55dbb..a76ccff2a6 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -3.7.0 +3.7.1 diff --git a/WORKSPACE b/WORKSPACE index 50367e5538..101b696bf6 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -13,8 +13,8 @@ http_archive( ) # download rules_scala repository -rules_scala_version="056d5921d2c595e7ce2d54a627e8bc68ece7e28d" # 16.06.2020 -rules_scala_version_sha256="a39010b90ce921fd627c7158d43c16d8bd540e85d339ce9ac975e37213a843d4" +rules_scala_version="8866f55712b30bbb96335cc11bc5ae5aad5cf8d4" # 18.11.2020 +rules_scala_version_sha256="cdc13aba7f0f89ae52c9c50394a10f24ac0e18923108598ac9dafce5be6a789a" http_archive( name = "io_bazel_rules_scala", strip_prefix = "rules_scala-%s" % rules_scala_version, @@ -23,21 +23,25 @@ http_archive( sha256 = rules_scala_version_sha256, ) +# Stores Scala version and other configuration +# 2.12 is a default version, other versions can be use by passing them explicitly: +# scala_config(scala_version = "2.11.12") +load("@io_bazel_rules_scala//:scala_config.bzl", "scala_config") +scala_config(scala_version = "2.12.11") + # register default and our custom scala toolchain load("@io_bazel_rules_scala//scala:toolchains.bzl", "scala_register_toolchains") scala_register_toolchains() register_toolchains("//toolchains:dsp_api_scala_toolchain") -# set the default scala version +# needed by rules_scala load("@io_bazel_rules_scala//scala:scala.bzl", "scala_repositories") -scala_repositories(( - "2.12.11", - { - "scala_compiler": "e901937dbeeae1715b231a7cfcd547a10d5bbf0dfb9d52d2886eae18b4d62ab6", - "scala_library": "dbfe77a3fc7a16c0c7cb6cb2b91fecec5438f2803112a744cb1b187926a138be", - "scala_reflect": "5f9e156aeba45ef2c4d24b303405db259082739015190b3b334811843bd90d6a" - } -)) +scala_repositories() + +# register the test toolchain for rules_scala +load("@io_bazel_rules_scala//testing:scalatest.bzl", "scalatest_repositories", "scalatest_toolchain") +scalatest_repositories() +scalatest_toolchain() # # Download the protobuf repository (needed by go and rules_scala_annex) @@ -85,8 +89,8 @@ java_repositories() # download rules_jvm_external used for maven dependency resolution # defined in the third_party sub-folder # -rules_jvm_external_version = "3.2" # 24.02.2020 -rules_jvm_external_version_sha256 = "82262ff4223c5fda6fb7ff8bd63db8131b51b413d26eb49e3131037e79e324af" +rules_jvm_external_version = "3.3" # 7.07.2020 +rules_jvm_external_version_sha256 = "d85951a92c0908c80bd8551002d66cb23c3434409c814179c0ff026b53544dab" http_archive( name = "rules_jvm_external", @@ -177,6 +181,11 @@ go_rules_dependencies() go_register_toolchains() +# legacy variant used by rules_docker. Remove after rules_docker was updated to +# newest rules_python +load("@rules_python//python:pip.bzl", "pip_import", "pip_repositories") +pip_repositories() + # # Download the rules_docker repository at release v0.14.4 # diff --git a/docs/05-internals/development/third-party.md b/docs/05-internals/development/third-party.md index 4326be82b6..7fdf5de58d 100644 --- a/docs/05-internals/development/third-party.md +++ b/docs/05-internals/development/third-party.md @@ -19,6 +19,23 @@ Example of a "flattened" Bazel version looks as follows: To query Bazel for all defined Maven dependencies: `bazel query @maven//:all | sort` +### Manually Fetching Dependencies + +The Maven dependencies can be manually fetched with: +```bash +$ bazel fetch @maven//... +``` + +If there are any problems downloading the Maven dependencies, set the +`RJE_VERBOSE` environment variable to true to print `coursier`'s verbose output: +```bash +$ RJE_VERBOSE=true bazel fetch @maven//... +``` + +Note: If you are on macOS Big Sur and have the Cisco VPN client installed, +make sure that the packet filters are not active, or they may be a problem +downloading the dependencies. + ## Docker Image Versions The required Docker image versions of `Sipi` and `Fuseki` are defined in the