otp
otp copied to clipboard
Unicode filepaths and ERLC_USE_SERVER
Describe the bug If I use a unicode filepath and have set ERLC_USE_SERVER=true then any compilation using the server will fail with "no such file or directory.
To Reproduce
export ERLC_USE_SERVER=true
echo "-module(t). -export([t/0]). t() -> ok." > "∑/t.erl"
erlc "∑/t.erl"
erlc "∑/t.erl"
∑/t.erl: no such file or directory
Expected behavior The second call to erlc should not fail.
Affected versions I've only tested 25, but probably exists since introduction of the compile server.
The first call, will fail to connect to the compilation server and proceed to starting it but compile without the server. The second call will connect successfully to the compilation server and doing so it will encode the command line arguments into an Erlang term, among the functions ei_string_len is used which does not support unicode
Can we change the protocol to the server to use binaries instead of strings? @bjorng ?
I'm assuming we do not want to add an ei_encode_string_as
for sending unicode strings to an Erlang node...
Yes, changing the protocol to use binaries instead of strings should be easy. It might be enough to do the change only in erlc
. Glancing at erl_compile_server
code, it seems that it can already handle binaries as well as strings.
Fixed in #6306