Skip to content

Commit

Permalink
Handle prerelease versions in polyfill (#3821)
Browse files Browse the repository at this point in the history
Currently this fails on versions like `8.0.0-pre.20231030.2`.
  • Loading branch information
illicitonion authored Jan 9, 2024
1 parent 3c51b96 commit f0f2685
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion go/private/polyfill_bazel_features.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ _POLYFILL_BAZEL_FEATURES = """bazel_features = struct(
def _polyfill_bazel_features_impl(rctx):
# An empty string is treated as a "dev version", which is greater than anything.
bazel_version = native.bazel_version or "999999.999999.999999"
version_parts = bazel_version.split(".")
version_parts = bazel_version.split("-")[0].split(".")
if len(version_parts) != 3:
fail("invalid Bazel version '{}': got {} dot-separated segments, want 3".format(bazel_version, len(version_parts)))
major_version_int = int(version_parts[0])
Expand Down

0 comments on commit f0f2685

Please sign in to comment.