Lines Matching +full:bazel +full:- +full:2
1 # Soong-Bazel equivalents
3 This doc aims to describe *internal*-facing implementation concepts. For
4 external-facing, see
5 https://android.googlesource.com/platform/build/bazel/+/refs/heads/master/docs/concepts.md.
11 Soong/Ninja | Bazel …
12 --------------------------------------------------------------- | ---------------------------------…
13 …egroup` rule target | [Details](#phony-goal)
15 Ninja build target (non-phony) | File target …
19 … | [Rule attributes](https://docs.bazel.build/versions/mai…
22 [LoadHooks](#loadhooks) | [macros (ish)](https://docs.bazel…
23 Top-down mutators on modules | Split configuration on targets …
24 Bottom-up mutators on modules | [Aspects](https://docs.bazel.buil…
25 [Build statement (Ninja)](#ninja-build-statement) | Action (result of ctx.actions.run…
26 [Rule statement (Ninja)](#ninja-rules) | [ctx.actions.run() API](https://d…
27 `out/soong/build.ninja` and `out/build-<target>.ninja` | Action graph (serialized) …
30 Blueprint's [Generate and Write phases](#blueprint-analysis) | Analysis Phase …
32 Blueprints/`Android.bp` files | `BUILD`/`BUILD.bazel` files …
36 [Singleton](#singleton) | Aspect-ish …
37 Target (system + vendor + product) | [Platform](https://docs.bazel.bui…
39 Product and board configuration makefile and env variables | Configuration in Bazel (ish) …
44 ### Phony goals {#phony-goal}
51 A Phony goal creates a Make-style phony rule, a rule with no commands that can
70 …droid/platform/superproject/+/master:build/blueprint/module_ctx.go;l=871-886,918-960;drc=030150d8f…
74 are resolved during [blueprint analysis](#blueprint-analysis) via the various
78 For a Bazel target instance, the dependencies and source file references within
79 [`attrs`](#attributes) have been resolved by Bazel.
81 Bazel
82 …ld/bazel/blob/a20b32690a71caf712d1d241f01fef16649562ba/src/main/java/com/google/devtools/build/lib…
99 …/android/platform/superproject/+/master:build/soong/android/module.go;l=1042-1045;drc=8631cc732791…
100 name-related, common, and dist properties.
130 will merge target-specific properties into the correct variant for
133 Note: if a nested property is arch-variant, all recursively nesting structs
135 arch-variant.
138 variant, the arch-specific values should be *prepended* rather than appended
144 * module-relative paths
147 non-default output file, specific to the module type
157 [attributes](https://docs.bazel.build/versions/main/skylark/lib/attr.html) only
158 support a few types. The difference is that Bazel attributes cannot be nested .
161 [common](https://docs.bazel.build/versions/2.1.0/be/common-definitions.html#common-attributes)
184 [configurable attribute](https://docs.bazel.build/versions/main/configurable-attributes.html).
186 [configuration transition](https://docs.bazel.build/versions/main/skylark/lib/transition.html).
189 Instead, they may invoke a Starlark macro, which is a load-time wrapper around
191 would have to be wrangled into an attribute-compatible type.
195 …com/android/platform/superproject/+/master:build/soong/android/hooks.go;l=24-36;drc=07656410df1836…
206 ### Build Statement (ninja) {#ninja-build-statement}
208 [Ninja build statements](https://ninja-build.org/manual.html#_build_statements) can be
209 expanded from [Ninja rules](https://ninja-build.org/manual.html#_rules), which are like
225 Rules for `Android.mk` modules (`out/build-<target>.ninja`) and build statements
232 ### Ninja Rules in Soong {#ninja-rules}
237 …roid/platform/superproject/+/master:build/soong/android/package_ctx.go;l=102-293;drc=77cdcfdeafd38…
239 ### Blueprint Generate & Write phase {#blueprint-analysis}
248 …m/android/platform/superproject/+/master:build/soong/android/module.go;l=445-448;drc=8631cc7327919…
262 ### Bazel packages {#pkgs}
264 [Packages](https://docs.bazel.build/versions/main/build-ref.html#packages) can
265 nest subpackages recursively, but they are independent containers of Bazel
266 targets. This means that Bazel target names only need to be unique within a
272 top-down and bottom-up can be interleaved). Each mutator applys a single
278 While top-down and bottom-up mutators differ in their purposes, the interface
282 …oid/platform/superproject/+/master:build/soong/android/mutator.go;l=246;drc=2ada09a5463a0108d71377…
284 In addition to the registration order, Soong supports phase-based ordering of
287 1. Pre-Arch: mutators that need to run before arch-variation. For example,
289 correctly propagated to arch-variants later.
291 1. (Hard-coded)
293 splits a module into the appropriate target(s). Next, the arch- and
294 OS-specific properties are merged into the appropriate variant.
296 1. Pre-Deps: mutators that can/need to run before deps have been resolved, for
299 1. (Hard-coded)
300 …oid/platform/superproject/+/master:build/soong/android/mutator.go;l=502;drc=2ada09a5463a0108d71377…
304 1. Post-Deps: mutators that need to run after deps have been resolved
306 1. Final-Deps like post-deps but variations cannot be created
308 #### Top-down Mutator
310 A top-down mutator is invoked on a module before its dependencies.
315 #### Bottom-up Mutator
317 A bottom-up mutator is invoked on a module only after the mutator has been
320 The general purpose of a bottom-up mutator is to split modules into variants.
332 We do not cover how Soong's configuration will be implemented in Bazel, but the
333 general capabilities of Bazel to configure builds.
351 limits the scope of what `.mk` files are parsed. The product-specific handlers
366 * [user-defined config](https://cs.android.com/android/platform/superproject/+/master:build/make/…
369 …[`.bazelrc`](https://docs.bazel.build/versions/main/guide.html#bazelrc-the-bazel-configuration-fil…
372 …d.com/android/platform/superproject/+/master:build/make/core/config.mk;l=729-745;drc=ee20ae1a8dcdf…
385 …etEnv`](http://cs.android.com/search?q=f:soong%20%5C.GetEnv%5C%28%20-f:%2Fui%2F%20-f:%2Fcmd%2F&sq=)
386 …p://cs.android.com/search?q=f:soong%20%5C.GetEnvWithDefault%5C%28%20-f:%2Fui%2F%20-f:%2Fcmd%2F&sq=)
387 …ue`](http://cs.android.com/search?q=f:soong%20%5C.IsEnvTrue%5C%28%20-f:%2Fui%2F%20-f:%2Fcmd%2F&sq=)
388 …e`](http://cs.android.com/search?q=f:soong%20%5C.IsEnvFalse%5C%28%20-f:%2Fui%2F%20-f:%2Fcmd%2F&sq=)
409 …ndroid.googlesource.com/platform/build/soong/+/refs/heads/master/README.md#soong-config-variables):
422 …com/android/platform/superproject/+/master:build/soong/android/arch.go;l=569-597;drc=135bf55281d79…
423 to split a module into the required variants and merge target-specific
426 arch/os/target-specific. For example:
430 // this property will be arch-variant
434 // this property is arch-variant
437 // this property is **not** arch-variant
442 // this property is **NOT** arch-variant
445 // this property is **not** arch-variant
451 The arch/os/target-specific structs are
452 …com/android/platform/superproject/+/master:build/soong/android/arch.go;l=780-787;drc=135bf55281d79…
455 #### Bazel subsubsection
457 Bazel documentation covers configurable builds fairly extensively, so this is a
458 short overview that primarily links to existing Bazel documentation rather than
461 [Configurable attributes](https://docs.bazel.build/versions/main/configurable-attributes.html),
472 * [`config_setting`](https://docs.bazel.build/versions/main/be/general.html#config_setting)
473 * [`constraint_value`](https://docs.bazel.build/versions/main/be/platform.html#constraint_value)
475 A `config_setting` is a collection of build settings, whether defined by Bazel,
476 or user-defined.
478 User-defined
479 [build settings](https://docs.bazel.build/versions/main/skylark/config.html#defining-build-settings)
484 In addition, Bazel supports
485 [`platform`s](https://docs.bazel.build/versions/main/be/platform.html#platform),
488 [More about platforms](https://docs.bazel.build/versions/main/platforms.html).
516 …droid.com/android/platform/superproject/+/master:build/soong/cc/cc.go;l=2771-2776;drc=5df7bd33f7b6…
524 Soong's language-based package layout. For example, rust uses `cc` module's
525 …d.com/android/platform/superproject/+/master:build/soong/rust/rust.go;l=1457-1458;drc=9f59e8db270f…
545 …roid/platform/superproject/+/master:build/soong/genrule/genrule.go;l=98-102;drc=2ada09a5463a0108d7…
549 Soong has Bazel-inspired providers, but providers are not used in all cases yet.
560 …m/android/platform/superproject/+/master:build/soong/android/module.go;l=205-206;drc=8631cc7327919…
562 …m/android/platform/superproject/+/master:build/soong/android/module.go;l=198-203;drc=8631cc7327919…
564 …m/android/platform/superproject/+/master:build/soong/android/module.go;l=195-196;drc=8631cc7327919…
566 …m/android/platform/superproject/+/master:build/soong/android/module.go;l=189-193;drc=8631cc7327919…
569 ### Bazel communication
571 Targets primarily communicate with each other via providers in Bazel rule
575 and rolled-up runtime jars for javac and java invocations downstream. However,
581 [Providers](https://docs.bazel.build/versions/main/skylark/rules.html#providers)
585 [`runfiles`](https://docs.bazel.build/versions/main/skylark/rules.html#runfiles).
588 [custom providers](https://docs.bazel.build/versions/main/skylark/lib/Provider.html#modules.Provide…
591 [`cc_object`](http://cs/android/build/bazel/rules/cc_object.bzl?l=86-87&rcl=42607e831f8ff73c82825b6…
593 [`CcInfo`](https://docs.bazel.build/versions/main/skylark/lib/CcInfo.html)
595 [`CcObjectInfo`](http://cs/android/build/bazel/rules/cc_object.bzl?l=17-21&rcl=42607e831f8ff73c8282…
601 …m/bazelbuild/bazel/blob/a20b32690a71caf712d1d241f01fef16649562ba/src/main/java/com/google/devtools…
606 [`depset`](https://docs.bazel.build/versions/main/glossary.html#depset) are used
613 [`java_library.exports`](https://docs.bazel.build/versions/main/be/java.html#java_import.exports).