From 26d195521ba831545c48e084b4ab7a647d7ecb36 Mon Sep 17 00:00:00 2001 From: Ulf Adams Date: Wed, 25 Nov 2020 23:03:28 +0100 Subject: [PATCH] Soong: remove output file before running SoongZip 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: I98fcc0cf105553a9920b0e96965a438e052d7c05 --- java/builder.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/builder.go b/java/builder.go index 3043e46db..c8bea6289 100644 --- a/java/builder.go +++ b/java/builder.go @@ -42,7 +42,7 @@ var ( // TODO(b/143658984): goma can't handle the --system argument to javac. javac, javacRE = remoteexec.MultiCommandStaticRules(pctx, "javac", blueprint.RuleParams{ - Command: `rm -rf "$outDir" "$annoDir" "$srcJarDir" && mkdir -p "$outDir" "$annoDir" "$srcJarDir" && ` + + Command: `rm -rf "$outDir" "$annoDir" "$srcJarDir" "$out" && mkdir -p "$outDir" "$annoDir" "$srcJarDir" && ` + `${config.ZipSyncCmd} -d $srcJarDir -l $srcJarDir/list -f "*.java" $srcJars && ` + `(if [ -s $srcJarDir/list ] || [ -s $out.rsp ] ; then ` + `${config.SoongJavacWrapper} $javaTemplate${config.JavacCmd} ` +