[rbe] Re-launch self in subprocess for reproxy

This fixes the issue where python print statements (from --verbose
debugging) disappeared when re-launched.

It would be more efficient to use os.execv() than to fork a subprocess,
however, this does not effect the `fx build` flow because that
is already running with reproxy, and will never trigger the re-launch
path.  (The overhead will be unnoticeable for interactive debugging
and manual repro.)

Tested: --verbosity prints message in the relaunched call

```
$ prebuilt/third_party/python3/linux-x64/bin/python3 build/rbe/remote_action.py --verbose -- echo jello
[remote_action.py] Detected RBE_proxy_log_dir=None
[remote_action.py] Detected RBE_log_dir=None
[remote_action.py] Automatically re-launching: build/rbe/fuchsia-reproxy-wrap.sh -- prebuilt/third_party/python3/linux-x64/bin/python3 -S build/rbe/remote_action.py --verbose -- echo jello
Proxy started successfully.
[remote_action.py] Detected RBE_proxy_log_dir=/tmp/reproxy.20230420-091549.cdoD
[remote_action.py] Detected RBE_log_dir=/tmp/reproxy.20230420-091549.cdoD/rewrapper-logs
[remote_action.py] prebuilt/proprietary/third_party/reclient/linux-x64/rewrapper --exec_root=/usr/local/google/home/fangism/fuchsia/fuchsia --cfg build/rbe/fuchsia-rewrapper.cfg -- echo jello
jello
RBE Stats: Downloaded: 6 B, Uploaded: 325 B
```

Bug: 125841
Change-Id: I9a61b2660dd9ce9ac349b775f6ff36e77b4915c1
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/841216
Reviewed-by: Jay Zhuang <jayzhuang@google.com>
Commit-Queue: Auto-Submit <auto-submit@fuchsia-infra.iam.gserviceaccount.com>
Fuchsia-Auto-Submit: David Fang <fangism@google.com>
7 files changed
tree: 0def9506d9a5aef03aab3bc6b57e6e988fece4d2
  1. boards/
  2. build/
  3. bundles/
  4. docs/
  5. examples/
  6. infra/
  7. products/
  8. scripts/
  9. sdk/
  10. src/
  11. third_party/
  12. tools/
  13. zircon/
  14. .clang-format
  15. .clang-tidy
  16. .editorconfig
  17. .git-blame-ignore-revs
  18. .gitattributes
  19. .gitignore
  20. .gitmodules
  21. .gn
  22. .ignore
  23. .style.yapf
  24. analysis_options.yaml
  25. AUTHORS
  26. BUILD.gn
  27. CODE_OF_CONDUCT.md
  28. CONTRIBUTING.md
  29. fuchsia.code-workspace
  30. LICENSE
  31. OWNERS
  32. PATENTS
  33. pyrightconfig.json
  34. README.md
  35. rustfmt.toml
README.md

Fuchsia

What is Fuchsia?

Fuchsia is an open source, general purpose operating system supporting modern 64-bit Intel and ARM processors.

We expect everyone interacting with our project to respect our code of conduct.

Read more about Fuchsia's principles.

How can I build and run Fuchsia?

See Getting Started.

Where can I learn more about Fuchsia?

See fuchsia.dev.