-
Notifications
You must be signed in to change notification settings - Fork 519
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
rebar3 incorrectly printing stdout from rebar_utils:sh/pre_hook command #2205
Comments
Yeah I think I get it. The problem is that the shell util handlers receive a byte stream, which we handle as a list coming from a port. However, that same format makes for invalid unicode. The fix should be rather straightforwards. |
The problem is that the shell util handlers receive a byte stream, which we handle as a list coming from a port. However the byte stream is utf-8 encoded in most systems, which breaks encoding expectations (binaries only) for Erlang. This patch turns the list of characters to a binary for all shell calls, before re-encoding it properly as unicode lists to keep the format compatible. Fixes erlang#2205
The problem is that the shell util handlers receive a byte stream, which we handle as a list coming from a port. However the byte stream is utf-8 encoded in most systems, which breaks encoding expectations (binaries only) for Erlang. This patch turns the list of characters to a binary for all shell calls, before re-encoding it properly as unicode lists to keep the format compatible. Fixes erlang#2205
Can we re-open this? The fix was never released as there was a regression before the next version. |
Sure. I forgot it was linked to the other issue. I have not had time to spend on this either recently but it's fine to reopen and track properly. |
Thanks. I totally forgot as well! |
I have a shell command (the Gleam compiler) that prints text to stdout. When run within rebar3 using a
pre_hook
orrebar_utils:sh/2
some of the output is garbled and is incorrectly printed to the console.Here is the expected output:
Here is the output when run within rebar3.
I have a reproduction of the issue here: lpil/learning@c6d9bfe
An example of how I am using
rebar_util:sh/2
can be found here: https://github.com/gleam-lang/rebar_gleam/blob/2e9f8d4726f4c38db08e5dbc894c67da6159489f/src/rebar_gleam.erl#L15Thank you
Environment
The text was updated successfully, but these errors were encountered: