diff options
| author | Colin Cross <ccross@android.com> | 2020-01-16 10:36:56 -0800 |
|---|---|---|
| committer | Colin Cross <ccross@android.com> | 2020-01-16 10:57:08 -0800 |
| commit | 67d0cbed9086b596139346b9291f954d7d137279 (patch) | |
| tree | c082a3e8753189e10740661d03e7d70f0c275061 /bootstrap/glob.go | |
| parent | 1cda3fd3e4b1cbd4f9fed8ac59faa1be1954edff (diff) | |
| download | platform_build_blueprint-67d0cbed9086b596139346b9291f954d7d137279.tar.gz platform_build_blueprint-67d0cbed9086b596139346b9291f954d7d137279.tar.bz2 platform_build_blueprint-67d0cbed9086b596139346b9291f954d7d137279.zip | |
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
Diffstat (limited to 'bootstrap/glob.go')
| -rw-r--r-- | bootstrap/glob.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/bootstrap/glob.go b/bootstrap/glob.go index 9841611..52dbf2f 100644 --- a/bootstrap/glob.go +++ b/bootstrap/glob.go @@ -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 { |
