{"id":19933747,"url":"https://github.com/bazelbuild/reclient","last_synced_at":"2025-04-28T19:45:50.755Z","repository":{"id":180465775,"uuid":"662696142","full_name":"bazelbuild/reclient","owner":"bazelbuild","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-26T15:49:51.000Z","size":2074,"stargazers_count":64,"open_issues_count":15,"forks_count":17,"subscribers_count":11,"default_branch":"main","last_synced_at":"2024-08-27T16:55:51.579Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bazelbuild.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-05T17:28:16.000Z","updated_at":"2024-08-26T15:49:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"b9b11af1-5400-4818-b230-c9191593dd92","html_url":"https://github.com/bazelbuild/reclient","commit_stats":null,"previous_names":["bazelbuild/reclient"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bazelbuild%2Freclient","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bazelbuild%2Freclient/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bazelbuild%2Freclient/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bazelbuild%2Freclient/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bazelbuild","download_url":"https://codeload.github.com/bazelbuild/reclient/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240599186,"owners_count":19826959,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T23:14:44.877Z","updated_at":"2025-02-25T04:00:20.604Z","avatar_url":"https://github.com/bazelbuild.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Remote Execution Client\n\nThis repository contains a client implementation of\n[Remote Execution API](https://github.com/bazelbuild/remote-apis) that works\nwith\n[Remote Execution API SDKs](https://github.com/bazelbuild/remote-apis-sdks).\n\nReclient integrates with an existing build system to enable remote execution and\ncaching of build actions.\n\nWhen used with Server implementation of Remote Execution API, it helps to reduce\nthe build times by applying 2 main techniques:\n\n1.  Distribution of the load by executing individual build actions in parallel\n    on separate remote workers instead of on one build machine so that the build\n    actions that are executed in parallel don’t compete for the same local\n    resources.\n1.  RE Server instance-wide cache for build actions, inputs, and artifacts As a\n    consequence, results of a build action that was already executed for exactly\n    the same inputs on the same instance of RE Server will be fetched from the\n    cache even if the action was never executed on the machine.\n\nMost clients are expected to see the performance improvement of their builds\nafter migrating from local to remote builds. However, builds with a high number\nof deterministic build actions that can be executed in parallel are expected to\nsee the greatest improvement.\n\nReclient consists of the following main binaries:\n\n1.  **rewrapper** - a wrapper that forwards build commands to RBE\n1.  **reproxy** - a process that should be started at the beginning of the build\n    and shut down at the end. It communicates with RBE to execute build actions\n    remotely and/or fetch build artifacts from RE Server's CAS (Content\n    Addressable Storage).\n1.  **bootstrap** - starts and stops reproxy, and aggregates the metrics during\n    the shutdown.\n1.  **scandeps_server** - a standalone process for scanning includes of C(++)\n    compile actions. Started and stopped automatically by reproxy.\n\n## Note\n\nThis is not an officially supported Google product.\n\n# Prerequisites\n\n* `re-client` builds with [Bazel](https://bazel.build/). We recommend using\n  [Bazelisk](https://github.com/bazelbuild/bazelisk) to use the version of Bazel\n  currently supported by this code base.\n* `re-client` also requires `gclient`, which can be installed by checking out\n  [depot_tools](https://chromium.googlesource.com/chromium/tools/depot_tools/)\n  and adding the `depot_tools` directory to your `PATH`.\n\n# Building\n\n`re-client` currently builds and is supported on Linux / Mac / Windows.\n\nOnce you've installed Bazel, and are in the re-client repo:\n\n## Build the code\n\nTo build a complete set of binaries for reclient with a clangscandeps deps scanner:\n\n```shell\n$ bazelisk build --config=clangscandeps //:artifacts_tar\n[...]\nTarget //:artifacts_tar up-to-date:\n  bazel-bin/artifacts.tar\n```\n\nTo build a complete set of binaries for reclient with a goma deps scanner:\n\n```shell\n$ bazelisk build --config=goma //:artifacts_tar\n[...]\nTarget //:artifacts_tar up-to-date:\n  bazel-bin/artifacts.tar\n```\n\n## Install binaries (linux and mac only)\n\nTo install all binaries to a `$BINDIR`\n\n```shell\n$ bazelisk run --config=goma //:artifacts_install -- --destdir $BINDIR\n[...]\nINFO: Running command line: bazel-bin/artifacts_install --destdir $BINDIR\n```\n\n# Run unit tests\n```\n$ bazelisk test //pkg/... //internal/...\n[...]\nINFO: Elapsed time: 77.166s, Critical Path: 30.24s\nINFO: 472 processes: 472 linux-sandbox.\nINFO: Build completed successfully, 504 total actions\n//internal/pkg/cli:go_default_test                                       PASSED in 0.2s\n//internal/pkg/deps:go_default_test                                      PASSED in 1.2s\n//internal/pkg/inputprocessor/action/cppcompile:go_default_test          PASSED in 0.1s\n//internal/pkg/inputprocessor/flagsparser:go_default_test                PASSED in 0.1s\n//internal/pkg/inputprocessor/pathtranslator:go_default_test             PASSED in 0.1s\n//internal/pkg/inputprocessor/toolchain:go_default_test                  PASSED in 0.2s\n//internal/pkg/labels:go_default_test                                    PASSED in 0.1s\n//internal/pkg/logger:go_default_test                                    PASSED in 0.2s\n//internal/pkg/rbeflag:go_default_test                                   PASSED in 0.1s\n//internal/pkg/reproxy:go_default_test                                   PASSED in 15.5s\n//internal/pkg/rewrapper:go_default_test                                 PASSED in 0.2s\n//internal/pkg/stats:go_default_test                                     PASSED in 0.1s\n//pkg/cache:go_default_test                                              PASSED in 0.2s\n//pkg/cache/singleflightcache:go_default_test                            PASSED in 0.1s\n//pkg/filemetadata:go_default_test                                       PASSED in 2.1s\n//pkg/inputprocessor:go_default_test                                     PASSED in 0.2s\n\nExecuted 16 out of 16 tests: 16 tests pass.\n```\n\nReclient can be built to use Goma's input processor. Goma's input processor is\n3x faster than clang-scan-deps for a typical compile action in Chrome. Build as\nfollows:\n\n```shell\nbazelisk build //:artifacts_tar --config=goma\n```\n\n\n# Versioning\n\nThere are four binaries that are built from this repository and used with\nAndroid Platform for build acceleration:\n\n-   rewrapper\n-   reproxy\n-   dumpstats\n-   bootstrap\n\nThese binaries must be stamped with an appropriate version number before they\nare dropped into Android source for consumption.\n\n## Versioning Guidelines\n\n1.  We will *maintain a consistent version across all of the binaries*. That\n    means, when there are changes to only one of the binaries, we will increment\n    the version number for all of them.\n\n2.  In order to be consistent with\n    [Semantic versioning scheme](https://semver.org/), the version format is of\n    the form “X.Y.Z.SHA” denoting “MAJOR.MINOR.PATCH.GIT_SHA”.\n\n3.  Updating version numbers:\n\n    MAJOR\n\n    -   Declare major version “1” when re-client is feature complete for caching\n        and remote-execution capabilities.\n    -   Update major version post “1”, when there are breaking changes to\n        interface / behavior of rewrapper tooling. Some examples of this are:\n        changing any of the flag names passed to rewrapper, changing the name of\n        rewrapper binary.\n\n    MINOR - Update minor version when\n\n    -   New features are introduced in a backward compatible way. For example,\n        when remote-execution capability is introduced.\n    -   Major implementation changes without changes to behavior / interface.\n        For example, if the “.deps” file is changed to JSON format.\n\n    PATCH - Update patch version\n\n    -   For all other bug fixes only. Feature additions (irrespective of how\n        insignificant they are) should result in a MINOR version change.\n    -   Any new release to Android Platform of re-client tools should update the\n        PATCH version at minimum.\n\n4.  Release Frequency:\n\n    -   Kokoro release workflows can be triggered as often as necessary to\n        generate new release artifacts.\n\n## How to update version numbers?\n\nYou can update the MAJOR/MINOR/PATCH version numbers by simply changing the\n`version.bzl` file present in the root of this repository.\n\n\n# Reclient releases\n\nReclient binaries are released into the\n[CIPD](https://chrome-infra-packages.appspot.com/p/infra/rbe/client) (Chrome\nInfrastructure Package Deployment) with separate packages for Linux, Mac (amd64\nand arm64), and Windows. Whenever a new version of Reclient is released there\nare 2 sets of binaries released for each of the platforms. Those binaries use 2\ndifferent include scanners for C++ build actions: clang-scan-deps and goma. The\nbinaries using the goma include scanner have a version number ending with\n“-gomaip” suffix, the ones using clang-scan-deps don’t have the suffix. Clients\nmigrating from Goma should use the releases using goma include scanner (with\n-gomaip suffix).\n\n## Downloading Reclient binaries\n\nReclient binaries can be downloaded using CIPD's\n[Web UI](\\(https://chrome-infra-packages.appspot.com/p/infra/rbe/client\\)), with\na\n[CLI client](https://chromium.googlesource.com/infra/luci/luci-go/+/refs/heads/main/cipd/client),\nor using\n[gclient](https://chromium.googlesource.com/chromium/tools/depot_tools/+/HEAD/README.gclient.md)'s\nconfiguration.\n\n### Downloading binaries with CIPD CLI client\n\nTo download Reclient with GomaIP dependency scanner (used for building\nChromium):\n\n```\necho 'infra/rbe/client/${platform}' $RECLIENT_VERSION \u003e /tmp/reclient.ensure\ncipd ensure --root $CHECKOUT_DIR --ensure-file /tmp/reclient.ensure\n```\n\nTo use Reclient with Clangscandeps (used for Android builds) instead, add `-csd`\nsuffix to CIPD package:\n\n```\necho 'infra/rbe/client/${platform}-csd' $RECLIENT_VERSION \u003e /tmp/reclient.ensure\n\n```\n\n*   **`$RECLIENT_VERSION`** - the version of Reclient. It can be set to one of\n    the following:\n\n    *   A fixed version of Reclient. For example\n        `re_client_version:0.114.2.81e819b-gomaip` (for Reclient with GomaIP\n        dependency scanner) or `re_client_version:0.114.2.81e819b` (for Reclient\n        with Clangscandeps).\n    *   `latest` - the latest released Reclient version.\n    *   `stable` - the latest stable Reclient version. Stable version is usually\n        1-2wks behind the `latest` as Reclient needs to run a few days on test\n        and staging environments without issues and degradations before it's\n        considered as `stable`.\n\n*   **`$CHECKOUT_DIR`** - the location where Reclient should be downloaded.\n\n### Downloading binaries with gclient\n\nYou can configure\n[gclient](https://chromium.googlesource.com/chromium/tools/depot_tools/+/HEAD/README.gclient.md)\nto download Reclient binaries during the `gclient sync` phase. Gclient expects a\nDEPS file in the repository’s root directory. The file contains components that\nwill be checked out during the sync phase. To check out Reclient, the file\nshould have a similar entry to:\n\n```\nvars = {\n    ...\n    'reclient_version': '\u003cversion\u003e',\n    ...\n}\n\ndeps = {\n      ...\n'\u003ccheckout-directory\u003e': {\n    'packages': [\n      {\n        'package': 'infra/rbe/client/${{platform}}',\n        'version': Var('reclient_version'),\n      }\n    ],\n    'dep_type': 'cipd',\n  },\n}\n```\n\nThis will instruct **gclient** to check out `\u003cversion\u003e` of Reclient from\n`/infra/rbe/client/\u003cplatform\u003e` CIPD package into `\u003ccheckout-directory\u003e`\n([example](https://source.chromium.org/chromium/chromium/src/+/main:DEPS;l=583-590;drc=9362acf277a0dac6295d43e5c592ee8b065c496b)).\nExtracting a version to a variable (as in an example above) is optional, but\nprovides a benefit of being able to override the default value through gclient’s\ncustom variables.\n\n**Note:** The snippet above will instruct `gclient` to download Reclient with\nGomaIP dependency processor. If you prefer Reclient with Clangscandeps, you'd\nneed to set package to `infra/rbe/client/${{platform}}-csd`.\n\n# Using Reclient\n\n## Starting and stopping reproxy\n\nReclient requires reproxy to be started at the beginning of the build, and\nstopped at the end. This is done through `bootstrap` binary by executing\nfollowing commands:\n\n**Start:**\n\n```\nbootstrap -re_proxy=$reproxy_location [-cfg=$reproxy_config_location]\n```\n\n**Stop:**\n\n```\nbootstrap -re_proxy=$reproxy_location -shutdown\n```\n\n## Configuration\n\nEach of Reclient’s binaries can be configured either by command line flags,\nenvironment variables, config files, or by combination of either of those (some\nflags provided in the command line while others in the config file or set as\nenvironment variables). If the same flag is defined in the command line and in\nthe config file or as an environment variable, the order of precedence is\nfollowing (from lowest to highest priority):\n\n1.  Config file\n1.  Environment variable\n1.  Command line argument\n\nTo use a configuration file, specify it with the `-cfg=$config_file_location`\nflag. The config file is a list of `flag_name=flag_value` pairs, each on a new\nline. Example below:\n\n```\nservice=$RE_SERVER_ADDRESS\ninstance=$RE_SERVER_INSTANCE\nserver_address=unix:///tmp/reproxy.sock\nlog_dir=/tmp\noutput_dir=/tmp\nproxy_log_dir=/tmp\ndepsscanner_address=$scandeps_server_location #distributed with Reclient\nuse_gce_credentials=true\n```\n\nTo configure Reclient with environment variables, the variables should be\nprefixed with `RBE_` (e.g. the value of `RBE_service` environment variable is\nused to set the `service` flag).\n\n### Rewrapper\n\nFull list of rewrapper config flags can be found in\n[docs/cmd-line-flags.md](docs/cmd-line-flags.md). A few of the most commonly\nused flags are:\n\n*   **platform** - Comma-separated key value pairs in the form key=value. This\n    is used to identify remote platform settings like the docker image to use to\n    run the command. The list of supported keys depends on RE Server\n    implementation. A detailed lexicon can be found\n    [here](https://github.com/bazelbuild/remote-apis/blob/main/build/bazel/remote/execution/v2/platform.md)\n*   **server_address** - The address reproxy is running on. It needs to be set\n    to the same value as reproxy’s `server_address` flag so that rewrapper and\n    reproxy can communicate with each other. This value should be UDS on\n    Linux/Mac (e.g. unix:///tmp/reproxy.sock) and a named pipe on Windows (e.g.\n    pipe://reproxy.ipc). Depot_tools has a helper choosing the address based on\n    the platform\n    ([here](https://source.chromium.org/chromium/chromium/tools/depot_tools/+/main:reclient_helper.py;l=159-168;drc=60b21dd19301b13eaf7c9069ac191f95f84ca6e9)).\n*   **labels** - Identifies the type of command to help the proxy make decisions\n    regarding remote execution. Labels consist of comma-separated key-value\n    pairs in form key=value where key is one of the following: type, compiler,\n    lang, tool, and toolname. Some examples of valid labels are:\n    *   `type=compile,compiler=clang,lang=cpp` - clang compile actions\n    *   `type=compile,compiler=clang-cl,lang=cpp` - clang compile actions\n    *   `type=compile,compiler=nacl,lang=cpp` - nacl compile actions\n    *   `type=compile,compiler=javac,lang=java` - java compile actions\n    *   `type=link,tool=clang` - link actions\n    *   `type=tool` - generic action that doesn’t require any action specific\n        input processing\n*   **exec_strategy** - One of `local`, `remote`, `remote_local_fallback`,\n    `racing`. It is recommended to set it to `remote_local_fallback` or\n    `racing`. With `remote_local_fallback` it will try to execute the action\n    remotely and fallback to local if the remote execution failed. With `racing`\n    it tries to execute both and picks the one that finished sooner.\n*   `env_var_allowlist` - List of environment variables allowed to pass to the\n    proxy. If the build action depends on local environment variables, they\n    should be set here, so they're reproduced on the remote worker.\n\nIf you are experiencing sporadic timeouts when dialing reproxy, you might\nconsider adding:\n\n*   **dial_timeout** - By default is 3m, if the flag is not set. But for some\n    projects, increasing it up to 10m has proved beneficial in eliminating the\n    timeouts\n\n### Reproxy\n\nFull list of reproxy flags can be found\n[docs/cmd-line-flags.md](docs/cmd-line-flags.md). A few of the most commonly\nused flags are:\n\n*   **service** - The remote execution service to dial when calling via gRPC,\n    including port, such as `localhost:8790`\n*   **instance** - If a server supports multiple instances of the execution\n    system (with their own workers, storage, caches, etc.), the field instructs\n    the server which instance of the execution system to operate against. If the\n    server does not support different instances, the field can be omitted.\n*   **server_address** - An address reproxy should start its gRPC server on and\n    listen for incoming communication from rewrapper (should be set to the same\n    value as rewrapper's `server_address` parameter)\n*   **depsscanner_address** - The address of the dependency scanner service. To\n    use the `scandeps_server` distributed with Reclient set the value to\n    `exec://$absolute_path_to_reclient_dir/scandeps_server` For instance, if\n    Reclient is checked out to `/home/$user/chromium/src/buildtools/reclient/`,\n    the value of the attribute should be\n    `exec:///home/$user/chromium/src/buildtools/reclient/scandeps_server`\n\n#### Authentication flags\n\nIf your RE Server implementation does not use RPC authentication then use one\nof:\n\n*   **service_no_auth** - If `true`, do not authenticate with the service\n    (implied by `-service_no_security`).\n*   **use_rpc_credentials** - If `false`, no per-RPC credentials will be used.\n    Disables `--credential_file`, `-use_application_default_credentials`, and\n    `-use_gce_credentials`. (default `true`).\n\nIf your RE Server uses RPC authentication then use one of the following flags:\n\n*   **use_gce_credentials** - If `true` (and\n    `--use_application_default_credentials` is `false`), use the default GCE\n    credentials to authenticate with remote execution\n    (https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa).\n*   **use_application_default_credentials** - If `true`, use application default\n    credentials to connect to remote execution. See\n    https://cloud.google.com/sdk/gcloud/reference/auth/application-default/login\n*   **credential_file** - The name of a file that contains service account\n    credentials to use when calling remote execution. Used only if\n    `-use_application_default_credentials` and `-use_gce_credentials` are false.\n*   **credentials_helper** - Path to the credentials helper binary. If given `execrel://`, looks for the `credshelper` binary in the same folder as bootstrap/reproxy\n*   **credentials_helper_args** - Arguments for the credentials helper, separated by space\n\n    The reproxy is typically started via the bootstrap, so it is recommended to\n    avoid configuring it through the command line flags. It's advised to use\n    either a configuration file that’s passed to the bootstrap with the `-cfg`\n    flag or by setting environment variables before starting the bootstrap\n    ([example](https://source.chromium.org/chromium/chromium/tools/build/+/main:recipes/recipe_modules/reclient/api.py;l=378-396;drc=f3b7708f2a5728408a74ccbb6cba6eb9cb161aae)).\n\n#### Auxiliary Metadata flag\n\nIf you want to collect backend workers' auxiliary metadata (cpu, memory usage per action), you can\ngenerate a .pb (or .proto.bin) file contains the descriptor information that will be used by reproxy at runtime to\ndecode the auxiliary metadata, which is a [proto message](http://shortn/_3m8oS5NBur) in the type of `google.protobuf.Any`.\n\nOnce you have customized `auxiliary_metadata.proto` file per your backend worker's\nspecification, compile it as a `.pb` or `.proto.bin` file with `protoc`, and pass\nthe file path to reproxy via `--auxiliary_metadata_path` flag, or environment\nvariable `RBE_auxiliary_metadata_path`. Then, at runtime, reporxy will use this file to parse\nyour backend worker's auxiliary metadata and log the data into reporxy logs.\n\n```bash\ncd api/auxiliary_metadata # or where you have the cusotmized `.proto` file\n\nprotoc \\\n--proto_path=. \\\n--descriptor_set_out=auxiliary_metadata.pb \\\nauxiliary_metadata.proto\n\nexport RBE_auxiliary_metadata_path=~/Workspace/re-client/api/auxiliary_metadata/auxiliary_metadata.pb\n\n# then continue with your regular build with reproxy\n```\n\nor\n\n```bash\ncd api/auxiliary_metadata # or where you have the cusotmized `.proto` file\n\nprotoc \\\n--proto_path=. \\\n--descriptor_set_out=auxiliary_metadata.proto.bin \\\nauxiliary_metadata.proto\n\nexport RBE_auxiliary_metadata_path=~/Workspace/re-client/api/auxiliary_metadata/auxiliary_metadata.proto.bin\n\n# then continue with your regular build with reproxy\n```\n\nIt's worth noting that the backend can give this proto message any arbitrary name;\nhowever, the client side proto message should strictly use `AuxiliaryMetadata` to receive it.\nFor example, in the unit test, the backend send the proto msg out with name `WorkerAuxiliaryMetadata`, and client receives it as `AuxiliaryMetadata`.\n\n## Integration with the build system\n\nTo execute your build actions remotely through Reclient, the build command\nshould be prepended with:\n\n```\n $rewrapper [-cfg=$config-file] -exec_root=$checkout-dir --\n```\n\n, where:\n\n*   **\\$rewrapper** - path of the rewrapper binary\n*   **\\$config-file** - path of the rewrapper config file (assuming that\n    rewrapper was configured with config file)\n*   **\\$checkout-dir** - root directory of the source repository\n\nWhen rewrapper is executed, it passes the build command to a running instance of\nreproxy that:\n\n*   Determines dependencies either from command line flags (e.g. clang/gcc’s -I\n    flag) or from the content of input files (during input processing phase)\n*   Uploads toolchain, the inputs, and their dependencies to RBE\n*   Executes the command remotely\n*   Downloads artifacts locally\n\nBefore the build is executed, reproxy needs to be started by bootstrap and shut\ndown at the end of the build.\n\nDuring the run, reproxy writes its application-level logs to a directory\nspecified by a `log_dir` flag and logs records about the executed build actions\nto an RPL file in a directory specified by the `proxy_log_dir` flag. During\nreproxy shutdown, bootstrap dumps Reclient related build metrics to\n`rbe_metrics.txt` file saved at a location specified by the bootstrap's\n`output_path` flag.\n\n### GN integration\n\n[GN](https://gn.googlesource.com/gn/) is a meta-build system that generates\nbuild files for Ninja. Its configuration files are written in a simple,\ndynamically typed language. Reclient can be integrated with the build by\nmodifying the GN config files. Because of GN's language flexibility the method\nof how Reclient should be integrated will depend on the project, but usually it\nshould involve adding a rewrapper prefix\n([example](https://source.chromium.org/chromium/chromium/src/+/main:build/toolchain/gcc_toolchain.gni;l=214;drc=df7d81e33033a594ff56d5ab8387aa1f13cd1c39))\nthat's controlled by a gn argument\n([example](https://source.chromium.org/chromium/chromium/src/+/main:build/toolchain/rbe.gni;l=14;drc=dc850b9b1565dc29b7d8997994ed82d867852250)),\nand starting and stopping reproxy before and after the build. The latter might\nbe done by a helper script with reproxy start and stop steps around the ninja\ncall\n[example](https://source.chromium.org/chromium/chromium/tools/depot_tools/+/main:reclient_helper.py).\n\n### CMake integration\n\nYou can integrate CMake with Reclient by using\n[`\u003cLANG\u003e_COMPILER_LAUNCHER`](https://cmake.org/cmake/help/v3.14/prop_tgt/LANG_COMPILER_LAUNCHER.html)\nproperty. This property is initialized by the value of the\n`CMAKE_\u003cLANG\u003e_COMPILER_LAUNCHER` variable if it is set when a target is created.\nFor instance, to use Reclient for c/c++ compile actions, you’d need to set both\n`CMAKE_C_COMPILER_LAUNCHER` and `CMAKE_CXX_COMPILER_LAUNCHER` to\n`$rewrapper;-cfg=$config-file;-exec_root=$checkout-dir` (the property accepts\nsemicolon separated list as a launcher command).\n\nPlease note that CMake operates on absolute paths and you need to ensure that RE\nserver executes the action on a remote worker in the same directory as it is in\na local build machine (the method depends on your RE Server implementation).\nMoreover, please be aware that rewrapper's `canonicalize_working_dir` flag\ntampers the build actions' inputs paths, and thus should be disabled for the\nbuild actions generated by CMake.\n\nExample of CMake build integration with Reclient can be found\n[here](https://chromium.googlesource.com/emscripten-releases/+/refs/heads/main/src/host_toolchains.py).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbazelbuild%2Freclient","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbazelbuild%2Freclient","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbazelbuild%2Freclient/lists"}