1# Soong 2 3Soong is one of the build systems used in Android. There are altogether three: 4* The legacy Make-based build system that is controlled by files called 5 `Android.mk`. 6* Soong, which is controlled by files called `Android.bp`. 7* The upcoming Bazel-based build system that is controlled by files called 8 `BUILD.bazel`. 9 10`Android.bp` file are JSON-like declarative descriptions of "modules" to build; 11a "module" is the basic unit of building that Soong understands, similarly to 12how "target" is the basic unit of building for Bazel (and Make, although the 13two kinds of "targets" are very different) 14 15See [Simple Build 16Configuration](https://source.android.com/compatibility/tests/development/blueprints) 17on source.android.com to read how Soong is configured for testing. 18 19### Contributing 20 21Code reviews are handled through the usual code review system of Android, 22available [here](https://android-review.googlesource.com/dashboard/self). 23 24For simple changes (fixing typos, obvious optimizations, etc.), sending a code 25review request is enough. For more substantial changes, file a bug in our 26[bug tracker](https://issuetracker.google.com/issues/new?component=381517) or 27or write us at android-building@googlegroups.com . 28 29For Googlers, see our [internal documentation](http://go/soong). 30 31## Android.bp file format 32 33By design, Android.bp files are very simple. There are no conditionals or 34control flow statements - any complexity is handled in build logic written in 35Go. The syntax and semantics of Android.bp files are intentionally similar 36to [Bazel BUILD files](https://bazel.build/concepts/build-files) when possible. 37 38### Modules 39 40A module in an Android.bp file starts with a module type, followed by a set of 41properties in `name: value,` format: 42 43``` 44cc_binary { 45 name: "gzip", 46 srcs: ["src/test/minigzip.c"], 47 shared_libs: ["libz"], 48 stl: "none", 49} 50``` 51 52Every module must have a `name` property, and the value must be unique across 53all Android.bp files. 54 55The list of valid module types and their properties can be generated by calling 56`m soong_docs`. It will be written to `$OUT_DIR/soong/docs/soong_build.html`. 57This list for the current version of Soong can be found [here](https://ci.android.com/builds/latest/branches/aosp-build-tools/targets/linux/view/soong_build.html). 58 59### File lists 60 61Properties that take a list of files can also take glob patterns and output path 62expansions. 63 64* Glob patterns can contain the normal Unix wildcard `*`, for example `"*.java"`. 65 66 Glob patterns can also contain a single `**` wildcard as a path element, which 67 will match zero or more path elements. For example, `java/**/*.java` will match 68 `java/Main.java` and `java/com/android/Main.java`. 69 70* Output path expansions take the format `:module` or `:module{.tag}`, where 71 `module` is the name of a module that produces output files, and it expands to 72 a list of those output files. With the optional `{.tag}` suffix, the module 73 may produce a different list of outputs according to `tag`. 74 75 For example, a `droiddoc` module with the name "my-docs" would return its 76 `.stubs.srcjar` output with `":my-docs"`, and its `.doc.zip` file with 77 `":my-docs{.doc.zip}"`. 78 79 This is commonly used to reference `filegroup` modules, whose output files 80 consist of their `srcs`. 81 82### Variables 83 84An Android.bp file may contain top-level variable assignments: 85``` 86gzip_srcs = ["src/test/minigzip.c"], 87 88cc_binary { 89 name: "gzip", 90 srcs: gzip_srcs, 91 shared_libs: ["libz"], 92 stl: "none", 93} 94``` 95 96Variables are scoped to the remainder of the file they are declared in, as well 97as any child Android.bp files. Variables are immutable with one exception - they 98can be appended to with a += assignment, but only before they have been 99referenced. 100 101### Comments 102 103Android.bp files can contain C-style multiline `/* */` and C++ style single-line 104`//` comments. 105 106### Types 107 108Variables and properties are strongly typed. Variables are dynamically typed 109based on the first assignment, and properties are statically typed by the 110module type. The supported types are: 111* Bool (`true` or `false`) 112* Integers (`int`) 113* Strings (`"string"`) 114* Lists of strings (`["string1", "string2"]`) 115* Maps (`{key1: "value1", key2: ["value2"]}`) 116 117Maps may contain values of any type, including nested maps. Lists and maps may 118have trailing commas after the last value. 119 120Strings can contain double quotes using `\"`, for example `"cat \"a b\""`. 121 122### Operators 123 124The `+` operator: 125* Sums integers. 126* Concatenates strings and lists. 127* Produces the union of maps. 128 129Concatenating maps produces a map whose keys are the union of the given maps' 130keys, and whose mapped values are the union of the given maps' corresponding 131mapped values. 132 133### Defaults modules 134 135A `defaults` module can be used to repeat the same properties in multiple 136modules. For example: 137 138``` 139cc_defaults { 140 name: "gzip_defaults", 141 shared_libs: ["libz"], 142 stl: "none", 143} 144 145cc_binary { 146 name: "gzip", 147 defaults: ["gzip_defaults"], 148 srcs: ["src/test/minigzip.c"], 149} 150``` 151 152### Packages 153 154The build is organized into packages where each package is a collection of related files and a 155specification of the dependencies among them in the form of modules. 156 157A package is defined as a directory containing a file named `Android.bp`, residing beneath the 158top-level directory in the build and its name is its path relative to the top-level directory. A 159package includes all files in its directory, plus all subdirectories beneath it, except those which 160themselves contain an `Android.bp` file. 161 162The modules in a package's `Android.bp` and included files are part of the module. 163 164For example, in the following directory tree (where `.../android/` is the top-level Android 165directory) there are two packages, `my/app`, and the subpackage `my/app/tests`. Note that 166`my/app/data` is not a package, but a directory belonging to package `my/app`. 167 168 .../android/my/app/Android.bp 169 .../android/my/app/app.cc 170 .../android/my/app/data/input.txt 171 .../android/my/app/tests/Android.bp 172 .../android/my/app/tests/test.cc 173 174This is based on the Bazel package concept. 175 176The `package` module type allows information to be specified about a package. Only a single 177`package` module can be specified per package and in the case where there are multiple `.bp` files 178in the same package directory it is highly recommended that the `package` module (if required) is 179specified in the `Android.bp` file. 180 181Unlike most module type `package` does not have a `name` property. Instead the name is set to the 182name of the package, e.g. if the package is in `top/intermediate/package` then the package name is 183`//top/intermediate/package`. 184 185E.g. The following will set the default visibility for all the modules defined in the package and 186any subpackages that do not set their own default visibility (irrespective of whether they are in 187the same `.bp` file as the `package` module) to be visible to all the subpackages by default. 188 189``` 190package { 191 default_visibility: [":__subpackages__"] 192} 193``` 194 195### Referencing Modules 196 197A module `libfoo` can be referenced by its name 198 199``` 200cc_binary { 201 name: "app", 202 shared_libs: ["libfoo"], 203} 204``` 205 206Obviously, this works only if there is only one `libfoo` module in the source 207tree. Ensuring such name uniqueness for larger trees may become problematic. We 208might also want to use the same name in multiple mutually exclusive subtrees 209(for example, implementing different devices) deliberately in order to describe 210a functionally equivalent module. Enter Soong namespaces. 211 212#### Namespaces 213 214The presence of the `soong_namespace {..}` in an Android.bp file defines a 215**namespace**. For instance, having 216 217``` 218soong_namespace { 219 ... 220} 221... 222``` 223 224in `device/google/bonito/Android.bp` informs Soong that within the 225`device/google/bonito` package the module names are unique, that is, all the 226modules defined in the Android.bp files in the `device/google/bonito/` tree have 227unique names. However, there may be modules with the same names outside 228`device/google/bonito` tree. Indeed, there is a module `"pixelstats-vendor"` 229both in `device/google/bonito/pixelstats` and in 230`device/google/coral/pixelstats`. 231 232The name of a namespace is the path of its directory. The name of the namespace 233in the example above is thus `device/google/bonito`. 234 235An implicit **global namespace** corresponds to the source tree as a whole. It 236has empty name. 237 238A module name's **scope** is the smallest namespace containing it. Suppose a 239source tree has `device/my` and `device/my/display` namespaces. If `libfoo` 240module is defined in `device/my/display/lib/Android.bp`, its namespace is 241`device/my/display`. 242 243The name uniqueness thus means that module's name is unique within its scope. In 244other words, "//_scope_:_name_" is globally unique module reference, e.g, 245`"//device/google/bonito:pixelstats-vendor"`. _Note_ that the name of the 246namespace for a module may be different from module's package name: `libfoo` 247belongs to `device/my/display` namespace but is contained in 248`device/my/display/lib` package. 249 250#### Name Resolution 251 252The form of a module reference determines how Soong locates the module. 253 254For a **global reference** of the "//_scope_:_name_" form, Soong verifies there 255is a namespace called "_scope_", then verifies it contains a "_name_" module and 256uses it. Soong verifies there is only one "_name_" in "_scope_" at the beginning 257when it parses Android.bp files. 258 259A **local reference** has "_name_" form, and resolving it involves looking for a 260module "_name_" in one or more namespaces. By default only the global namespace 261is searched for "_name_" (in other words, only the modules not belonging to an 262explicitly defined scope are considered). The `imports` attribute of the 263`soong_namespaces` allows to specify where to look for modules . For instance, 264with `device/google/bonito/Android.bp` containing 265 266``` 267soong_namespace { 268 imports: [ 269 "hardware/google/interfaces", 270 "hardware/google/pixel", 271 "hardware/qcom/bootctrl", 272 ], 273} 274``` 275 276a reference to `"libpixelstats"` will resolve to the module defined in 277`hardware/google/pixel/pixelstats/Android.bp` because this module is in 278`hardware/google/pixel` namespace. 279 280**TODO**: Conventionally, languages with similar concepts provide separate 281constructs for namespace definition and name resolution (`namespace` and `using` 282in C++, for instance). Should Soong do that, too? 283 284#### Referencing modules in makefiles 285 286While we are gradually converting makefiles to Android.bp files, Android build 287is described by a mixture of Android.bp and Android.mk files, and a module 288defined in an Android.mk file can reference a module defined in Android.bp file. 289For instance, a binary still defined in an Android.mk file may have a library 290defined in already converted Android.bp as a dependency. 291 292A module defined in an Android.bp file and belonging to the global namespace can 293be referenced from a makefile without additional effort. If a module belongs to 294an explicit namespace, it can be referenced from a makefile only after after the 295name of the namespace has been added to the value of PRODUCT_SOONG_NAMESPACES 296variable. 297 298Note that makefiles have no notion of namespaces and exposing namespaces with 299the same modules via PRODUCT_SOONG_NAMESPACES may cause Make failure. For 300instance, exposing both `device/google/bonito` and `device/google/coral` 301namespaces will cause Make failure because it will see two targets for the 302`pixelstats-vendor` module. 303 304### Visibility 305 306The `visibility` property on a module controls whether the module can be 307used by other packages. Modules are always visible to other modules declared 308in the same package. This is based on the Bazel visibility mechanism. 309 310If specified the `visibility` property must contain at least one rule. 311 312Each rule in the property must be in one of the following forms: 313* `["//visibility:public"]`: Anyone can use this module. 314* `["//visibility:private"]`: Only rules in the module's package (not its 315subpackages) can use this module. 316* `["//visibility:override"]`: Discards any rules inherited from defaults or a 317creating module. Can only be used at the beginning of a list of visibility 318rules. 319* `["//some/package:__pkg__", "//other/package:__pkg__"]`: Only modules in 320`some/package` and `other/package` (defined in `some/package/*.bp` and 321`other/package/*.bp`) have access to this module. Note that sub-packages do not 322have access to the rule; for example, `//some/package/foo:bar` or 323`//other/package/testing:bla` wouldn't have access. `__pkg__` is a special 324module and must be used verbatim. It represents all of the modules in the 325package. 326* `["//project:__subpackages__", "//other:__subpackages__"]`: Only modules in 327packages `project` or `other` or in one of their sub-packages have access to 328this module. For example, `//project:rule`, `//project/library:lib` or 329`//other/testing/internal:munge` are allowed to depend on this rule (but not 330`//independent:evil`) 331* `["//project"]`: This is shorthand for `["//project:__pkg__"]` 332* `[":__subpackages__"]`: This is shorthand for `["//project:__subpackages__"]` 333where `//project` is the module's package, e.g. using `[":__subpackages__"]` in 334`packages/apps/Settings/Android.bp` is equivalent to 335`//packages/apps/Settings:__subpackages__`. 336* `["//visibility:legacy_public"]`: The default visibility, behaves as 337`//visibility:public` for now. It is an error if it is used in a module. 338 339The visibility rules of `//visibility:public` and `//visibility:private` cannot 340be combined with any other visibility specifications, except 341`//visibility:public` is allowed to override visibility specifications imported 342through the `defaults` property. 343 344Packages outside `vendor/` cannot make themselves visible to specific packages 345in `vendor/`, e.g. a module in `libcore` cannot declare that it is visible to 346say `vendor/google`, instead it must make itself visible to all packages within 347`vendor/` using `//vendor:__subpackages__`. 348 349If a module does not specify the `visibility` property then it uses the 350`default_visibility` property of the `package` module in the module's package. 351 352If the `default_visibility` property is not set for the module's package then 353it will use the `default_visibility` of its closest ancestor package for which 354a `default_visibility` property is specified. 355 356If no `default_visibility` property can be found then the module uses the 357global default of `//visibility:legacy_public`. 358 359The `visibility` property has no effect on a defaults module although it does 360apply to any non-defaults module that uses it. To set the visibility of a 361defaults module, use the `defaults_visibility` property on the defaults module; 362not to be confused with the `default_visibility` property on the package module. 363 364Once the build has been completely switched over to soong it is possible that a 365global refactoring will be done to change this to `//visibility:private` at 366which point all packages that do not currently specify a `default_visibility` 367property will be updated to have 368`default_visibility = [//visibility:legacy_public]` added. It will then be the 369owner's responsibility to replace that with a more appropriate visibility. 370 371### Formatter 372 373Soong includes a canonical formatter for Android.bp files, similar to 374[gofmt](https://golang.org/cmd/gofmt/). To recursively reformat all Android.bp files 375in the current directory: 376``` 377bpfmt -w . 378``` 379 380The canonical format includes 4 space indents, newlines after every element of a 381multi-element list, and always includes a trailing comma in lists and maps. 382 383### Convert Android.mk files 384 385Soong includes a tool perform a first pass at converting Android.mk files 386to Android.bp files: 387 388``` 389androidmk Android.mk > Android.bp 390``` 391 392The tool converts variables, modules, comments, and some conditionals, but any 393custom Makefile rules, complex conditionals or extra includes must be converted 394by hand. 395 396#### Differences between Android.mk and Android.bp 397 398* Android.mk files often have multiple modules with the same name (for example 399for static and shared version of a library, or for host and device versions). 400Android.bp files require unique names for every module, but a single module can 401be built in multiple variants, for example by adding `host_supported: true`. 402The androidmk converter will produce multiple conflicting modules, which must 403be resolved by hand to a single module with any differences inside 404`target: { android: { }, host: { } }` blocks. 405 406### Conditionals 407 408Soong deliberately does not support most conditionals in Android.bp files. We 409suggest removing most conditionals from the build. See 410[Best Practices](docs/best_practices.md#removing-conditionals) for some 411examples on how to remove conditionals. 412 413Most conditionals supported natively by Soong are converted to a map 414property. When building the module one of the properties in the map will be 415selected, and its values appended to the property with the same name at the 416top level of the module. 417 418For example, to support architecture specific files: 419``` 420cc_library { 421 ... 422 srcs: ["generic.cpp"], 423 arch: { 424 arm: { 425 srcs: ["arm.cpp"], 426 }, 427 x86: { 428 srcs: ["x86.cpp"], 429 }, 430 }, 431} 432``` 433 434When building the module for arm the `generic.cpp` and `arm.cpp` sources will 435be built. When building for x86 the `generic.cpp` and 'x86.cpp' sources will 436be built. 437 438#### Soong Config Variables 439 440When converting vendor modules that contain conditionals, simple conditionals 441can be supported through Soong config variables using `soong_config_*` 442modules that describe the module types, variables and possible values: 443 444``` 445soong_config_module_type { 446 name: "acme_cc_defaults", 447 module_type: "cc_defaults", 448 config_namespace: "acme", 449 variables: ["board"], 450 bool_variables: ["feature"], 451 value_variables: ["width"], 452 properties: ["cflags", "srcs"], 453} 454 455soong_config_string_variable { 456 name: "board", 457 values: ["soc_a", "soc_b", "soc_c"], 458} 459``` 460 461This example describes a new `acme_cc_defaults` module type that extends the 462`cc_defaults` module type, with three additional conditionals based on 463variables `board`, `feature` and `width`, which can affect properties `cflags` 464and `srcs`. Additionally, each conditional will contain a `conditions_default` 465property can affect `cflags` and `srcs` in the following conditions: 466 467* bool variable (e.g. `feature`): the variable is unspecified or not set to a true value 468* value variable (e.g. `width`): the variable is unspecified 469* string variable (e.g. `board`): the variable is unspecified or the variable is set to a string unused in the 470given module. For example, with `board`, if the `board` 471conditional contains the properties `soc_a` and `conditions_default`, when 472board=soc_b, the `cflags` and `srcs` values under `conditions_default` will be 473used. To specify that no properties should be amended for `soc_b`, you can set 474`soc_b: {},`. 475 476The values of the variables can be set from a product's `BoardConfig.mk` file: 477``` 478$(call soong_config_set,acme,board,soc_a) 479$(call soong_config_set,acme,feature,true) 480$(call soong_config_set,acme,width,200) 481``` 482 483The `acme_cc_defaults` module type can be used anywhere after the definition in 484the file where it is defined, or can be imported into another file with: 485``` 486soong_config_module_type_import { 487 from: "device/acme/Android.bp", 488 module_types: ["acme_cc_defaults"], 489} 490``` 491 492It can used like any other module type: 493``` 494acme_cc_defaults { 495 name: "acme_defaults", 496 cflags: ["-DGENERIC"], 497 soong_config_variables: { 498 board: { 499 soc_a: { 500 cflags: ["-DSOC_A"], 501 }, 502 soc_b: { 503 cflags: ["-DSOC_B"], 504 }, 505 conditions_default: { 506 cflags: ["-DSOC_DEFAULT"], 507 }, 508 }, 509 feature: { 510 cflags: ["-DFEATURE"], 511 conditions_default: { 512 cflags: ["-DFEATURE_DEFAULT"], 513 }, 514 }, 515 width: { 516 cflags: ["-DWIDTH=%s"], 517 conditions_default: { 518 cflags: ["-DWIDTH=DEFAULT"], 519 }, 520 }, 521 }, 522} 523 524cc_library { 525 name: "libacme_foo", 526 defaults: ["acme_defaults"], 527 srcs: ["*.cpp"], 528} 529``` 530 531With the `BoardConfig.mk` snippet above, `libacme_foo` would build with 532`cflags: "-DGENERIC -DSOC_A -DFEATURE -DWIDTH=200"`. 533 534Alternatively, with `DefaultBoardConfig.mk`: 535 536``` 537SOONG_CONFIG_NAMESPACES += acme 538SOONG_CONFIG_acme += \ 539 board \ 540 feature \ 541 width \ 542 543SOONG_CONFIG_acme_feature := false 544``` 545 546then `libacme_foo` would build with `cflags: "-DGENERIC -DSOC_DEFAULT -DFEATURE_DEFAULT -DSIZE=DEFAULT"`. 547 548Alternatively, with `DefaultBoardConfig.mk`: 549 550``` 551SOONG_CONFIG_NAMESPACES += acme 552SOONG_CONFIG_acme += \ 553 board \ 554 feature \ 555 width \ 556 557SOONG_CONFIG_acme_board := soc_c 558``` 559 560then `libacme_foo` would build with `cflags: "-DGENERIC -DSOC_DEFAULT 561-DFEATURE_DEFAULT -DSIZE=DEFAULT"`. 562 563`soong_config_module_type` modules will work best when used to wrap defaults 564modules (`cc_defaults`, `java_defaults`, etc.), which can then be referenced 565by all of the vendor's other modules using the normal namespace and visibility 566rules. 567 568## Build logic 569 570The build logic is written in Go using the 571[blueprint](http://godoc.org/github.com/google/blueprint) framework. Build 572logic receives module definitions parsed into Go structures using reflection 573and produces build rules. The build rules are collected by blueprint and 574written to a [ninja](http://ninja-build.org) build file. 575 576## Environment Variables Config File 577 578Soong can optionally load environment variables from a pre-specified 579configuration file during startup. These environment variables can be used 580to control the behavior of the build. For example, these variables can determine 581whether remote-execution should be used for the build or not. 582 583The `ANDROID_BUILD_ENVIRONMENT_CONFIG_DIR` environment variable specifies the 584directory in which the config file should be searched for. The 585`ANDROID_BUILD_ENVIRONMENT_CONFIG` variable determines the name of the config 586file to be searched for within the config directory. For example, the following 587build comand will load `ENV_VAR_1` and `ENV_VAR_2` environment variables from 588the `example_config.json` file inside the `build/soong` directory. 589 590``` 591ANDROID_BUILD_ENVIRONMENT_CONFIG_DIR=build/soong \ 592 ANDROID_BUILD_ENVIRONMENT_CONFIG=example_config \ 593 build/soong/soong_ui.bash 594``` 595 596## Other documentation 597 598* [Best Practices](docs/best_practices.md) 599* [Build Performance](docs/perf.md) 600* [Generating CLion Projects](docs/clion.md) 601* [Generating YouCompleteMe/VSCode compile\_commands.json file](docs/compdb.md) 602* Make-specific documentation: [build/make/README.md](https://android.googlesource.com/platform/build/+/master/README.md) 603 604## Developing for Soong 605 606To load the code of Soong in IntelliJ: 607 608* File -> Open, open the `build/soong` directory. It will be opened as a new 609 project. 610* File -> Settings, then Languages & Frameworks -> Go -> GOROOT, then set it to 611 `prebuilts/go/linux-x86` 612* File -> Project Structure, then, Project Settings -> Modules, then Add 613 Content Root, then add the `build/blueprint` directory. 614* Optional: also add the `external/golang-protobuf` directory. In practice, 615 IntelliJ seems to work well enough without this, too. 616 617### Running Soong in a debugger 618 619Both the Android build driver (`soong_ui`) and Soong proper (`soong_build`) are 620Go applications and can be debugged with the help of the standard Go debugger 621called Delve. A client (e.g., IntelliJ IDEA) communicates with Delve via IP port 622that Delve listens to (the port number is passed to it on invocation). 623 624#### Debugging Android Build Driver #### 625To make `soong_ui` wait for a debugger connection, use the `SOONG_UI_DELVE` 626variable: 627 628``` 629SOONG_UI_DELVE=5006 m nothing 630``` 631 632#### Debugging Soong Proper #### 633 634To make `soong_build` wait for a debugger connection, install `dlv` and then 635start the build with `SOONG_DELVE=<listen addr>` in the environment. 636For example: 637```bash 638SOONG_DELVE=5006 m nothing 639``` 640Android build driver invokes `soong_build` multiple times, and by default each 641invocation is run in the debugger. Setting `SOONG_DELVE_STEPS` controls which 642invocations are run in the debugger, e.g., running 643```bash 644SOONG_DELVE=2345 SOONG_DELVE_STEPS='build,modulegraph' m 645``` 646results in only `build` (main build step) and `modulegraph` being run in the debugger. 647The allowed step names are `api_bp2build`, `bp2build_files`, `bp2build_workspace`, 648`build`, `modulegraph`, `queryview`, `soong_docs`. 649 650Note setting or unsetting `SOONG_DELVE` causes a recompilation of `soong_build`. This 651is because in order to debug the binary, it needs to be built with debug 652symbols. 653#### Delve Troubleshooting #### 654To test the debugger connection, run this command: 655 656``` 657dlv connect :5006 658``` 659 660If you see an error: 661``` 662Could not attach to pid 593: this could be caused by a kernel 663security setting, try writing "0" to /proc/sys/kernel/yama/ptrace_scope 664``` 665you can temporarily disable 666[Yama's ptrace protection](https://www.kernel.org/doc/Documentation/security/Yama.txt) 667using: 668```bash 669sudo sysctl -w kernel.yama.ptrace_scope=0 670``` 671 672#### IntelliJ Setup #### 673To connect to the process using IntelliJ: 674 675* Run -> Edit Configurations... 676* Choose "Go Remote" on the left 677* Click on the "+" buttion on the top-left 678* Give it a nice _name_ and set "Host" to `localhost` and "Port" to the port in the 679 environment variable (`SOONG_UI_DELVE` for `soong_ui`, `SOONG_DELVE` for 680 `soong_build`) 681* Set the breakpoints where you want application to stop 682* Run the build from the command line 683* In IntelliJ, click Run -> Debug _name_ 684* Observe _Connecting..._ message in the debugger pane. It changes to 685 _Connected_ once the communication with the debugger has been established; the 686 terminal window where the build started will display 687 `API server listening at ...` message 688 689 690Sometimes the `dlv` process hangs on connection. A symptom of this is `dlv` 691spinning a core or two. In that case, `kill -9` `dlv` and try again. 692Anecdotally, it _feels_ like waiting a minute after the start of `soong_build` 693helps. 694 695## Contact 696 697Email android-building@googlegroups.com (external) for any questions, or see 698[go/soong](http://go/soong) (internal). 699