[test] Test with rs-ninja.sh

sh_wrapper, sh_wrapper_test (bazel rules): no longer join commands with
'--', so wrappers that use these (most) will add it to the end of their
token lists.

rs-ninja.sh is one such script that wraps as a prefix to ninja without
'--'.
Add unit-tests that ensure propagation of exit status through
rs-ninja.sh.
Update end-to-end tests to use rs-ninja.sh, by passing it as an extra
prefix binary to the ninja_test rule (repeating --ninja_bin).
This turned out to be simpler than generating a sh_binary that fused
together rs-ninja.sh and prebuilt/ninja.

ninja_tests: add a clang-expect-fail test (compile error).
duplicate many tests named _with_rs that use rs-ninja.sh.
End-to-end tests with rsproxy should use this, instead of the variants
named without _with_rs.
This will ensure proper communication through the RSPROXY_FIFO
variable.

Using all of the above, able to create a non-sandboxed,
network-accessed, end-to-end bazel test of rsproxy and ninja that
connect to a real service (instead of fake_resultstore server)!

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