Rewrite depfile from sbox to stay reproducible
sbox will generate a random directory for the output root, and most
tools will encode that directory name in the output target of the
depfile.
So embed the library from dep_fixer into sbox so that it can rewrite the
output filename to a static (reproducible) value. Ninja doesn't care
what that value is, so it's just "outputfile".
Also fix up rule_builder to actually tell sbox about the depfile.
Test: mmma system/iorap; check the contents of:
out/soong/.intermediates/system/iorap/libiorap-binder/android_arm_armv7-a-neon_core_static/gen/aidl/system/iorap/binder/com/google/android/startop/iorap/IIorap.cpp.d
Change-Id: I3640a2e8b0c034f143a35e398a8418a6d621b265
diff --git a/cmd/dep_fixer/main.go b/cmd/dep_fixer/main.go
index f94cf2f..d1bd139 100644
--- a/cmd/dep_fixer/main.go
+++ b/cmd/dep_fixer/main.go
@@ -25,6 +25,8 @@
"io/ioutil"
"log"
"os"
+
+ "android/soong/makedeps"
)
func main() {
@@ -39,7 +41,7 @@
log.Fatal("Expected at least one input file as an argument")
}
- var mergedDeps *Deps
+ var mergedDeps *makedeps.Deps
var firstInput []byte
for i, arg := range flag.Args() {
@@ -48,7 +50,7 @@
log.Fatalf("Error opening %q: %v", arg, err)
}
- deps, err := Parse(arg, bytes.NewBuffer(append([]byte(nil), input...)))
+ deps, err := makedeps.Parse(arg, bytes.NewBuffer(append([]byte(nil), input...)))
if err != nil {
log.Fatalf("Failed to parse: %v", err)
}