Skip to content

Conversation

@rdesgroppes
Copy link
Contributor

@rdesgroppes rdesgroppes commented Jan 21, 2026

Bazel 9.0.0 flipped --incompatible_strict_action_env to true by default (bazelbuild/bazel#27670), restricting PATH to /bin:/usr/bin:/usr/local/bin.

On macOS, this broke a few tests relying on the md5sum command (example):

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:

-    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 the tests.

Fixes #1010.

@rdesgroppes rdesgroppes force-pushed the fix-missing-md5sum-on-macos-since-bazel-9 branch 2 times, most recently from 7c64b68 to 2f278a8 Compare January 21, 2026 00:14
meteorcloudy added a commit that referenced this pull request Jan 22, 2026
Updates `ossf/scorecard-action` from `v2` to `v2.4.0` and
`actions/upload-artifact` from `v3` to `v4` to comply with GitHub's
deprecation notice
(https://github.blog/changelog/2024-04-16-deprecation-notice-v3-of-the-artifact-actions).

As of January 22, 2025, workflows using v3 artifact actions fail with:
```
##[error]This request has been automatically failed because it uses a
deprecated version of `actions/upload-artifact: v3`. Learn more:
https://github.blog/changelog/2024-04-16-deprecation-notice-v3-of-the-artifact-actions/.
```

Fixes #1012.
Note: CI still fails due to #1010, for which there's a proposed
countermeasure: #1007.
@rdesgroppes rdesgroppes force-pushed the fix-missing-md5sum-on-macos-since-bazel-9 branch from 2f278a8 to 4fdfce4 Compare January 22, 2026 13:30
@rdesgroppes rdesgroppes changed the title fix(test): use cross-platform md5 tool for Bazel 9 compat fix(ci): use own md5 tool for Bazel 9 compatibility Jan 22, 2026
@rdesgroppes rdesgroppes force-pushed the fix-missing-md5sum-on-macos-since-bazel-9 branch 3 times, most recently from cefebab to 93cfdf1 Compare January 22, 2026 14:29
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.
@rdesgroppes rdesgroppes force-pushed the fix-missing-md5sum-on-macos-since-bazel-9 branch from 93cfdf1 to 2254f19 Compare January 22, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix CI impacted by Bazel 9 release

1 participant