summaryrefslogtreecommitdiffhomepage
path: root/tools/bazeldefs
diff options
context:
space:
mode:
Diffstat (limited to 'tools/bazeldefs')
-rw-r--r--tools/bazeldefs/BUILD8
-rw-r--r--tools/bazeldefs/defs.bzl1
-rw-r--r--tools/bazeldefs/pkg.bzl3
3 files changed, 11 insertions, 1 deletions
diff --git a/tools/bazeldefs/BUILD b/tools/bazeldefs/BUILD
index a4a605346..ebe90dfec 100644
--- a/tools/bazeldefs/BUILD
+++ b/tools/bazeldefs/BUILD
@@ -37,3 +37,11 @@ config_setting(
},
visibility = ["//visibility:private"],
)
+
+genrule(
+ name = "version",
+ outs = ["version.txt"],
+ cmd = "cat bazel-out/stable-status.txt | grep STABLE_VERSION | cut -d' ' -f2- >$@",
+ stamp = True,
+ visibility = ["//:sandbox"],
+)
diff --git a/tools/bazeldefs/defs.bzl b/tools/bazeldefs/defs.bzl
index 58ced5167..7875bbaea 100644
--- a/tools/bazeldefs/defs.bzl
+++ b/tools/bazeldefs/defs.bzl
@@ -7,6 +7,7 @@ build_test = _build_test
bzl_library = _bzl_library
more_shards = 4
most_shards = 8
+version = "//tools/bazeldefs:version"
def short_path(path):
return path
diff --git a/tools/bazeldefs/pkg.bzl b/tools/bazeldefs/pkg.bzl
index 56317d93f..ccc9bdeef 100644
--- a/tools/bazeldefs/pkg.bzl
+++ b/tools/bazeldefs/pkg.bzl
@@ -1,6 +1,7 @@
"""Packaging rules."""
-load("@rules_pkg//:pkg.bzl", _pkg_deb = "pkg_deb", _pkg_tar = "pkg_tar")
+# N.B. We refer to pkg_deb_impl to avoid the macro, which cannot use select.
+load("@rules_pkg//:pkg.bzl", _pkg_deb = "pkg_deb_impl", _pkg_tar = "pkg_tar")
pkg_deb = _pkg_deb
pkg_tar = _pkg_tar