The make
utility included in macOS 10.14 and later exhibits strange behavior that was not present in earlier versions of macOS and is also not present in newer versions of GNU make
(e.g. the version installable via brew
).
The shell spawned by tasks is unable to find executables in its $PATH. You can verify that the executable is in $PATH
for the shell by using env
or which
. For some reason, if you chain any commands with &&
, subsequent commands work.
Clone this repository, and:
/usr/bin/make setup
/usr/bin/make broken
#> env
#> ...
#> PATH=.:/other/paths
#> ...
#> shell-script
#> make: shell-script: No such file or directory
#> make: *** [broken] Error 1
/usr/bin/make also_broken
#> which shell-script
#> ./shell-script
#> shell-script
#> make: shell-script: No such file or directory
#> make: *** [also_broken] Error 1
./shell-script
is in the PATH, but make
's shell can't find it, unless you:
/usr/bin/make works
#> env && shell-script
#> ...
#> PATH=.:/other/paths
#> ...
#> shell script success!
/usr/bin/make also_works
#> sleep 0 && shell-script
#> shell script success!
Credit to @henrynash via Opentrons/opentrons#4809
PATH := .:$(PATH)
SHELL := env PATH=$(PATH) /bin/bash
# ...