Skip to content

Commit

Permalink
Use Bazel's default PATH when running Python actions
Browse files Browse the repository at this point in the history
Without `use_default_shell_env`, `PATH` was not set for Python actions,
which resulted in `python` (or `python3`) not being found.
  • Loading branch information
fmeum committed Nov 21, 2022
1 parent b193df7 commit 516c52d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fuzzing/private/common.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ def _fuzzing_corpus_impl(ctx):
outputs = [corpus_dir],
arguments = [cp_args, corpus_list_file_args],
executable = ctx.executable._corpus_tool,
# Use the default rather than an empty environment so that PATH is
# set and python can be found.
use_default_shell_env = True,
)

return [DefaultInfo(
Expand Down Expand Up @@ -132,6 +135,9 @@ def _fuzzing_dictionary_impl(ctx):
outputs = [output_dict],
arguments = [args],
executable = ctx.executable._validation_tool,
# Use the default rather than an empty environment so that PATH is
# set and python can be found.
use_default_shell_env = True,
)

runfiles = ctx.runfiles(files = [output_dict])
Expand Down

0 comments on commit 516c52d

Please sign in to comment.