Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action in default shell environment can't locate executable using client $PATH variable #7101

Closed
slyrz opened this issue Jan 12, 2019 · 3 comments
Labels
team-Local-Exec Issues and PRs for the Execution (Local) team

Comments

@slyrz
Copy link

slyrz commented Jan 12, 2019

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 #7026 (comment)

@jin jin added team-Local-Exec Issues and PRs for the Execution (Local) team and removed team-Execution labels Jan 14, 2019
@jmmv
Copy link
Contributor

jmmv commented Jan 18, 2019

I believe this is #7026? --incompatible_strict_action_env was just reverted to false today. Could you try doing that as well?

@slyrz
Copy link
Author

slyrz commented Jan 20, 2019

@jmmv Thanks for your comment. Disabling this option works. So far the following two invocations make the build pass under bazel version 0.21:

  1. bazel build --action_env=PATH <target>
  2. 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?

@jmmv
Copy link
Contributor

jmmv commented Jan 24, 2019

Yes! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Local-Exec Issues and PRs for the Execution (Local) team
Projects
None yet
Development

No branches or pull requests

5 participants