From 48648503729d53fdee1322fde2c8e6c05e99cff9 Mon Sep 17 00:00:00 2001 From: Googler Date: Wed, 20 Jan 2021 06:53:05 -0800 Subject: [PATCH] Fixed an error that bazel binary is not executable when testing with remote execution. The cmd used to package final artifact didn't produce an executable file. It worked before since we always chmod(0555) the output files of a locally executed action and always set the input files to be executable when uploading to remote cache. However, this is no longer true with b6e3ba8abf033c6d3a318be8484021eff6a40dde. Tests can't execute the generated bazel binary with remote execution due to the missing executable bit. This change add `chmod a+x` to the cmd to make sure the final artifact is executable. PiperOrigin-RevId: 352784262 --- src/BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BUILD b/src/BUILD index 67fe7f914e1438..ad767d889d7a62 100644 --- a/src/BUILD +++ b/src/BUILD @@ -385,7 +385,7 @@ genrule( # In msys, a file path without .exe suffix(say foo), refers to a file with .exe # suffix(say foo.exe), if foo.exe exists and foo doesn't. So, on windows, we # need to remove bazel.exe first, so that cat to bazel won't fail. - cmd = "rm -f $@; cat $(location //src/main/cpp:client) $(location :package-zip" + jdk + ") > $@ && zip -qA $@", + cmd = "rm -f $@; cat $(location //src/main/cpp:client) $(location :package-zip" + jdk + ") > $@ && zip -qA $@ && chmod a+x $@", executable = 1, output_to_bindir = 1, visibility = [