Skip to content

Commit 4fdfce4

Browse files
committed
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.
1 parent e93d65a commit 4fdfce4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tests/deb/BUILD

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ genrule(
3737
name = "generate_md5sums",
3838
srcs = [":generate_files"],
3939
outs = ["md5sums"],
40-
cmd = "md5sum $(SRCS) | sed 's|$(RULEDIR)/||' > $@",
40+
cmd = 'for f in $(SRCS); do echo "$$($(location //tests/util:md5) "$$f") $${f#$(RULEDIR)/}"; done > $@',
41+
tools = ["//tests/util:md5"],
4142
)
4243

4344
my_package_naming(

0 commit comments

Comments
 (0)