Skip to content

Commit f10beec

Browse files
authored
add warning if current running bazel is ahead of bazel-toolchains repo (#712)
* add warning if current running bazel is ahead of b-t repo * hide warning if rc is used * address review feedback
1 parent 2ce3aa3 commit f10beec

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

rules/rbe_repo/checked_in.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ def validateUseOfCheckedInConfigs(
103103
print("%s not using checked in configs as detect_java_home was set to True " % name)
104104
return None, None
105105
if bazel_rc_version:
106-
print("%s not using checked in configs as hazel rc version was used " % name)
106+
print("%s not using checked in configs as bazel rc version was used " % name)
107107
return None, None
108108

109109
if not base_container_digest:

rules/rbe_repo/version_check.bzl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,12 @@ def _check_bazel_version(bazel_version_fallback):
6060
"was not defined explicitly in rbe_autoconfig target. " +
6161
"Falling back to '%s'") % bazel_version_fallback)
6262
return bazel_version_fallback
63+
64+
# If running a release that is not an RC, print a warning if the
65+
# fallback (latest known in this repo) is old
66+
if (native.bazel_version.find("rc") == -1 and
67+
native.bazel_version > bazel_version_fallback):
68+
print("\nCurrent running Bazel is ahead of bazel-toolchains repo. " +
69+
"Please update your pin to bazel-toolchains repo in your " +
70+
"WORKSPACE file.")
6371
return native.bazel_version

0 commit comments

Comments
 (0)