runnable_binary: avoid using > on the output file (#1270)
Co-authored-by: James Sharpe <james.sharpe@zenotech.com>
This commit is contained in:
parent
c939c13416
commit
1d8e362a22
|
@ -44,7 +44,7 @@ def runnable_binary(name, binary, foreign_cc_target, match_binary_name = False,
|
||||||
|
|
||||||
wrapper_cmd = """
|
wrapper_cmd = """
|
||||||
sed s@EXECUTABLE@$(rlocationpath {name})@g $(location @rules_foreign_cc//foreign_cc/private:runnable_binary_wrapper.sh) > tmp
|
sed s@EXECUTABLE@$(rlocationpath {name})@g $(location @rules_foreign_cc//foreign_cc/private:runnable_binary_wrapper.sh) > tmp
|
||||||
sed s@SH_BINARY_FILENAME@{sh_binary_filename}@g tmp > $@
|
cp tmp $@
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if hasattr(native, "package_relative_label"):
|
if hasattr(native, "package_relative_label"):
|
||||||
|
@ -57,10 +57,7 @@ def runnable_binary(name, binary, foreign_cc_target, match_binary_name = False,
|
||||||
name = name + "_wrapper",
|
name = name + "_wrapper",
|
||||||
srcs = ["@rules_foreign_cc//foreign_cc/private:runnable_binary_wrapper.sh", name + "_fg"],
|
srcs = ["@rules_foreign_cc//foreign_cc/private:runnable_binary_wrapper.sh", name + "_fg"],
|
||||||
outs = [name + "_wrapper.sh"],
|
outs = [name + "_wrapper.sh"],
|
||||||
cmd = select({
|
cmd = wrapper_cmd.format(name = fg_label),
|
||||||
"@platforms//os:windows": wrapper_cmd.format(name = fg_label, sh_binary_filename = binary + ".exe" if match_binary_name else name),
|
|
||||||
"//conditions:default": wrapper_cmd.format(name = fg_label, sh_binary_filename = binary if match_binary_name else name),
|
|
||||||
}),
|
|
||||||
tags = tags + ["manual"],
|
tags = tags + ["manual"],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue