From 7a7618539a54c8e0711bae4b483e6d9176df9886 Mon Sep 17 00:00:00 2001 From: Karim Alweheshy Date: Fri, 1 Mar 2024 12:37:42 +0100 Subject: [PATCH] Added comment on why we need our own version of get_bazel_version --- rules/internal/bazel_version.bzl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rules/internal/bazel_version.bzl b/rules/internal/bazel_version.bzl index 4050485f..c0d82656 100644 --- a/rules/internal/bazel_version.bzl +++ b/rules/internal/bazel_version.bzl @@ -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`.