forked from bazelbuild/rules_scala
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move
rules_scala_dependencies
to scala/deps.bzl
Ensures we get all the versions of dependencies we want in `WORKSPACE`, while providing a new API to consumers. Part of bazelbuild#1652. Bumps several packages as high as they can go and still be compatible with Bazel 6 and 7: - `bazel_skylib`: 1.4.1 => 1.7.1 - `rules_cc`: 0.0.6 => 0.0.9 - `rules_python`: 0.36.0 => 0.38.0 - `rules_go`: 0.50.1 The following packages are at the maximum version to prevent breakages under Bazel 6.5.0. --- `abseil-cpp` and `protobuf` have to stay at 20220623.1 and v27.1, respectively, for Bazel 6 compatibility per bazelbuild#1647. `protobuf` up to v25.5 is compatible with Bazel 6 provided users set the compiler flags mentioned in that issue. --- `rules_python` 0.38.0 => 0.39.0 requires at least `rules_cc` 0.0.10, which introduced `cc/common/cc_info.bzl`: ```txt $ bazel build //{src,test,third_party,scala_proto}/... [ ...snip... ] ERROR: error loading package under directory 'test': error loading package 'test': at .../external/rules_python/python/defs.bzl:17:6: at .../external/rules_python/python/py_binary.bzl:18:6: at .../external/rules_python/python/private/py_binary_macro.bzl:16:6: at .../external/rules_python/python/private/common_bazel.bzl:19:6: Label '@rules_cc//cc/common:cc_info.bzl' is invalid because 'cc/common' is not a package; perhaps you meant to put the colon here: '@rules_cc//cc:common/cc_info.bzl'? ``` --- `rules_cc` 0.0.9 => 0.0.10 requires Bazel 7, which defines `CcSharedLibraryHintInfo`: ```txt $ bazel build //{src,test,third_party,scala_proto}/... ERROR: .../external/rules_cc/cc/private/rules_impl/native.bzl:40:33: name 'CcSharedLibraryHintInfo' is not defined (did you mean 'CcSharedLibraryInfo'?) [ ...snip... ] ERROR: error loading package under directory 'test': error loading package 'test': at .../external/rules_python/python/defs.bzl:17:6: at .../external/rules_python/python/py_binary.bzl:18:6: at .../external/rules_python/python/private/py_binary_macro.bzl:16:6: at .../external/rules_python/python/private/common_bazel.bzl:18:6: at .../external/rules_cc/cc/common/cc_common.bzl:17:6: compilation of module 'cc/private/rules_impl/native.bzl' failed ```
- Loading branch information
Showing
3 changed files
with
86 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
"""Macro for instantiating repos required for core functionality.""" | ||
|
||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") | ||
|
||
def rules_scala_dependencies(): | ||
"""Instantiates repos needed by rules provided by `rules_scala`.""" | ||
maybe( | ||
http_archive, | ||
name = "bazel_skylib", | ||
sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f", | ||
urls = [ | ||
"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", | ||
], | ||
) | ||
|
||
maybe( | ||
http_archive, | ||
name = "rules_cc", | ||
urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.9/rules_cc-0.0.9.tar.gz"], | ||
sha256 = "2037875b9a4456dce4a79d112a8ae885bbc4aad968e6587dca6e64f3a0900cdf", | ||
strip_prefix = "rules_cc-0.0.9", | ||
) | ||
|
||
# Needed by protobuf-21.7 and Bazel 6.5.0, as later versions require C++14. | ||
maybe( | ||
http_archive, | ||
name = "com_google_absl", | ||
sha256 = "91ac87d30cc6d79f9ab974c51874a704de9c2647c40f6932597329a282217ba8", | ||
strip_prefix = "abseil-cpp-20220623.1", | ||
url = "https://github.com/abseil/abseil-cpp/archive/refs/tags/20220623.1.tar.gz", | ||
) | ||
|
||
maybe( | ||
http_archive, | ||
name = "rules_java", | ||
urls = [ | ||
"https://github.com/bazelbuild/rules_java/releases/download/7.12.3/rules_java-7.12.3.tar.gz", | ||
], | ||
sha256 = "c0ee60f8757f140c157fc2c7af703d819514de6e025ebf70386d38bdd85fce83", | ||
) | ||
|
||
maybe( | ||
http_archive, | ||
name = "com_google_protobuf", | ||
sha256 = "75be42bd736f4df6d702a0e4e4d30de9ee40eac024c4b845d17ae4cc831fe4ae", | ||
strip_prefix = "protobuf-21.7", | ||
url = "https://github.com/protocolbuffers/protobuf/archive/refs/tags/v21.7.tar.gz", | ||
) | ||
|
||
maybe( | ||
http_archive, | ||
name = "rules_proto", | ||
sha256 = "6fb6767d1bef535310547e03247f7518b03487740c11b6c6adb7952033fe1295", | ||
strip_prefix = "rules_proto-6.0.2", | ||
url = "https://github.com/bazelbuild/rules_proto/releases/download/6.0.2/rules_proto-6.0.2.tar.gz", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters