Action in default shell environment can't locate executable using client $PATH variable
Description of the problem:
I have an action like
# `example` is a command in a directory of the caller's $PATH variable
ctx.actions.run(
executable = 'example',
use_default_shell_env = True,
...
)
that fails with
src/main/tools/linux-sandbox-pid1.cc:427: "execvp(example, ...)": No such file or directory
unless --action_env=PATH gets passed to the build command. Alternatively, using an absolute path name for the executable works as well.
The action used to work with previous bazel versions.
What operating system are you running Bazel on?
Ubuntu 18.04
What's the output of bazel info release?
release 0.21.0
Have you found anything relevant by searching the web?
Originally posted in https://github.com/bazelbuild/bazel/issues/7026#issuecomment-453738095
I believe this is https://github.com/bazelbuild/bazel/issues/7026? --incompatible_strict_action_env was just reverted to false today. Could you try doing that as well?
@jmmv Thanks for your comment. Disabling this option works. So far the following two invocations make the build pass under bazel version 0.21:
bazel build --action_env=PATH <target>bazel build --incompatible_strict_action_env=false <target>
I share your opinion that this issue here is just an effect of #7026. Shall we close this one?
Yes! Thanks.