Skip to content

Commit

Permalink
build: assert minimum bazel version in use
Browse files Browse the repository at this point in the history
Use `bazel_skylib`'s built-in functionality to assert the minimum
supported Bazel version. We could also use `.bazelversion` to specify an
*exact* version that must be used, but that seems unnecessarily
restrictive.

v3.5.0 was arbitrarily chosen as being probably "recent enough", but I
did verify that a build does work with that version of Bazel.

Fixes #56059.

Release note: None
  • Loading branch information
rickystewart committed Jan 12, 2021
1 parent 158601d commit dadd5f1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ go_rules_dependencies()

go_register_toolchains(go_version = "1.15.6")

# NB: @bazel_skylib comes from go_rules_dependencies().
load("@bazel_skylib//lib:versions.bzl", "versions")

versions.check(minimum_bazel_version = "3.5.0")

# Load gazelle dependencies.
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")

Expand Down

0 comments on commit dadd5f1

Please sign in to comment.