Open sitaktif opened 5 months ago
This is the relevant part of the code https://github.com/bazelbuild/bazel/blob/68009f84eaa5d095d119bc0c3b8bfd52d3c9e40c/tools/python/pywrapper_template.txt#L48-L64
I think if you change which
to type -P
, then that should have the same result, but type
is a builtin (https://www.gnu.org/software/bash/manual/html_node/Bash-Builtins.html#index-type).
I met the same error when using bazel on archlinux:latest
docker which doesn't have which
installed by default. While python3 is in path error message is completely unmeaning. It would worth to indeed use builtins (would this work for zsh, fish, ....) or just check if which
is installed on a system. I'd opt for the last option
Description of the bug:
Currently, if
which
is not present on the system, running apy_binary
will fail with the following message:However the
which
command invoked by the wrapper script doesn't fail becausepython
is not present on the PATH, but instead because thewhich
utility is not installed on the system.The wrapper script should check for the return code of the command:
which
will return1
if a command is not found, but the shell will have the subprocess return127
ifwhich
wasn't found (fromman bash
:If a command is not found, the child process created to execute it returns a status of 127.
).