Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop doing actions.write UTF-8. This was causing a double encode. #11496

Closed
wants to merge 1 commit into from

Conversation

aiuto
Copy link
Contributor

@aiuto aiuto commented May 26, 2020

Since Bazel reads BUILD and .bzl files as (essentially) raw bytes, any UTF-8
encoded input is essentially pre-UTF-8 encoded on the way out.

Closes #10174

DO NOT SUBMIT: This is a breaking change, so it needs a migration path.
Current idea:

  • introduce a new attribute to write 'encode_as_utf_8'. Default is gated by incompatible_write_action_encodes_as_utf_8.
  • for bazel we do the multi-release cycle flip
  • for google we agressively try to change the default
    • add encode_as_utf_8 to the few broken rules
    • flip the default
    • fix the user.

Since Bazel reads BUILD and .bzl files as (essentially) raw bytes, any UTF-8
encoded input is essentially pre-UTF-8 encoded on the way out.

Closes bazelbuild#10174

DO NOT SUBMIT: This is a breaking change, so it needs a migration path.
Current idea:
- introduce a new attribute to write 'encode_as_utf_8'. Default is gated by incompatible_write_action_encodes_as_utf_8.
- for bazel we do the multi-release cycle flip
- for google we agressively try to change the default
  - add encode_as_utf_8 to the few broken rules
  - flip the default
  - fix the user.
@aiuto
Copy link
Contributor Author

aiuto commented Jul 7, 2020

Done in a different PR.

@aiuto aiuto closed this Jul 7, 2020
@aiuto aiuto deleted the write_right branch July 7, 2020 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUILD file parsing is not symmetric w.r.t. actions.write when processing UTF-8 encoded BUILD files.
2 participants