[test] fakebuild tool generates UploadRequests

The new fakebuild tool emulates a build tool that
streams out UploadRequests.
This can be simpler than testing with ninja itself.

rs-fakebuild.sh is an example of a tool wrapper whose
sole purpose is to catch the RSPROXY_FIFO variable from rsproxy-wrap.sh.
For ninja, rs-ninja.sh would looks very similar.
fakebuild generates its own invocation Id, whereas ninja does not,
so rs-ninja.sh (in future change) would need to pass a random uuid
through a NINJA_BUILD_ID environment variable.

This approach makes it easier to thread RSPROXY_FIFO through
multiple levels of wrapping.
Whe RSPROXY_FIFO is not set, normal build tool operation without request
streaming is expected.

scripts/BUILD.bazel:
Adds tests that use fakebuild and the rs-fakebuild.sh prefix.

requests.go, factored out from utils_for_test.go some functions
for converting between UploadRequests and byte streams.

Bug: 390427892
Change-Id: I777f3e459d1ab7cf16e9165ae28c3f62068af98a
Reviewed-on: https://fuchsia-review.googlesource.com/c/rsclient/+/1362872
Reviewed-by: Jay Zhuang <jayzhuang@google.com>
Commit-Queue: David Fang <fangism@google.com>
11 files changed
tree: c35ef6ce1e44c56066c58bcfe2a16f542be5e90c
  1. cmd/
  2. internal/
  3. scripts/
  4. tools/
  5. .bazelversion
  6. .gitignore
  7. AUTHORS
  8. BUILD.bazel
  9. CONTRIBUTING.md
  10. GEMINI.md
  11. go.mod
  12. go.sum
  13. LICENSE
  14. MODULE.bazel
  15. OWNERS
  16. PATENTS
  17. README.md
  18. version.bzl
README.md

ResultStore Client Tools

The rsclient repository contains tools that support the use of ResultStore services and API.

rsproxy acts as a bridge between build tools and the ResultStore service.

The first supported build tool is Fuchsia's fork of ninja.

Developing from source

Prerequisites

  • rsclient builds with Bazel. We recommend using Bazelisk to use the version of Bazel currently supported by this code base.

rsclient is supported for Linux, and is yet untested on other platforms.

Setup

Before working with the code base, we recommend installing the precommit hook once per git clone with:

./scripts/install_precommit.sh

This runs a variety of checks and automatic regeneration steps for you before committing local changes.

Building

To build everything:

$ bazelisk build ...

Testing

To run tests:

$ bazelisk test ...

Install

Versioning

Not yet applicable.

Releases

Not yet applicable.