Skip to content

Commit ecd0070

Browse files
committed
fix: skip packages without C benchmarks in benchmark-random-c
`benchmark-random-c` uses `PACKAGES_PATTERN='manifest.json'` to select random packages. WASM packages (e.g. `@stdlib/blas/base/wasm/*`) carry a `manifest.json` listing their C dependencies but ship no `benchmark/c/*.c` file and require Emscripten to compile — unavailable in CI. When one of these packages was selected, `benchmark-c` failed, causing the `random_benchmarks` CI workflow to fail on ~97% of runs (29/30 in 30 days). Add a pre-flight guard that checks for `*.c` files inside the package's `benchmark/` directory before invoking `benchmark-c`. Packages without C benchmarks are silently skipped, leaving the `manifest.json` selection pool intact while eliminating the false-positive failures.
1 parent f0362db commit ecd0070

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

  • tools/make/lib/benchmark

tools/make/lib/benchmark/c.mk

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,13 @@ benchmark-c-files:
114114
#/
115115
benchmark-random-c: $(NODE_MODULES)
116116
$(QUIET) $(MAKE) -f $(this_file) -s list-random-lib-pkgs PACKAGES_PATTERN='manifest.json' | while read -r pkg; do \
117-
echo ""; \
118-
echo "Running benchmark: $$pkg"; \
119-
NODE_ENV="$(NODE_ENV_BENCHMARK)" \
120-
NODE_PATH="$(NODE_PATH_BENCHMARK)" \
121-
$(MAKE) -f $(this_file) benchmark-c BENCHMARKS_FILTER="$$pkg/.*" || exit 1; \
117+
if find "$$pkg/benchmark" -name "*.c" 2>/dev/null | grep -q .; then \
118+
echo ""; \
119+
echo "Running benchmark: $$pkg"; \
120+
NODE_ENV="$(NODE_ENV_BENCHMARK)" \
121+
NODE_PATH="$(NODE_PATH_BENCHMARK)" \
122+
$(MAKE) -f $(this_file) benchmark-c BENCHMARKS_FILTER="$$pkg/.*" || exit 1; \
123+
fi; \
122124
done
123125

124126
.PHONY: benchmark-random-c

0 commit comments

Comments
 (0)