From 2254f195b4b555c5409f9cdb736ae1706ca0737a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Desgroppes?= Date: Wed, 21 Jan 2026 00:55:48 +0100 Subject: [PATCH] fix(ci): use own `md5` tool for Bazel 9 compatibility Bazel 9.0.0 flipped `--incompatible_strict_action_env` to `true` by default, restricting `PATH` to `/bin:/usr/bin:/usr/local/bin`. On macOS, this broke a few tests relying on the `md5sum` command: ``` Executing genrule //tests/deb:generate_md5sums failed: (Exit 127): [...] [...] /bin/bash: md5sum: command not found ``` This is because: 1. `md5sum` is not a native macOS command (macOS equivalent is `md5`), 2. Homebrew's `md5sum` is typically in `/opt/homebrew/bin`, which is no longer in the restricted `PATH`. Since the repo already maintains a cross-platform `//tests/util:md5` tool, the fix simply consists in leveraging it. Note on: ```diff - cmd = "for i in $(OUTS); do echo 1 >$$i; done", + cmd = "for i in $(OUTS); do echo $$i >$$i; done", ``` ... is only meant to get distinct md5 sums for the 2 input files used in tests. --- tests/deb/BUILD | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/deb/BUILD b/tests/deb/BUILD index fa53244c..b11e66cd 100644 --- a/tests/deb/BUILD +++ b/tests/deb/BUILD @@ -30,14 +30,15 @@ genrule( "etc/nsswitch.conf", "usr/fizzbuzz", ], - cmd = "for i in $(OUTS); do echo 1 >$$i; done", + cmd = "for i in $(OUTS); do echo $$i >$$i; done", ) genrule( name = "generate_md5sums", srcs = [":generate_files"], outs = ["md5sums"], - cmd = "md5sum $(SRCS) | sed 's|$(RULEDIR)/||' > $@", + cmd = 'for i in $(SRCS); do echo "$$($(execpath //tests/util:md5) $$i) $${i#$(RULEDIR)/}"; done >$@', + tools = ["//tests/util:md5"], ) my_package_naming(