Skip to content

Commit

Permalink
Do not crash on using version check with development version of bazel. (
Browse files Browse the repository at this point in the history
  • Loading branch information
hlopko committed Oct 23, 2018
1 parent 271d790 commit 981d217
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion workspace.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ load("@bazel_skylib//lib:versions.bzl", "versions")

def _store_bazel_version(repository_ctx):
bazel_version = versions.get();
if versions.is_at_most("0.17.0", bazel_version):
if len(bazel_version) == 0:
print("You're using development build of Bazel, " +
"make sure it's at least version 0.17.1")
elif versions.is_at_most("0.17.0", bazel_version):
fail("Bazel %s is too old to use with rules_rust, please use at least Bazel 0.17.1, preferably newer." % bazel_version)
repository_ctx.file("BUILD", "exports_files(['def.bzl'])")
repository_ctx.file("def.bzl", "BAZEL_VERSION='" + bazel_version + "'")
Expand Down

0 comments on commit 981d217

Please sign in to comment.