Fix StringEncoding conversions in remote execution, caching and auth (#32113) ### Description Fixes missing and incorrect conversions between Bazel's internal string encoding and Unicode or platform strings (see `StringEncoding`) in remote execution, remote caching and authentication. Strings are converted to internal strings where they enter Bazel and only reencoded where they leave it. Areas covered: - Remote execution: request metadata, output paths, server messages, platform property order (by code point, as required by the REAPI) and gRPC errors, including those with status UNKNOWN. - Remote repository execution (`--experimental_repo_remote_exec`): arguments, environment, working directory and errors. - The `--remote_cache` URL, including the Base64 alphabet used for credentials embedded in it, the remote output service, the remote downloader and HTTP cache errors. - TLS and credential file paths, Unix domain socket paths, credential helper headers and errors. - Remote cache key scrubbing rules are matched against the Unicode form of mnemonics, labels, kinds, inputs and arguments. - Errors for a malformed `--remote_grpc_service_config`. - The remote worker. ### Motivation Non-ASCII characters in paths, labels, URLs and server messages were garbled or referred to the wrong file when exchanged with remote services. Split out of #31720. ### Build API Changes No ### Release Notes RELNOTES: Fixed the handling of non-ASCII characters in remote execution and caching, credential helpers and the remote downloader. Closes #32113 COPYBARA_INTEGRATE_REVIEW=https://github.com/bazelbuild/bazel/pull/32113 from fmeum:fix-string-encoding-remote c817272e72d74f38cb208dbf56d6a62d7d5755db PiperOrigin-RevId: 1026480529 Change-Id: I0025d71acac8531ad6174956b17a1fd671b11ef8
{Fast, Correct} - Choose two
Build and test software of any size, quickly and reliably.
Speed up your builds and tests: Bazel rebuilds only what is necessary. With advanced local and distributed caching, optimized dependency analysis and parallel execution, you get fast and incremental builds.
One tool, multiple languages: Build and test Java, C++, Android, iOS, Go, and a wide variety of other language platforms. Bazel runs on Windows, macOS, and Linux.
Scalable: Bazel helps you scale your organization, codebase, and continuous integration solution. It handles codebases of any size, in multiple repositories or a huge monorepo.
Extensible to your needs: Easily add support for new languages and platforms with Bazel's familiar extension language. Share and re-use language rules written by the growing Bazel community.
To report a security issue, please email security@bazel.build with a description of the issue, the steps you took to create the issue, affected versions, and, if known, mitigations for the issue. Our vulnerability management team will respond within 3 working days of your email. If the issue is confirmed as a vulnerability, we will open a Security Advisory. This project follows a 90 day disclosure timeline.
See CONTRIBUTING.md