Lines Matching refs:ctx
28 func SetupOutDir(ctx Context, config Config) {
29 ensureEmptyFileExists(ctx, filepath.Join(config.OutDir(), "Android.mk"))
30 ensureEmptyFileExists(ctx, filepath.Join(config.OutDir(), "CleanSpec.mk"))
32 ensureEmptyFileExists(ctx, filepath.Join(config.SoongOutDir(), ".soong.in_make"))
36 ensureEmptyFileExists(ctx, filepath.Join(config.OutDir(), "ninja_build"))
37 ensureEmptyFileExists(ctx, filepath.Join(config.OutDir(), ".out-dir"))
42 ctx.Fatalln("Failed to write BUILD_DATETIME to file:", err)
45 ctx.Fatalln("Missing BUILD_DATETIME_FILE")
62 func createCombinedBuildNinjaFile(ctx Context, config Config) {
72 ctx.Fatalln("Failed to create combined ninja file:", err)
77 ctx.Fatalln("Failed to write combined ninja file:", err)
91 func checkProblematicFiles(ctx Context) {
95 absolute := absPath(ctx, file)
96 ctx.Printf("Found %s in tree root. This file needs to be removed to build.\n", file)
97 ctx.Fatalf(" rm %s\n", absolute)
102 func checkCaseSensitivity(ctx Context, config Config) {
111 ctx.Fatalln("Failed to check case sensitivity:", err)
116 ctx.Fatalln("Failed to check case sensitivity:", err)
121 ctx.Fatalln("Failed to check case sensitivity:", err)
125 ctx.Println("************************************************************")
126 ctx.Println("You are building on a case-insensitive filesystem.")
127 ctx.Println("Please move your source tree to a case-sensitive filesystem.")
128 ctx.Println("************************************************************")
129 ctx.Fatalln("Case-insensitive filesystems not supported")
133 func help(ctx Context, config Config, what int) {
134 cmd := Command(ctx, config, "help.sh", "build/make/help.sh")
141 func Build(ctx Context, config Config, what int) {
142 ctx.Verboseln("Starting build with args:", config.Arguments())
143 ctx.Verboseln("Environment:", config.Environment().Environ())
147 ctx.Verbosef("Total RAM: %.3vGB", ram)
150 ctx.Println("************************************************************")
151 ctx.Printf("You are building on a machine with %.3vGB of RAM\n", ram)
152 ctx.Println("")
153 ctx.Println("The minimum required amount of free memory is around 16GB,")
154 ctx.Println("and even with that, some configurations may not work.")
155 ctx.Println("")
156 ctx.Println("If you run into segfaults or other errors, try reducing your")
157 ctx.Println("-j value.")
158 ctx.Println("************************************************************")
160 ctx.Printf("Warning: high -j%d count compared to %.3vGB of RAM", config.Parallel(), ram)
161 ctx.Println("If you run into segfaults or other errors, try a lower -j value")
165 ctx.BeginTrace(metrics.Total, "total")
166 defer ctx.EndTrace()
169 ctx.Verboseln("Skipping Make/Kati as requested")
174 help(ctx, config, what)
177 clean(ctx, config, what)
182 buildLock := BecomeSingletonOrFail(ctx, config)
185 checkProblematicFiles(ctx)
187 SetupOutDir(ctx, config)
189 checkCaseSensitivity(ctx, config)
191 ensureEmptyDirectoriesExist(ctx, config.TempDir())
193 SetupPath(ctx, config)
197 startGoma(ctx, config)
202 startRBE(ctx, config)
207 runMakeProductConfig(ctx, config)
212 installClean(ctx, config, what)
213 ctx.Println("Deleted images and staging directories.")
217 dataClean(ctx, config, what)
218 ctx.Println("Deleted data files.")
224 runSoong(ctx, config)
229 genKatiSuffix(ctx, config)
230 runKatiCleanSpec(ctx, config)
231 runKatiBuild(ctx, config)
232 runKatiPackage(ctx, config)
238 ctx.Verboseln("Loaded previous kati config:", string(katiSuffix))
244 createCombinedBuildNinjaFile(ctx, config)
246 distGzipFile(ctx, config, config.CombinedNinjaFile())
249 testForDanglingRules(ctx, config)
254 installCleanIfNecessary(ctx, config)
258 runNinja(ctx, config)
264 func distGzipFile(ctx Context, config Config, src string, subDirs ...string) {
274 ctx.Printf("failed to mkdir %s: %s", destDir, err.Error())
280 ctx.Printf("failed to dist %s: %s", filepath.Base(src), err.Error())
286 func distFile(ctx Context, config Config, src string, subDirs ...string) {
296 ctx.Printf("failed to mkdir %s: %s", destDir, err.Error())
302 ctx.Printf("failed to dist %s: %s", filepath.Base(src), err.Error())