Wait for ninja proto processing to finish when exiting
Wait for the ninja proto processing goroutine to notice the fifo
has closed and exit before continuing.
Test: m nothing
Change-Id: I8cf5f3b8bf6a91496c6d2bbbd3e811eb7f0c9d21
diff --git a/ui/build/soong.go b/ui/build/soong.go
index c89f0d5..2ce1ac9 100644
--- a/ui/build/soong.go
+++ b/ui/build/soong.go
@@ -109,7 +109,8 @@
defer ctx.EndTrace()
fifo := filepath.Join(config.OutDir(), ".ninja_fifo")
- status.NinjaReader(ctx, ctx.Status.StartTool(), fifo)
+ nr := status.NewNinjaReader(ctx, ctx.Status.StartTool(), fifo)
+ defer nr.Close()
cmd := Command(ctx, config, "soong "+name,
config.PrebuiltBuildTool("ninja"),