tree: 71cc2c62e519b24f1440ed73471f1eb622317e0e [search]
  1. .agents/
  2. profiles/
  3. proto/
  4. action_diff.py
  5. action_diff_test.py
  6. bazel_rbe_e2e.py
  7. bazel_rbe_e2e_test.py
  8. bb_fetch_rbe_cas.py
  9. bb_fetch_rbe_cas_test.py
  10. bbtool.py
  11. bbtool_test.py
  12. BUILD.bazel
  13. BUILD.gn
  14. build_summary.py
  15. build_summary_test.py
  16. cas.py
  17. cas_test.py
  18. casfs.py
  19. casfs_test.py
  20. cl_utils.py
  21. cl_utils_test.py
  22. common-setup.sh
  23. cxx.py
  24. cxx_link_remote_wrapper.py
  25. cxx_link_remote_wrapper_test.py
  26. cxx_remote_wrapper.py
  27. cxx_remote_wrapper_test.py
  28. cxx_test.py
  29. depfile.py
  30. depfile_test.py
  31. detail-diff.sh
  32. dlwrap.py
  33. dlwrap_test.py
  34. fuchsia-reproxy-gcertauth.cfg
  35. fuchsia-reproxy-wrap.sh
  36. fuchsia-reproxy.cfg
  37. fuchsia-rewrapper.cfg
  38. fuchsia.py
  39. fuchsia_test.py
  40. linker.py
  41. linker_test.py
  42. local-only.sh
  43. log-it.sh
  44. output_leak_scanner.py
  45. output_leak_scanner_test.py
  46. pb_message_util.py
  47. pb_message_util_test.py
  48. prebuilt_tool_remote_wrapper.py
  49. prebuilt_tool_remote_wrapper_test.py
  50. python_with_pb_test.sh
  51. rbe_cli.py
  52. rbe_cli_test.py
  53. rbe_diagnose.py
  54. rbe_diagnose_test.py
  55. rbe_metrics_summary_json.sh
  56. rbe_profile.py
  57. rbe_profile_test.py
  58. rbe_settings.py
  59. rbe_settings_test.py
  60. README.md
  61. reclient.py
  62. reclient_cxx.sh
  63. reclient_e2e.py
  64. reclient_e2e_test.py
  65. reclient_test.py
  66. relativize_args.py
  67. relativize_args_test.py
  68. remote_action.py
  69. remote_action_test.py
  70. remotetool.py
  71. remotetool.sh
  72. remotetool_test.py
  73. reproxy-compress.cfg
  74. reproxy-no-compress.cfg
  75. reproxy_logs.py
  76. reproxy_logs_test.py
  77. reproxy_wrap.py
  78. reproxy_wrap_test.py
  79. rpl_tool.py
  80. rpl_tool_test.py
  81. rustc.py
  82. rustc_remote_wrapper.py
  83. rustc_remote_wrapper_test.py
  84. rustc_test.py
  85. tablefmt.py
  86. tablefmt_test.py
  87. test_all.sh
  88. textpb.py
  89. textpb_benchmark.py
  90. textpb_test.py
  91. upload_reproxy_logs.py
  92. upload_reproxy_logs_test.py
build/rbe/README.md

This directory contains support for building the Fuchsia tree with build actions running on RBE (remote build execution).

Remote execution wrappers

The top-level remote execution wrappers are used as command prefixes:

  • reclient_cxx.sh: prefix wrapper for remote compiling C++
    • cxx_remote_wrapper.py: is a similar heavier wrapper with additional features and workarounds.
  • rustc_remote_wrapper.py: prefix wrapper for remote compiling and linking Rust
    • Detects and gathers all inputs and tools needed for remote compiling.
    • Detects extra outputs to download produced by remote compiling.
  • cxx_link_remote_wrapper.py: prefix wrapper for remote ilnking C++
  • prebuilt_tool_remote_wrapper.py: prefix wrapper for simple tools
  • remote_action.py: prefix wrapper for generic remote actions
    • Exists as standalone wrapper and library.
    • Includes detailed diagnostics for certain error conditions.
    • Includes limited fault-tolerance and retries.
    • The C++ and Rust wrappers inherit all of the features of this generic script.
  • fuchsia-reproxy-wrap.sh: automatically start/shutdown reproxy (needed by rewrapper) around any command. Used by fx build.
  • dlwrap.py: downloads artifacts from RBE's CAS using download stub files

More details can be found by running with --help.

Support scripts

  • cl_utils.py: generic command-line operation library
  • cxx.py: for understanding structure of C/C++ compile commands
  • fuchsia.py: Fuchsia-tree specific directory layouts and conventions. Parties interested in re-using wrapper scripts found here should expect to replace this file.
  • output_leak_scanner.py: Check that commands and outputs do not leak the name of the build output directory, for better caching outcomes.
  • relativize_args.py: Attempt to transform commands with absolute paths into equivalent commands with relative paths. This can be useful for build systems that insist on absolute paths, like cmake.
  • rustc.py: for understanding structure of rustc compile commands
  • tablefmt.py: utilities for printing readable ASCII tables
  • textpb.py: generic protobuf text parsing library

Configurations

  • fuchsia-rewrapper.cfg: rewrapper configuration
  • fuchsia-reproxy.cfg: reproxy configuration

Troubleshooting tools

  • action_diff.sh: recursively queries through two reproxy logs to root-cause differences between output and intermediate artifacts. This is useful for examining unexpected digest differences and cache misses.
  • bbtool.py: buildbucket related tools
    • fetch_reproxy_log: retrieve .rrpl log, possibly from subbuild.
  • bb_fetch_rbe_cas.sh: retrieve a remote-built artifact from the RBE CAS using a buildbucket id and the path under the build output directory.
  • cas.py: interface to CAS tool, including fetching objects.
  • detail-diff.sh: attempts to compare human-readable representations of files, including some binary files, by using tools like objdump.
  • remotetool.sh: can lookup actions and artifacts in the RBE CAS. From: https://github.com/bazelbuild/remote-apis-sdks
  • reproxy_logs.sh: subcommand utility
    • diff: report meaningful difference between two reproxy logs
    • output_file_digest: lookup the digest of a remote built artifact
    • bandwidth: report total download and upload bytes from reproxy log
    • plot_download: plot download demand over the course of a build
  • rpl_tool.sh: tools that involve reproxy logs and remotetool together
    • expand_to_rpl: populate .rrpl with command and inputs -> .rpl

All tools have more detailed usage with --help.

GN files

  • build/toolchain/rbe.gni: global args.gn variables for RBE

  • build/toolchain/clang_toolchain.gni and build/toolchain/zircon/zircon_toolchain.gni: use RBE wrappers depending on configuration

  • build/rust/rustc_*.gni: uses RBE wrappers depending on configuration

Metrics and logs

  • build_summary.py: If your environment sets FX_BUILD_RBE_STATS=1, this script will be run after each build and display a summary of cache and download metrics.
  • upload_reproxy_logs.py: pushes RBE metrics and detailed logs to BigQuery.
    • This can be enabled by fx build-metrics.
  • pb_message_util.py: library for translating protobufs to JSON