Skip to content

Commit

Permalink
Added comment on why we need our own version of get_bazel_version
Browse files Browse the repository at this point in the history
  • Loading branch information
Karim Alweheshy committed Mar 1, 2024
1 parent ab9383f commit 34e7a7f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions rules/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ bzl_library(
":providers",
":transition_support",
"@bazel_skylib//lib:dicts",
"@bazel_skylib//rules:common_settings",
],
)

Expand Down
6 changes: 6 additions & 0 deletions rules/internal/bazel_version.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
"Bazel version parsing"

# There are utility functions for parsing versions numbers here:
# load("@bazel_skylib//lib:versions.bzl", "versions")
# But we don't want to use them, as skylib is not yet loaded when code
# in this file executes. There's no way to execute it later, because
# `native.bazel_version`'s availability is restricted:
# https://github.com/bazelbuild/bazel/issues/8305
def get_bazel_version(bazel_version = getattr(native, "bazel_version", "")):
"""
Parse the Bazel version into a `struct`.
Expand Down

0 comments on commit 34e7a7f

Please sign in to comment.