From efc1b412f199bbbe2474d4c5396dc4b39a6beff7 Mon Sep 17 00:00:00 2001 From: Jeff Gaston Date: Wed, 29 Mar 2017 17:29:06 -0700 Subject: Have Soong try to enforce that genrules declare all their outputs. This causes Soong to put the outputs of each genrule into a temporary location and copy the declared outputs back to the output directory. This gets the process closer to having an actual sandbox. Bug: 35562758 Test: make Change-Id: I8048fbf1a3899a86fb99d71b60669b6633b07b3e --- genrule/genrule.go | 46 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 8 deletions(-) (limited to 'genrule/genrule.go') diff --git a/genrule/genrule.go b/genrule/genrule.go index 2ff018f5..b98ccfdb 100644 --- a/genrule/genrule.go +++ b/genrule/genrule.go @@ -16,11 +16,14 @@ package genrule import ( "fmt" + "path" "strings" "github.com/google/blueprint" "android/soong/android" + "android/soong/shared" + "path/filepath" ) func init() { @@ -32,6 +35,10 @@ var ( pctx = android.NewPackageContext("android/soong/genrule") ) +func init() { + pctx.HostBinToolVariable("sboxCmd", "sbox") +} + type SourceFileGenerator interface { GeneratedSourceFiles() android.Paths GeneratedHeaderDirs() android.Paths @@ -42,7 +49,11 @@ type HostToolProvider interface { } type generatorProperties struct { - // command to run on one or more input files. Available variables for substitution: + // The command to run on one or more input files. Cmd supports substitution of a few variables + // (the actual substitution is implemented in GenerateAndroidBuildActions below) + // + // Available variables for substitution: + // // $(location): the path to the first entry in tools or tool_files // $(location