commit | 27e1103216e59fba43e9674f2c5832788c2406fe | [log] [tgz] |
---|---|---|
author | aiuto <aiuto@google.com> | Wed Jun 24 06:58:04 2020 -0700 |
committer | Copybara-Service <copybara-worker@google.com> | Wed Jun 24 06:59:01 2020 -0700 |
tree | d9f5010063a5ecf947fba157fb79350233af7a68 | |
parent | 1a38fa0ea63e403081d49b9f84bfa418e4aa9d50 [diff] |
Fix ctx.actions.write to write as ISO 8859-1 so it is symetric with BUILD and .bzl input parsing. Internally BUILD and .bzl files are read as uninterpreted raw byte strings and not as UTF-8, so we should write content back out the same way. For example, if a BUILD file contains: ``` ... notice = "Copyright © 2019 Acme LLC", ``` Bazel will store the copyright symbol as two distinct octets ([0xc2, 0xa9]). When writing that with an action, the same two octets should be emitted. The behavior fixed by this change is to not interpret each character as a standalone Unicode code point to be encoded as UTF-8. While this change is appropriate for strings read from BUILD files, there is still a discrepancy in handling file paths with non Latin1 characters on Windows file systems. That is described in https://github.com/bazelbuild/bazel/issues/11602. While this change does produce an observable behavior change, I am considering it a bug fix rather than an incompatible change because the previous behavior was both wrong and also (as described in #11602) inconsistent across different OSes. Closes https://github.com/bazelbuild/bazel/issues/10174 RELNOTES: Fix behavior of ctx.actions.write so content is written without an incorrect encoding to UTF-8. See https://github.com/bazelbuild/bazel/issues/10174 for details. PiperOrigin-RevId: 318056290
{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.
Follow our tutorials:
See CONTRIBUTING.md