Skip to content

Commit

Permalink
llvm_toolchain: don't break when used with dev builds of bazel
Browse files Browse the repository at this point in the history
  • Loading branch information
rrbutani committed Feb 19, 2021
1 parent 98bf746 commit 908b1ce
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion toolchain/cc_toolchain_config.bzl.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -244,10 +244,14 @@ def cc_toolchain_config(name, cpu):

# This was only added in bazel v4.0.0.
#
# `native.bazel_version` might give us back an empty string if a local dev build
# of bazel is being used; in this case we'll assume the version is at least
# 4.0.0.
#
# See: https://github.com/bazelbuild/bazel/commit/da345f1f249ebf28bec88c6e0d63260dfaef14e9
**(
{"builtin_sysroot": builtin_sysroot}
if int("%{bazel_version}".split(".")[0]) >= 4
if int(("%{bazel_version}" or "4.0.0").split(".")[0]) >= 4
else {}
)
)

0 comments on commit 908b1ce

Please sign in to comment.