Fix bazel run_shell usage for newer versions
The Bazel option `--incompatible_run_shell_command_string` is going to be flipped to true in upcoming Bazel 4.0 release per default, see: [1] for more details.
Test Plan:
bazel build :release
[1] https://github.com/bazelbuild/bazel/issues/5903
Bug: Issue 13612
Change-Id: Icc9589906198386b1e4805ceeabbb420a7ea1afb
(cherry picked from commit c1f4e91406)
This commit is contained in:
committed by
David Ostrovsky
parent
7afd9bc971
commit
7e22ca2291
@@ -18,8 +18,7 @@ def documentation_attributes():
|
|||||||
]
|
]
|
||||||
|
|
||||||
def _replace_macros_impl(ctx):
|
def _replace_macros_impl(ctx):
|
||||||
cmd = [
|
args = [
|
||||||
ctx.file._exe.path,
|
|
||||||
"--suffix",
|
"--suffix",
|
||||||
ctx.attr.suffix,
|
ctx.attr.suffix,
|
||||||
"-s",
|
"-s",
|
||||||
@@ -28,13 +27,14 @@ def _replace_macros_impl(ctx):
|
|||||||
ctx.outputs.out.path,
|
ctx.outputs.out.path,
|
||||||
]
|
]
|
||||||
if ctx.attr.searchbox:
|
if ctx.attr.searchbox:
|
||||||
cmd.append("--searchbox")
|
args.append("--searchbox")
|
||||||
else:
|
else:
|
||||||
cmd.append("--no-searchbox")
|
args.append("--no-searchbox")
|
||||||
ctx.actions.run_shell(
|
ctx.actions.run(
|
||||||
inputs = [ctx.file._exe, ctx.file.src],
|
inputs = [ctx.file._exe, ctx.file.src],
|
||||||
outputs = [ctx.outputs.out],
|
outputs = [ctx.outputs.out],
|
||||||
command = cmd,
|
executable = ctx.file._exe.path,
|
||||||
|
arguments = args,
|
||||||
use_default_shell_env = True,
|
use_default_shell_env = True,
|
||||||
progress_message = "Replacing macros in %s" % ctx.file.src.short_path,
|
progress_message = "Replacing macros in %s" % ctx.file.src.short_path,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user