The build no longer needs bash. The test runner still does, and fails confusingly when it is absent.
Background
mk/detect-target.sh used to carry a #!/usr/bin/env bash shebang while using no bash feature; on an image without bash it produced an empty TARGET and the build died on mk/target-.mk. That is fixed — it is #!/bin/sh now.
mk/run-tests.sh is the remaining bash dependency, and this one is real: it uses [[ ]], declare -a and array expansion.
Where
mk/run-tests.sh — lines using [[ -z "$BIN_DIR" ]], declare -a CANDIDATES, for b in "${CANDIDATES[@]}".
Reproduce
On any image without bash (Alpine's build-base does not pull it in):
docker run --rm -v "$PWD:/src" -w /src alpine:3.21 sh -c \
'apk add --no-cache build-base linux-headers && make GEMM_PROVIDER=native test-unit'
Two acceptable outcomes
Either is fine — pick one and say which in the PR:
- Port it to POSIX sh. The arrays hold a short list of filename globs; a space-free
set -- / "$@" list or a newline-separated variable covers it.
- Keep bash, declare it. Add bash to the documented test prerequisites and make the failure explicit (
command -v bash check with a message), so it does not look like a build bug.
Done when
The command above either runs the unit tests or fails with a message that names bash as the missing prerequisite. make test-unit on macOS and glibc Linux is unchanged.
The build no longer needs bash. The test runner still does, and fails confusingly when it is absent.
Background
mk/detect-target.shused to carry a#!/usr/bin/env bashshebang while using no bash feature; on an image without bash it produced an emptyTARGETand the build died onmk/target-.mk. That is fixed — it is#!/bin/shnow.mk/run-tests.shis the remaining bash dependency, and this one is real: it uses[[ ]],declare -aand array expansion.Where
mk/run-tests.sh— lines using[[ -z "$BIN_DIR" ]],declare -a CANDIDATES,for b in "${CANDIDATES[@]}".Reproduce
On any image without bash (Alpine's
build-basedoes not pull it in):Two acceptable outcomes
Either is fine — pick one and say which in the PR:
set --/"$@"list or a newline-separated variable covers it.command -v bashcheck with a message), so it does not look like a build bug.Done when
The command above either runs the unit tests or fails with a message that names bash as the missing prerequisite.
make test-uniton macOS and glibc Linux is unchanged.