Skip to content

Commit

Permalink
feat: assert that Bazel is at least 4.0.0 LTS
Browse files Browse the repository at this point in the history
Since we only test against bazel 4.0 now, and will start using features that require it, this gives users
an obvious error message that they need to update.
  • Loading branch information
alexeagle committed Sep 16, 2021
1 parent 0903d49 commit 9216de1
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions python/pip_install/repositories.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
""

load("@bazel_skylib//lib:versions.bzl", "versions")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")

Expand Down Expand Up @@ -63,6 +64,13 @@ def pip_install_dependencies():
(However we call it from pip_install, making it optional for users to do so.)
"""

# We only support Bazel LTS and rolling releases.
# Give the user an obvious error to upgrade rather than some obscure missing symbol later.
# It's not guaranteed that users call this function, but it's used by all the pip fetch
# repository rules so it's likely that most users get the right error.
versions.check("4.0.0")

for (name, url, sha256) in _RULE_DEPS:
maybe(
http_archive,
Expand Down

0 comments on commit 9216de1

Please sign in to comment.