tree: a21171f09f2388695d25294f3b1367f3f3038304 [path history] [tgz]
  1. assembly/
  2. assembly_input_groups/
  3. boot_tests/
  4. bringup/
  5. buildbot/
  6. drivers/
  7. fidl/
  8. infra/
  9. kitchen_sink/
  10. packages/
  11. platform/
  12. tests/
  13. tools/
  14. BUILD.gn
  15. OWNERS
  16. README.md
bundles/README.md

Package bundles

This directory contains top-level bundles of packages.

Special Handling Required!

Note: These files require special handling, or GN will attempt to define all targets (for all products/configurations) in the generated rules for Ninja.

This slows down both GN and Ninja, including the cost of Ninja starting for every build.

Before these rules were introduced, the //bundles files contained targets from multiple product configurations, resulting in all product configurations being roughly as slow to generate as a maximal build configuration.

The tables below lay out how much extra work is done by GN and Ninja when extra targets are being defined by GN.

Before:

ConfigurationTargets CreatedGN Files ReadGN (s)ninja (s)Rust crates
bringup.x64 (developer)229,9776089228888
bringup.x64 (buildbot)231,7626116228888
core.x64 (developer)230,3296097218923
core.x64 (buildbot)232,1666127236.58924

After:

ConfigurationTargets CreatedGN Files ReadGN time (s)ninja (s)Rust crates
bringup.x64 (developer)165,2704905176874
bringup.x64 (buildbot)165,4124939196874
core.x64 (developer)185,1955383217493
core.x64 (buildbot)230,7636116238920

The Rules

The rules for adding targets within these files is:

  • There MUST be only one “entry-point” target in each BUILD.gn file, named as the folder it's in.

  • This is the only target with “public” visibility in that file (ie visibility = [])

  • All deps that are not in the default_toolchain MUST be qualified with the expected toolchain, UNLESS the BUILD.gn file has an assert(is_host) or similar guard to ensure that its own targets are only ever defined in the appropriate toolchain other than default_toolchain.

Entry-point Targets

An “entry-point” target is target with public visibility, and is named after the folder that the BUILD.gn file is in (e.g. //bundles/buildbot/core:core).

When referencing targets under //bundles from fx set or infra recipes, only “entry_point” targets may be used.

Example: fx set core.x64 --with //bundles/buildbot/core

Existing files don't (yet) follow the rules.

All new changes to these files MUST follow the above rules.

Where files don't follow the above rules, this should be treated as pre-existing tech debt and should be cleaned up.

OWNERS are restricted

The OWNERS for this area is now VERY tightly restricted to those will have read, acknowledged, and agree to help make sure that these guidelines are followed for future changes to these files.

Global OWNERS are not automatically owners here (through the use of noparent).

A map of the new targets

  • //bundles/buildbot/<product>/BUILD.gn - Infra entry-point for adding tests to <product>.

  • //bundles/buildbot/dfv2/<product>/BUILD.gn - Infra entry-point for adding tests to product with DFv2 enabled (transitional, will be removed when all products switch to DFv2).

  • //bundles/infra/build - Infra entry-point added to all build-only or test- running builders (these are host tools).

  • //bundles/infra/test - Infra entry-point added to all test-running builders (these are host tools, but the group MUST be defined in the default_toolchain).

  • //bundles/tools - A number of tools added to by some products (ie, core), and used by developers to add a bunch of miscellaneous tools to their build.

  • //bundles/kitchen_sink - Even more tools than //bundles/tools (which it includes), and miscellaneous other stuff. This needs to be sorted through and subdivided.

  • //bundles/platform - new groups of targets, relocated from places such as //bundles/packages/prod:* that are only to be added by product definitions, not by buildbot groups adding tests and tools.