treewide: replace template_file rule with expand_template
Less custom rules, more good?
Change-Id: Ie6d3c0c8912ed85058cd8aadfe2e9c7689e01f79
Reviewed-on: https://review.monogon.dev/c/monogon/+/4460
Reviewed-by: Leopold Schabel <leo@monogon.tech>
Tested-by: Jenkins CI
diff --git a/third_party/dosfstools/dosfstools.bzl b/third_party/dosfstools/dosfstools.bzl
index e8d966d..9327fbf 100644
--- a/third_party/dosfstools/dosfstools.bzl
+++ b/third_party/dosfstools/dosfstools.bzl
@@ -1,4 +1,4 @@
-load("@@//build/utils:template_file.bzl", "template_file")
+load("@aspect_bazel_lib//lib:expand_template.bzl", "expand_template")
load("@rules_cc//cc:defs.bzl", "cc_binary")
cc_binary(
@@ -31,9 +31,10 @@
includes = ["."],
)
-template_file(
- name = "version.h",
- src = "src/version.h.in",
+expand_template(
+ name = "version.h_expanded",
+ template = ":src/version.h.in",
+ out = "version.h",
substitutions = {
# ONCHANGE(//build/bazel:third_party.MODULE.bazel): version needs to be kept in sync
"@PACKAGE_VERSION@": "unstable-2022-07-25",
diff --git a/third_party/seccomp/seccomp.bzl b/third_party/seccomp/seccomp.bzl
index 9a010af..7267cbf 100644
--- a/third_party/seccomp/seccomp.bzl
+++ b/third_party/seccomp/seccomp.bzl
@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-load("@@//build/utils:template_file.bzl", "template_file")
+load("@aspect_bazel_lib//lib:expand_template.bzl", "expand_template")
load("@rules_cc//cc:defs.bzl", "cc_library")
genrule(
@@ -49,9 +49,10 @@
],
)
-template_file(
- name = "seccomp.h",
- src = "include/seccomp.h.in",
+expand_template(
+ name = "seccomp.h_expanded",
+ template = ":include/seccomp.h.in",
+ out = "seccomp.h",
substitutions = {
# Known dependencies relying on this version information:
# - @com_github_seccomp_libseccomp_golang//:libseccomp-golang
@@ -59,7 +60,6 @@
"@VERSION_MINOR@": "5",
"@VERSION_MICRO@": "1",
},
- visibility = ["//visibility:public"],
)
cc_library(
diff --git a/third_party/urcu/urcu.bzl b/third_party/urcu/urcu.bzl
index 351611d..183162f 100644
--- a/third_party/urcu/urcu.bzl
+++ b/third_party/urcu/urcu.bzl
@@ -1,9 +1,10 @@
-load("@@//build/utils:template_file.bzl", "template_file")
+load("@aspect_bazel_lib//lib:expand_template.bzl", "expand_template")
load("@rules_cc//cc:defs.bzl", "cc_library")
-template_file(
- name = "config.h",
- src = ":config.h.in",
+expand_template(
+ name = "config.h_expanded",
+ template = ":config.h.in",
+ out = "config.h",
substitutions = {},
)
diff --git a/third_party/util-linux/util-linux.bzl b/third_party/util-linux/util-linux.bzl
index 36e5886..477f872 100644
--- a/third_party/util-linux/util-linux.bzl
+++ b/third_party/util-linux/util-linux.bzl
@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-load("@@//build/utils:template_file.bzl", "template_file")
+load("@aspect_bazel_lib//lib:expand_template.bzl", "expand_template")
load("@rules_cc//cc:defs.bzl", "cc_library")
# These are only for the headers of libcommon, which is a private dependency of libblkid and
@@ -59,9 +59,10 @@
"HAVE___FPENDING",
]
-template_file(
- name = "blkid.h",
- src = "libblkid/src/blkid.h.in",
+expand_template(
+ name = "blkid.h_expanded",
+ template = ":libblkid/src/blkid.h.in",
+ out = "blkid.h",
substitutions = {
"@LIBBLKID_VERSION@": "0.0.0",
"@LIBBLKID_DATE@": "01.01.1970",