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
This commit is contained in:
@@ -50,6 +50,19 @@ func ensureDirectoriesExist(ctx Context, dirs ...string) {
|
||||
}
|
||||
}
|
||||
|
||||
// ensureEmptyDirectoriesExist ensures that the given directories exist and are empty
|
||||
func ensureEmptyDirectoriesExist(ctx Context, dirs ...string) {
|
||||
// remove all the directories
|
||||
for _, dir := range dirs {
|
||||
err := os.RemoveAll(dir)
|
||||
if err != nil {
|
||||
ctx.Fatalf("Error removing %s: %q\n", dir, err)
|
||||
}
|
||||
}
|
||||
// recreate all the directories
|
||||
ensureDirectoriesExist(ctx, dirs...)
|
||||
}
|
||||
|
||||
// ensureEmptyFileExists ensures that the containing directory exists, and the
|
||||
// specified file exists. If it doesn't exist, it will write an empty file.
|
||||
func ensureEmptyFileExists(ctx Context, file string) {
|
||||
|
Reference in New Issue
Block a user