Hello! I'm running into an issue during the Detecting Platform step of the ESBuild install. I get this error after running gleam run -m lustre/dev start --use-example-styles.
exception error: construction of binary failed
in function lustre_dev_tools@esbuild:explain/1 (c:/Users/Svaug/projects/gleam/example/build/dev/erlang/lustre_dev_tools/_gleam_artefacts/lustre_dev_tools@esbuild.erl, line 177)
*** segment 2 of type 'binary': expected a binary but got: {ok,<<"x64">>}
I'm not super familiar with Erlang, but my after some digging, I think it might be an issue with get_cpu in lustre_dev_tools_ffi.erl. It appears that a result is being returned for windows:
get_cpu() ->
case erlang:system_info(os_type) of
{unix, _} ->
[Arch, _] = string:split(erlang:system_info(system_architecture), "-"),
list_to_binary(Arch);
{win32, _} ->
case erlang:system_info(wordsize) of
4 -> {ok, <<"ia32">>};
8 -> {ok, <<"x64">>}
end
end.
while the gleam external declaration suggests it should return a bitstring:
Hello! I'm running into an issue during the
Detecting Platform
step of the ESBuild install. I get this error after runninggleam run -m lustre/dev start --use-example-styles
.I'm not super familiar with Erlang, but my after some digging, I think it might be an issue with
get_cpu
inlustre_dev_tools_ffi.erl
. It appears that a result is being returned for windows:while the gleam external declaration suggests it should return a bitstring:
If this seems like the right track, I would be more than happy to put up a PR to resolve this!