This relies on the RunEnvironmentInfo that was introduced in bazel 5.3.0. To keep the library compatible with previous versions, a new bazel_skylib_globals is added that will provide a None definition of RunEnvironmentInfo if still unavailable.
This is inspired by bazel_features: while using that directly would be easy with bzlmod integration, for the legacy workspace-based integration would suffer, as bazel_skylib_workspace would only be able to bring bazel_features in the workspace, but then one would have to call bazel_features_deps() as well after loading it.
If updating the legacy worksapce integration instructions with the above addition is deemed ok, one could bring that additionally dependency in. Otherwise I just added the necessary code to inspect the version (with the painful external repo workaround) directly in here.
This relies on the
RunEnvironmentInfo
that was introduced in bazel 5.3.0. To keep the library compatible with previous versions, a newbazel_skylib_globals
is added that will provide aNone
definition ofRunEnvironmentInfo
if still unavailable.This is inspired by bazel_features: while using that directly would be easy with bzlmod integration, for the legacy workspace-based integration would suffer, as
bazel_skylib_workspace
would only be able to bringbazel_features
in the workspace, but then one would have to callbazel_features_deps()
as well afterload
ing it.If updating the legacy worksapce integration instructions with the above addition is deemed ok, one could bring that additionally dependency in. Otherwise I just added the necessary code to inspect the version (with the painful external repo workaround) directly in here.
Closes https://github.com/bazelbuild/bazel-skylib/issues/409