common.mk: Set WHICH to command -v #151
Loading…
Reference in a new issue
No description provided.
Delete branch "jan/feature/20261020-common-mk-set-which-to-command-v"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
common.mk: Set WHICH to command -v
defs.mk derives WHICH from the external which binary, first from a hardcoded /usr/bin/which path and then with a
which whichfallback, while the probes for time, ruff, pyright, and python3 call which directly. Systems that do not ship the which package, such as minimal containers, are left to the shell's PATH search.Define
WHICHonce incommon.mkas thePOSIXcommand -v builtin and drop the old definition fromdefs.mk. Route the remaining direct which calls through$(WHICH):projects-dir.mk:TIMEprobepy-check.mk:PY_CHECK_RUFFandPY_CHECK_PYRIGHTprobespy-version.mk:PYTHONlookupcommand -v runs in the /bin/sh that
$(shell)already uses, so the build no longer depends on the which package. The builtin names that command -v reports for echo, test, pwd, and printf are safe, because every use of those variables runs through the shell, and the bash time keyword keeps the -p output format identical to the GNU time binary.