Build mkfs.xfs using rules_cc
This drops the old big genrule for mkfs.xfs and replaces it with a nice rules_cc build system
with the help of bazel_cc_fix generated patches and our musl-based toolchain.
While we're at it I bumped the versions of all related dependencies to their latest stable release.
This also means pulling in ini.h which is a dependency of the new xfstools version.
Instructions to regenerate the patches are included in the spec files.
Toolchain selection is done by the existing transition in our rootfs rule so we automatically get a musl-built
static binary when building for the rootfs.
Test Plan: Tested with E2E tests, should fail fairly catastrophically if something were wrong.
X-Origin-Diff: phab/D708
GitOrigin-RevId: 648a05cdd08cfa84a8a9f4c057c52446e7005631
diff --git a/third_party/util-linux/cc_fix_spec.prototxt b/third_party/util-linux/cc_fix_spec.prototxt
new file mode 100644
index 0000000..fed612f
--- /dev/null
+++ b/third_party/util-linux/cc_fix_spec.prototxt
@@ -0,0 +1,22 @@
+# proto-file: build/bazel_cc_fix/ccfixspec/ccfixspec.proto
+# proto-message: CCFixSpec
+
+# To regenerate the patch, run the following in the checked-out util-linux repo
+# ./autogen.sh
+# ./configure --without-util --without-udev --without-ncursesw --without-tinfo --without-readline --without-cap-ng --without-libz --without-libmagic --without-user --without-btrfs --without-systemd --without-python
+# intercept-build make -j24 uuidgen blkid
+
+# And the following in the monorepo root
+# bazel run //build/bazel_cc_fix -- -workspace $path_to_repo -compilation_db $path_to_repo/compile_commands.json -spec third_party/util-linux/cc_fix_spec.prototxt
+
+# Templated file (original path, later rewritten)
+generated_file {
+ path: "libblkid/src/blkid.h",
+}
+
+# Rewrite blkid.h to root for ease of use and easier codegen
+replace {
+ type: WORKSPACE,
+ from: "libblkid/src/blkid.h",
+ to: "blkid.h",
+}