Check RuleBuilder temporaries for path errors
Output files in sandboxed RuleBuilder rules must be under the output
directory, but output paths that were marked as temporaries were
not error checked.
Bug: 182612695
Test: rule_builder_test.go
Change-Id: I09616402ef1637c2c455ec7d345a296711582e8f
diff --git a/android/rule_builder.go b/android/rule_builder.go
index 41d2fa6..75f1b5d 100644
--- a/android/rule_builder.go
+++ b/android/rule_builder.go
@@ -523,6 +523,12 @@
})
}
+ // Outputs that were marked Temporary will not be checked that they are in the output
+ // directory by the loop above, check them here.
+ for path := range r.temporariesSet {
+ Rel(r.ctx, r.outDir.String(), path.String())
+ }
+
// Add a hash of the list of input files to the manifest so that the textproto file
// changes when the list of input files changes and causes the sbox rule that
// depends on it to rerun.