Fix missing glob filelists when sandboxed

Sandboxing the primary builder caused the glob filelists to not
be written because they were using a relative path, causing
primary builder reruns on the second build.

Also report errors when writing the filelist files.

Test: m checkbuild
Change-Id: Id1706560d04c85f00f829cfb714967bb8600626f
This commit is contained in:
Colin Cross 2020-01-16 10:36:56 -08:00
parent 1cda3fd3e4
commit 67d0cbed90

View file

@ -131,8 +131,14 @@ func (s *globSingleton) GenerateBuildActions(ctx blueprint.SingletonContext) {
depFile := fileListFile + ".d"
fileList := strings.Join(g.Files, "\n") + "\n"
pathtools.WriteFileIfChanged(fileListFile, []byte(fileList), 0666)
deptools.WriteDepFile(depFile, fileListFile, g.Deps)
err := pathtools.WriteFileIfChanged(absolutePath(fileListFile), []byte(fileList), 0666)
if err != nil {
panic(fmt.Errorf("error writing %s: %s", fileListFile, err))
}
err = deptools.WriteDepFile(absolutePath(depFile), fileListFile, g.Deps)
if err != nil {
panic(fmt.Errorf("error writing %s: %s", depFile, err))
}
GlobFile(ctx, g.Pattern, g.Excludes, fileListFile, depFile)
} else {