You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unix entry points: correctly detect the availability of a python binary (emscripten-core#15071)
The "which" program is not suitable for determining the existence or
location of a python binary, because it is a non-standard program that
is often not installed. It is often possible to manually install it as a
third-party addon anyway, but this is a very bad thing to rely on in
order to get good out of the box behavior.
If and when it is installed, it may display various incorrect behaviors,
including unparseable output on stdout instead of stderr, outputting the
contents of ~/.cshrc aliases, and more.
For more details on why never to use "which", see:
https://mywiki.wooledge.org/BashFAQ/081https://unix.stackexchange.com/questions/85249/why-not-use-which-what-to-use-then/85250#85250
Instead, use the POSIX 2008 mandated builtin "command -v" implemented by
all valid /bin/sh implementations, including ash, bash, busybox sh,
dash, ksh, mksh, and zsh.
"command -v" has an actual standards body guaranteeing the format of the
output, and that it is usable as a filesystem path to an executable, for
all shells produced in the last 13 years. It is thus unlikely to break
in the same way "which" does.
0 commit comments