From 7e7ef56077a6a138d8e4d07295f0b6d09dee18f7 Mon Sep 17 00:00:00 2001 From: Ulf Adams Date: Wed, 25 Nov 2020 23:07:23 +0100 Subject: [PATCH] Soong: remove output file before running signapk It looks like there is a bug in rewrapper/reproxy that makes it upload the output file as an input if it still exists in the output tree. This causes unnecessary cache misses on incremental builds, and can also cause the action to fail remotely (depending on the service). By removing the output file at the beginning of the action, we ensure that it can't be uploaded. Test: ran against a remote execution server; actions no longer fail remotely Change-Id: Iaac2b23b35d2c876c0244edbfd4a8f159df0563c --- java/app_builder.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/app_builder.go b/java/app_builder.go index 69e462c3d..b53c15ab4 100644 --- a/java/app_builder.go +++ b/java/app_builder.go @@ -32,7 +32,7 @@ import ( var ( Signapk, SignapkRE = remoteexec.StaticRules(pctx, "signapk", blueprint.RuleParams{ - Command: `$reTemplate${config.JavaCmd} ${config.JavaVmFlags} -Djava.library.path=$$(dirname ${config.SignapkJniLibrary}) ` + + Command: `rm -f $out && $reTemplate${config.JavaCmd} ${config.JavaVmFlags} -Djava.library.path=$$(dirname ${config.SignapkJniLibrary}) ` + `-jar ${config.SignapkCmd} $flags $certificates $in $out`, CommandDeps: []string{"${config.SignapkCmd}", "${config.SignapkJniLibrary}"}, },