Dan Willemsen | 1e70446 | 2016-08-21 15:17:17 -0700 | [diff] [blame] | 1 | // Copyright 2017 Google Inc. All rights reserved. |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | package build |
| 16 | |
| 17 | import ( |
Dan Willemsen | c2af0be | 2017-01-20 14:10:01 -0800 | [diff] [blame] | 18 | "log" |
| 19 | "os" |
Dan Willemsen | 1e70446 | 2016-08-21 15:17:17 -0700 | [diff] [blame] | 20 | "path/filepath" |
| 21 | "runtime" |
| 22 | "strconv" |
| 23 | "strings" |
Jeff Gaston | efc1b41 | 2017-03-29 17:29:06 -0700 | [diff] [blame] | 24 | |
| 25 | "android/soong/shared" |
Dan Willemsen | 1e70446 | 2016-08-21 15:17:17 -0700 | [diff] [blame] | 26 | ) |
| 27 | |
| 28 | type Config struct{ *configImpl } |
| 29 | |
| 30 | type configImpl struct { |
| 31 | // From the environment |
| 32 | arguments []string |
| 33 | goma bool |
| 34 | environ *Environment |
| 35 | |
| 36 | // From the arguments |
| 37 | parallel int |
| 38 | keepGoing int |
| 39 | verbose bool |
Dan Willemsen | 8a073a8 | 2017-02-04 17:30:44 -0800 | [diff] [blame] | 40 | dist bool |
Dan Willemsen | 1e70446 | 2016-08-21 15:17:17 -0700 | [diff] [blame] | 41 | |
| 42 | // From the product config |
Dan Willemsen | 02781d5 | 2017-05-12 19:28:13 -0700 | [diff] [blame] | 43 | katiArgs []string |
| 44 | ninjaArgs []string |
| 45 | katiSuffix string |
| 46 | targetDevice string |
Dan Willemsen | 1e70446 | 2016-08-21 15:17:17 -0700 | [diff] [blame] | 47 | } |
| 48 | |
Dan Willemsen | c2af0be | 2017-01-20 14:10:01 -0800 | [diff] [blame] | 49 | const srcDirFileCheck = "build/soong/root.bp" |
| 50 | |
Dan Willemsen | 1e70446 | 2016-08-21 15:17:17 -0700 | [diff] [blame] | 51 | func NewConfig(ctx Context, args ...string) Config { |
| 52 | ret := &configImpl{ |
| 53 | environ: OsEnvironment(), |
| 54 | } |
| 55 | |
Dan Willemsen | 9b58749 | 2017-07-10 22:13:00 -0700 | [diff] [blame] | 56 | // Sane default matching ninja |
| 57 | ret.parallel = runtime.NumCPU() + 2 |
| 58 | ret.keepGoing = 1 |
| 59 | |
| 60 | ret.parseArgs(ctx, args) |
| 61 | |
Dan Willemsen | 0c3919e | 2017-03-02 15:49:10 -0800 | [diff] [blame] | 62 | // Make sure OUT_DIR is set appropriately |
Dan Willemsen | 02f3add | 2017-05-12 13:50:19 -0700 | [diff] [blame] | 63 | if outDir, ok := ret.environ.Get("OUT_DIR"); ok { |
| 64 | ret.environ.Set("OUT_DIR", filepath.Clean(outDir)) |
| 65 | } else { |
Dan Willemsen | 0c3919e | 2017-03-02 15:49:10 -0800 | [diff] [blame] | 66 | outDir := "out" |
| 67 | if baseDir, ok := ret.environ.Get("OUT_DIR_COMMON_BASE"); ok { |
| 68 | if wd, err := os.Getwd(); err != nil { |
| 69 | ctx.Fatalln("Failed to get working directory:", err) |
| 70 | } else { |
| 71 | outDir = filepath.Join(baseDir, filepath.Base(wd)) |
| 72 | } |
| 73 | } |
| 74 | ret.environ.Set("OUT_DIR", outDir) |
| 75 | } |
| 76 | |
Dan Willemsen | 1e70446 | 2016-08-21 15:17:17 -0700 | [diff] [blame] | 77 | ret.environ.Unset( |
| 78 | // We're already using it |
| 79 | "USE_SOONG_UI", |
| 80 | |
| 81 | // We should never use GOROOT/GOPATH from the shell environment |
| 82 | "GOROOT", |
| 83 | "GOPATH", |
| 84 | |
| 85 | // These should only come from Soong, not the environment. |
| 86 | "CLANG", |
| 87 | "CLANG_CXX", |
| 88 | "CCC_CC", |
| 89 | "CCC_CXX", |
| 90 | |
| 91 | // Used by the goma compiler wrapper, but should only be set by |
| 92 | // gomacc |
| 93 | "GOMACC_PATH", |
Dan Willemsen | 0c3919e | 2017-03-02 15:49:10 -0800 | [diff] [blame] | 94 | |
| 95 | // We handle this above |
| 96 | "OUT_DIR_COMMON_BASE", |
Dan Willemsen | 68a0985 | 2017-04-18 13:56:57 -0700 | [diff] [blame] | 97 | |
| 98 | // Variables that have caused problems in the past |
| 99 | "DISPLAY", |
| 100 | "GREP_OPTIONS", |
Dan Willemsen | c40e10b | 2017-07-11 14:30:00 -0700 | [diff] [blame^] | 101 | |
| 102 | // Drop make flags |
| 103 | "MAKEFLAGS", |
| 104 | "MAKELEVEL", |
| 105 | "MFLAGS", |
Dan Willemsen | 1e70446 | 2016-08-21 15:17:17 -0700 | [diff] [blame] | 106 | ) |
| 107 | |
| 108 | // Tell python not to spam the source tree with .pyc files. |
| 109 | ret.environ.Set("PYTHONDONTWRITEBYTECODE", "1") |
| 110 | |
Dan Willemsen | c2af0be | 2017-01-20 14:10:01 -0800 | [diff] [blame] | 111 | // Precondition: the current directory is the top of the source tree |
| 112 | if _, err := os.Stat(srcDirFileCheck); err != nil { |
| 113 | if os.IsNotExist(err) { |
| 114 | log.Fatalf("Current working directory must be the source tree. %q not found", srcDirFileCheck) |
| 115 | } |
| 116 | log.Fatalln("Error verifying tree state:", err) |
| 117 | } |
| 118 | |
Dan Willemsen | db8457c | 2017-05-12 16:38:17 -0700 | [diff] [blame] | 119 | if srcDir, err := filepath.Abs("."); err == nil { |
| 120 | if strings.ContainsRune(srcDir, ' ') { |
| 121 | log.Println("You are building in a directory whose absolute path contains a space character:") |
| 122 | log.Println() |
| 123 | log.Printf("%q\n", srcDir) |
| 124 | log.Println() |
| 125 | log.Fatalln("Directory names containing spaces are not supported") |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | if outDir := ret.OutDir(); strings.ContainsRune(outDir, ' ') { |
| 130 | log.Println("The absolute path of your output directory ($OUT_DIR) contains a space character:") |
| 131 | log.Println() |
| 132 | log.Printf("%q\n", outDir) |
| 133 | log.Println() |
| 134 | log.Fatalln("Directory names containing spaces are not supported") |
| 135 | } |
| 136 | |
| 137 | if distDir := ret.DistDir(); strings.ContainsRune(distDir, ' ') { |
| 138 | log.Println("The absolute path of your dist directory ($DIST_DIR) contains a space character:") |
| 139 | log.Println() |
| 140 | log.Printf("%q\n", distDir) |
| 141 | log.Println() |
| 142 | log.Fatalln("Directory names containing spaces are not supported") |
| 143 | } |
| 144 | |
Dan Willemsen | 9b58749 | 2017-07-10 22:13:00 -0700 | [diff] [blame] | 145 | return Config{ret} |
| 146 | } |
| 147 | |
| 148 | func (c *configImpl) parseArgs(ctx Context, args []string) { |
| 149 | for i := 0; i < len(args); i++ { |
| 150 | arg := strings.TrimSpace(args[i]) |
Dan Willemsen | 1e70446 | 2016-08-21 15:17:17 -0700 | [diff] [blame] | 151 | if arg == "--make-mode" { |
| 152 | continue |
| 153 | } else if arg == "showcommands" { |
Dan Willemsen | 9b58749 | 2017-07-10 22:13:00 -0700 | [diff] [blame] | 154 | c.verbose = true |
Dan Willemsen | 1e70446 | 2016-08-21 15:17:17 -0700 | [diff] [blame] | 155 | continue |
Dan Willemsen | 8a073a8 | 2017-02-04 17:30:44 -0800 | [diff] [blame] | 156 | } else if arg == "dist" { |
Dan Willemsen | 9b58749 | 2017-07-10 22:13:00 -0700 | [diff] [blame] | 157 | c.dist = true |
Dan Willemsen | 1e70446 | 2016-08-21 15:17:17 -0700 | [diff] [blame] | 158 | } |
| 159 | if arg[0] == '-' { |
Dan Willemsen | 9b58749 | 2017-07-10 22:13:00 -0700 | [diff] [blame] | 160 | parseArgNum := func(def int) int { |
| 161 | if len(arg) > 2 { |
| 162 | p, err := strconv.ParseUint(arg[2:], 10, 31) |
| 163 | if err != nil { |
| 164 | ctx.Fatalf("Failed to parse %q: %v", arg, err) |
| 165 | } |
| 166 | return int(p) |
| 167 | } else if i+1 < len(args) { |
| 168 | p, err := strconv.ParseUint(args[i+1], 10, 31) |
| 169 | if err == nil { |
| 170 | i++ |
| 171 | return int(p) |
| 172 | } |
| 173 | } |
| 174 | return def |
| 175 | } |
| 176 | |
Dan Willemsen | 1e70446 | 2016-08-21 15:17:17 -0700 | [diff] [blame] | 177 | if arg[1] == 'j' { |
Dan Willemsen | 9b58749 | 2017-07-10 22:13:00 -0700 | [diff] [blame] | 178 | c.parallel = parseArgNum(c.parallel) |
Dan Willemsen | 1e70446 | 2016-08-21 15:17:17 -0700 | [diff] [blame] | 179 | } else if arg[1] == 'k' { |
Dan Willemsen | 9b58749 | 2017-07-10 22:13:00 -0700 | [diff] [blame] | 180 | c.keepGoing = parseArgNum(0) |
Dan Willemsen | 1e70446 | 2016-08-21 15:17:17 -0700 | [diff] [blame] | 181 | } else { |
| 182 | ctx.Fatalln("Unknown option:", arg) |
| 183 | } |
Dan Willemsen | 091525e | 2017-07-11 14:17:50 -0700 | [diff] [blame] | 184 | } else if k, v, ok := decodeKeyValue(arg); ok && len(k) > 0 { |
| 185 | c.environ.Set(k, v) |
Dan Willemsen | 1e70446 | 2016-08-21 15:17:17 -0700 | [diff] [blame] | 186 | } else { |
Dan Willemsen | 9b58749 | 2017-07-10 22:13:00 -0700 | [diff] [blame] | 187 | c.arguments = append(c.arguments, arg) |
Dan Willemsen | 1e70446 | 2016-08-21 15:17:17 -0700 | [diff] [blame] | 188 | } |
| 189 | } |
Dan Willemsen | 1e70446 | 2016-08-21 15:17:17 -0700 | [diff] [blame] | 190 | } |
| 191 | |
| 192 | // Lunch configures the environment for a specific product similarly to the |
| 193 | // `lunch` bash function. |
| 194 | func (c *configImpl) Lunch(ctx Context, product, variant string) { |
| 195 | if variant != "eng" && variant != "userdebug" && variant != "user" { |
| 196 | ctx.Fatalf("Invalid variant %q. Must be one of 'user', 'userdebug' or 'eng'", variant) |
| 197 | } |
| 198 | |
| 199 | c.environ.Set("TARGET_PRODUCT", product) |
| 200 | c.environ.Set("TARGET_BUILD_VARIANT", variant) |
| 201 | c.environ.Set("TARGET_BUILD_TYPE", "release") |
| 202 | c.environ.Unset("TARGET_BUILD_APPS") |
| 203 | } |
| 204 | |
| 205 | // Tapas configures the environment to build one or more unbundled apps, |
| 206 | // similarly to the `tapas` bash function. |
| 207 | func (c *configImpl) Tapas(ctx Context, apps []string, arch, variant string) { |
| 208 | if len(apps) == 0 { |
| 209 | apps = []string{"all"} |
| 210 | } |
| 211 | if variant == "" { |
| 212 | variant = "eng" |
| 213 | } |
| 214 | |
| 215 | if variant != "eng" && variant != "userdebug" && variant != "user" { |
| 216 | ctx.Fatalf("Invalid variant %q. Must be one of 'user', 'userdebug' or 'eng'", variant) |
| 217 | } |
| 218 | |
| 219 | var product string |
| 220 | switch arch { |
| 221 | case "armv5": |
| 222 | product = "generic_armv5" |
| 223 | case "arm", "": |
| 224 | product = "aosp_arm" |
| 225 | case "arm64": |
| 226 | product = "aosm_arm64" |
| 227 | case "mips": |
| 228 | product = "aosp_mips" |
| 229 | case "mips64": |
| 230 | product = "aosp_mips64" |
| 231 | case "x86": |
| 232 | product = "aosp_x86" |
| 233 | case "x86_64": |
| 234 | product = "aosp_x86_64" |
| 235 | default: |
| 236 | ctx.Fatalf("Invalid architecture: %q", arch) |
| 237 | } |
| 238 | |
| 239 | c.environ.Set("TARGET_PRODUCT", product) |
| 240 | c.environ.Set("TARGET_BUILD_VARIANT", variant) |
| 241 | c.environ.Set("TARGET_BUILD_TYPE", "release") |
| 242 | c.environ.Set("TARGET_BUILD_APPS", strings.Join(apps, " ")) |
| 243 | } |
| 244 | |
| 245 | func (c *configImpl) Environment() *Environment { |
| 246 | return c.environ |
| 247 | } |
| 248 | |
| 249 | func (c *configImpl) Arguments() []string { |
| 250 | return c.arguments |
| 251 | } |
| 252 | |
| 253 | func (c *configImpl) OutDir() string { |
| 254 | if outDir, ok := c.environ.Get("OUT_DIR"); ok { |
| 255 | return outDir |
| 256 | } |
| 257 | return "out" |
| 258 | } |
| 259 | |
Dan Willemsen | 8a073a8 | 2017-02-04 17:30:44 -0800 | [diff] [blame] | 260 | func (c *configImpl) DistDir() string { |
| 261 | if distDir, ok := c.environ.Get("DIST_DIR"); ok { |
| 262 | return distDir |
| 263 | } |
| 264 | return filepath.Join(c.OutDir(), "dist") |
| 265 | } |
| 266 | |
Dan Willemsen | 1e70446 | 2016-08-21 15:17:17 -0700 | [diff] [blame] | 267 | func (c *configImpl) NinjaArgs() []string { |
| 268 | return c.ninjaArgs |
| 269 | } |
| 270 | |
| 271 | func (c *configImpl) SoongOutDir() string { |
| 272 | return filepath.Join(c.OutDir(), "soong") |
| 273 | } |
| 274 | |
Jeff Gaston | efc1b41 | 2017-03-29 17:29:06 -0700 | [diff] [blame] | 275 | func (c *configImpl) TempDir() string { |
| 276 | return shared.TempDirForOutDir(c.SoongOutDir()) |
| 277 | } |
| 278 | |
Dan Willemsen | 1e70446 | 2016-08-21 15:17:17 -0700 | [diff] [blame] | 279 | func (c *configImpl) KatiSuffix() string { |
| 280 | if c.katiSuffix != "" { |
| 281 | return c.katiSuffix |
| 282 | } |
| 283 | panic("SetKatiSuffix has not been called") |
| 284 | } |
| 285 | |
Dan Willemsen | 8a073a8 | 2017-02-04 17:30:44 -0800 | [diff] [blame] | 286 | func (c *configImpl) Dist() bool { |
| 287 | return c.dist |
| 288 | } |
| 289 | |
Dan Willemsen | 1e70446 | 2016-08-21 15:17:17 -0700 | [diff] [blame] | 290 | func (c *configImpl) IsVerbose() bool { |
| 291 | return c.verbose |
| 292 | } |
| 293 | |
| 294 | func (c *configImpl) TargetProduct() string { |
| 295 | if v, ok := c.environ.Get("TARGET_PRODUCT"); ok { |
| 296 | return v |
| 297 | } |
| 298 | panic("TARGET_PRODUCT is not defined") |
| 299 | } |
| 300 | |
Dan Willemsen | 02781d5 | 2017-05-12 19:28:13 -0700 | [diff] [blame] | 301 | func (c *configImpl) TargetDevice() string { |
| 302 | return c.targetDevice |
| 303 | } |
| 304 | |
| 305 | func (c *configImpl) SetTargetDevice(device string) { |
| 306 | c.targetDevice = device |
| 307 | } |
| 308 | |
| 309 | func (c *configImpl) TargetBuildVariant() string { |
| 310 | if v, ok := c.environ.Get("TARGET_BUILD_VARIANT"); ok { |
| 311 | return v |
| 312 | } |
| 313 | panic("TARGET_BUILD_VARIANT is not defined") |
| 314 | } |
| 315 | |
Dan Willemsen | 1e70446 | 2016-08-21 15:17:17 -0700 | [diff] [blame] | 316 | func (c *configImpl) KatiArgs() []string { |
| 317 | return c.katiArgs |
| 318 | } |
| 319 | |
| 320 | func (c *configImpl) Parallel() int { |
| 321 | return c.parallel |
| 322 | } |
| 323 | |
| 324 | func (c *configImpl) UseGoma() bool { |
| 325 | if v, ok := c.environ.Get("USE_GOMA"); ok { |
| 326 | v = strings.TrimSpace(v) |
| 327 | if v != "" && v != "false" { |
| 328 | return true |
| 329 | } |
| 330 | } |
| 331 | return false |
| 332 | } |
| 333 | |
| 334 | // RemoteParallel controls how many remote jobs (i.e., commands which contain |
Jeff Gaston | efc1b41 | 2017-03-29 17:29:06 -0700 | [diff] [blame] | 335 | // gomacc) are run in parallel. Note the parallelism of all other jobs is |
Dan Willemsen | 1e70446 | 2016-08-21 15:17:17 -0700 | [diff] [blame] | 336 | // still limited by Parallel() |
| 337 | func (c *configImpl) RemoteParallel() int { |
| 338 | if v, ok := c.environ.Get("NINJA_REMOTE_NUM_JOBS"); ok { |
| 339 | if i, err := strconv.Atoi(v); err == nil { |
| 340 | return i |
| 341 | } |
| 342 | } |
| 343 | return 500 |
| 344 | } |
| 345 | |
| 346 | func (c *configImpl) SetKatiArgs(args []string) { |
| 347 | c.katiArgs = args |
| 348 | } |
| 349 | |
| 350 | func (c *configImpl) SetNinjaArgs(args []string) { |
| 351 | c.ninjaArgs = args |
| 352 | } |
| 353 | |
| 354 | func (c *configImpl) SetKatiSuffix(suffix string) { |
| 355 | c.katiSuffix = suffix |
| 356 | } |
| 357 | |
| 358 | func (c *configImpl) KatiEnvFile() string { |
| 359 | return filepath.Join(c.OutDir(), "env"+c.KatiSuffix()+".sh") |
| 360 | } |
| 361 | |
| 362 | func (c *configImpl) KatiNinjaFile() string { |
| 363 | return filepath.Join(c.OutDir(), "build"+c.KatiSuffix()+".ninja") |
| 364 | } |
| 365 | |
| 366 | func (c *configImpl) SoongNinjaFile() string { |
| 367 | return filepath.Join(c.SoongOutDir(), "build.ninja") |
| 368 | } |
| 369 | |
| 370 | func (c *configImpl) CombinedNinjaFile() string { |
| 371 | return filepath.Join(c.OutDir(), "combined"+c.KatiSuffix()+".ninja") |
| 372 | } |
| 373 | |
| 374 | func (c *configImpl) SoongAndroidMk() string { |
| 375 | return filepath.Join(c.SoongOutDir(), "Android-"+c.TargetProduct()+".mk") |
| 376 | } |
| 377 | |
| 378 | func (c *configImpl) SoongMakeVarsMk() string { |
| 379 | return filepath.Join(c.SoongOutDir(), "make_vars-"+c.TargetProduct()+".mk") |
| 380 | } |
| 381 | |
Dan Willemsen | f052f78 | 2017-05-18 15:29:04 -0700 | [diff] [blame] | 382 | func (c *configImpl) ProductOut() string { |
| 383 | if buildType, ok := c.environ.Get("TARGET_BUILD_TYPE"); ok && buildType == "debug" { |
| 384 | return filepath.Join(c.OutDir(), "debug", "target", "product", c.TargetDevice()) |
| 385 | } else { |
| 386 | return filepath.Join(c.OutDir(), "target", "product", c.TargetDevice()) |
| 387 | } |
| 388 | } |
| 389 | |
Dan Willemsen | 02781d5 | 2017-05-12 19:28:13 -0700 | [diff] [blame] | 390 | func (c *configImpl) DevicePreviousProductConfig() string { |
Dan Willemsen | f052f78 | 2017-05-18 15:29:04 -0700 | [diff] [blame] | 391 | return filepath.Join(c.ProductOut(), "previous_build_config.mk") |
| 392 | } |
| 393 | |
| 394 | func (c *configImpl) hostOutRoot() string { |
| 395 | if buildType, ok := c.environ.Get("HOST_BUILD_TYPE"); ok && buildType == "debug" { |
| 396 | return filepath.Join(c.OutDir(), "debug", "host") |
| 397 | } else { |
| 398 | return filepath.Join(c.OutDir(), "host") |
| 399 | } |
| 400 | } |
| 401 | |
| 402 | func (c *configImpl) HostOut() string { |
| 403 | return filepath.Join(c.hostOutRoot(), c.HostPrebuiltTag()) |
| 404 | } |
| 405 | |
| 406 | // This probably needs to be multi-valued, so not exporting it for now |
| 407 | func (c *configImpl) hostCrossOut() string { |
| 408 | if runtime.GOOS == "linux" { |
| 409 | return filepath.Join(c.hostOutRoot(), "windows-x86") |
| 410 | } else { |
| 411 | return "" |
| 412 | } |
Dan Willemsen | 02781d5 | 2017-05-12 19:28:13 -0700 | [diff] [blame] | 413 | } |
| 414 | |
Dan Willemsen | 1e70446 | 2016-08-21 15:17:17 -0700 | [diff] [blame] | 415 | func (c *configImpl) HostPrebuiltTag() string { |
| 416 | if runtime.GOOS == "linux" { |
| 417 | return "linux-x86" |
| 418 | } else if runtime.GOOS == "darwin" { |
| 419 | return "darwin-x86" |
| 420 | } else { |
| 421 | panic("Unsupported OS") |
| 422 | } |
| 423 | } |
Dan Willemsen | f173d59 | 2017-04-27 14:28:00 -0700 | [diff] [blame] | 424 | |
Dan Willemsen | a3e6c52 | 2017-05-05 15:29:20 -0700 | [diff] [blame] | 425 | func (c *configImpl) HostAsan() bool { |
Dan Willemsen | f173d59 | 2017-04-27 14:28:00 -0700 | [diff] [blame] | 426 | if v, ok := c.environ.Get("SANITIZE_HOST"); ok { |
| 427 | if sanitize := strings.Fields(v); inList("address", sanitize) { |
Dan Willemsen | a3e6c52 | 2017-05-05 15:29:20 -0700 | [diff] [blame] | 428 | return true |
| 429 | } |
| 430 | } |
| 431 | return false |
| 432 | } |
| 433 | |
| 434 | func (c *configImpl) PrebuiltBuildTool(name string) string { |
| 435 | // (b/36182021) We're seeing rare ckati crashes, so always enable asan kati on the build servers. |
| 436 | if c.HostAsan() || (c.Dist() && name == "ckati") { |
| 437 | asan := filepath.Join("prebuilts/build-tools", c.HostPrebuiltTag(), "asan/bin", name) |
| 438 | if _, err := os.Stat(asan); err == nil { |
| 439 | return asan |
Dan Willemsen | f173d59 | 2017-04-27 14:28:00 -0700 | [diff] [blame] | 440 | } |
| 441 | } |
| 442 | return filepath.Join("prebuilts/build-tools", c.HostPrebuiltTag(), "bin", name) |
| 443 | } |