aboutsummaryrefslogtreecommitdiffstats
path: root/genrule
diff options
context:
space:
mode:
authorNan Zhang <nanzhang@google.com>2018-03-27 16:19:42 -0700
committerColin Cross <ccross@android.com>2018-03-28 05:12:15 +0000
commite42777a05a1f4bdde22b0dce03f3361e52e2dbae (patch)
tree065a778103977c316e0cd0ae105f52d3bf465f5a /genrule
parent215cedde6a6243bf5203bcd1e15e4a2d6bbc7182 (diff)
downloadbuild_soong-e42777a05a1f4bdde22b0dce03f3361e52e2dbae.tar.gz
build_soong-e42777a05a1f4bdde22b0dce03f3361e52e2dbae.tar.bz2
build_soong-e42777a05a1f4bdde22b0dce03f3361e52e2dbae.zip
Fix the flaky build breakage for droiddoc target.
ExpandSourcesSubDir was calling SourceFileProducer.Srcs(), and then doing: moduleSrcs = append(moduleSrcs[:j], moduleSrcs[j+1:]...) This modifies the backing store of the slice, which may affect the original data stored in the SourceFileProducer. Make all Srcs implementations return slice that points to a copy of the backing array. Test: m out/target/common/obj/PACKAGING/checkpublicapi-current-timestamp Bug: b/76179848 b/76397326 Change-Id: I2432ce196984814daafc5aa9a2746e81de74494c
Diffstat (limited to 'genrule')
-rw-r--r--genrule/filegroup.go2
-rw-r--r--genrule/genrule.go2
2 files changed, 2 insertions, 2 deletions
diff --git a/genrule/filegroup.go b/genrule/filegroup.go
index 9f4aa10d..2cff5fee 100644
--- a/genrule/filegroup.go
+++ b/genrule/filegroup.go
@@ -70,7 +70,7 @@ func (fg *fileGroup) GenerateAndroidBuildActions(ctx android.ModuleContext) {
}
func (fg *fileGroup) Srcs() android.Paths {
- return fg.srcs
+ return append(android.Paths{}, fg.srcs...)
}
var androidMkTemplate = template.Must(template.New("filegroup").Parse(`
diff --git a/genrule/genrule.go b/genrule/genrule.go
index 0cd110ce..42be88fe 100644
--- a/genrule/genrule.go
+++ b/genrule/genrule.go
@@ -125,7 +125,7 @@ func (g *Module) GeneratedSourceFiles() android.Paths {
}
func (g *Module) Srcs() android.Paths {
- return g.outputFiles
+ return append(android.Paths{}, g.outputFiles...)
}
func (g *Module) GeneratedHeaderDirs() android.Paths {