[deb] Avoid UTF-8 roundtrip for {pre,post}-{inst,rm} hooks#1054
Open
Yannic wants to merge 1 commit intobazelbuild:mainfrom
Open
[deb] Avoid UTF-8 roundtrip for {pre,post}-{inst,rm} hooks#1054Yannic wants to merge 1 commit intobazelbuild:mainfrom
UTF-8 roundtrip for {pre,post}-{inst,rm} hooks#1054Yannic wants to merge 1 commit intobazelbuild:mainfrom
Conversation
5809ef2 to
9fa0143
Compare
This change allows the Debian package hooks to be arbitrary files (including
executable binary files), which failed with the following error before:
```
Traceback (most recent call last):
File "/Users/yannic/Library/Caches/bazel/_bazel_yannic/bb6c3b02ccc98aaca966df445b5024eb/sandbox/darwin-sandbox/3472/execroot/_main/bazel-out/darwin_x86_64-opt-exec/bin/external/rules_pkg+/pkg/private/deb/make_deb.runfiles/rules_pkg+/pkg/private/deb/_make_deb_stage2_bootstrap.py", line 499, in <module>
main()
~~~~^^
File "/Users/yannic/Library/Caches/bazel/_bazel_yannic/bb6c3b02ccc98aaca966df445b5024eb/sandbox/darwin-sandbox/3472/execroot/_main/bazel-out/darwin_x86_64-opt-exec/bin/external/rules_pkg+/pkg/private/deb/make_deb.runfiles/rules_pkg+/pkg/private/deb/_make_deb_stage2_bootstrap.py", line 493, in main
_run_py_path(main_filename, args=sys.argv[1:])
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/yannic/Library/Caches/bazel/_bazel_yannic/bb6c3b02ccc98aaca966df445b5024eb/sandbox/darwin-sandbox/3472/execroot/_main/bazel-out/darwin_x86_64-opt-exec/bin/external/rules_pkg+/pkg/private/deb/make_deb.runfiles/rules_pkg+/pkg/private/deb/_make_deb_stage2_bootstrap.py", line 287, in _run_py_path
runpy.run_path(main_filename, run_name="__main__")
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen runpy>", line 287, in run_path
File "<frozen runpy>", line 98, in _run_module_code
File "<frozen runpy>", line 88, in _run_code
File "/Users/yannic/Library/Caches/bazel/_bazel_yannic/bb6c3b02ccc98aaca966df445b5024eb/sandbox/darwin-sandbox/3472/execroot/_main/bazel-out/darwin_x86_64-opt-exec/bin/external/rules_pkg+/pkg/private/deb/make_deb.runfiles/rules_pkg+/pkg/private/deb/make_deb.py", line 433, in <module>
main()
~~~~^^
File "/Users/yannic/Library/Caches/bazel/_bazel_yannic/bb6c3b02ccc98aaca966df445b5024eb/sandbox/darwin-sandbox/3472/execroot/_main/bazel-out/darwin_x86_64-opt-exec/bin/external/rules_pkg+/pkg/private/deb/make_deb.runfiles/rules_pkg+/pkg/private/deb/make_deb.py", line 392, in main
prerm=helpers.GetFlagValue(options.prerm, False),
~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
File "/Users/yannic/Library/Caches/bazel/_bazel_yannic/bb6c3b02ccc98aaca966df445b5024eb/sandbox/darwin-sandbox/3472/execroot/_main/bazel-out/darwin_x86_64-opt-exec/bin/external/rules_pkg+/pkg/private/deb/make_deb.runfiles/rules_pkg+/pkg/private/helpers.py", line 81, in GetFlagValue
flagvalue = f.read().decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcf in position 0: invalid continuation byte
```
(the example used a `go_binary` for `prerm`)
9fa0143 to
f6e8a72
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change allows the Debian package hooks to be arbitrary files (including executable binary files), which failed with the following error before:
(the example used a
go_binaryforprerm)