[roll] Roll infra/recipes [build] Re(5)-land: Migrate build recipe to main_build.py

Reland of commit bd61a2da6166ee6715c5bafb1672ea2dd480671a
(reverted in 4ad6d1d715c9009d087f3b19f745edf5f1c31ca1).

This change removes much logic around remote service setup for
driving Fuchsia builds, now relying on main_build.py as the
singular entry point shared by infra and developer (fx) builds.

recipe_modules/build/api.py:
- Resolves main_build.py dynamically from tool_paths.json.
- fint-build wrapping is now an internal detail of main_build.py,
  but we use output_metadata.json to get paths to important build
  artifacts and logs. No longer use the (Go) 'fint build'.
  - Adds parsing of output-metadata-json to resolve open logs,
    RBE diagnostics, and detailed rrpl action logs for CAS uploading.
- Streamlines recipe-side authentication by passing
  main_build.py --auth-mode=machine, delegating credentials handling
  to main_build.py.
- Eliminates redundant RBE and ResultStore environment overrides on
  the recipe side, now passing key service sockets as main_build.py
  --remote-proxy-socket and --resultstore-proxy-socket (for
  ResultStore).
- Wraps sandbox execution in a Path-casted context manager
  (cwd=context.checkout_dir) to ensure robust relative path resolution
  inside nsjail.
- Factored out _read_output_metadata, _process_rbe_metadata, and
  _nsjail_sandbox_cmd helpers.

Fixes since Re(4)-land was reverted:
* Plumb --remote-proxy-socket whenever ResultStore is enabled, even if
  RBE compilation is disabled (e.g. no_rbe builders). This ensures
  rsproxy receives a valid RS_cas_service endpoint matching the old recipe
  behavior and avoids a deadlock in rsproxy's file-upload pipeline when
  uploading stdout/stderr of actions with CAS disabled.

Follow-ups:
- Delete resultstore recipe_module.
- We cannot delete the rbe module because some non-Fuchsia builders
  require it for reproxy setup/teardown.

Original-Original-Bug: 450234102, 481021388, 570223323
Original-Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/infra/recipes/+/1874076
Original-Original-Revision: f8eb377a7c5b553ba0463b2582a4cb1e033316ef
GitOrigin-RevId: 65a64628f60b1172cee1d81a3acdc036caf0badb
Change-Id: Id682f75f95eeef236e86ad4e61a4ef58ab13c4c4
Reviewed-on: https://fuchsia-review.googlesource.com/c/integration/+/1875047
Cr-Commit-Position: refs/heads/main@{#204723}
1 file changed
tree: 708be940c44b3a655dbee11c9903ea7566958fe2
  1. ctf/
  2. git-hooks/
  3. infra/
  4. third_party/
  5. cobalt
  6. flower
  7. jiri.lock
  8. MILESTONE
  9. minimal
  10. prebuilts
  11. README.md
  12. stem
  13. test_durations
README.md

Integration

This repository contains Fuchsia's Global Integration manifest files.

Making changes

All changes should be made to the internal version of this repository. Our infrastructure automatically updates this version when the internal one changes.

Currently all changes must be made by a Google employee. Non-Google employees wishing to make a change can ask for assistance in one of the communication channels documented at get involved.

Obtaining the source

First install Jiri.

Next run:

$ jiri init
$ jiri import minimal https://fuchsia.googlesource.com/integration
$ jiri update

Third party

Third party projects should have their own subdirectory in ./third_party.