elixir-lang / elixir

Elixir is a dynamic, functional language for building scalable and maintainable applications

Home Page:https://elixir-lang.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

** (ArgumentError) argument error (stdlib 5.2.3) io.erl:103: :io.put_chars

moacirbishopcamata opened this issue · comments

Elixir and Erlang/OTP versions

Erlang/OTP 26 [erts-14.2.5] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit:ns]

Elixir 1.16.3 (compiled with Erlang/OTP 26)

Operating system

Windows 10 PRO(22H2) AMD Ryzen 5 PRO 2400G with Radeon Vega

Current behavior

mix test
==> comeonin
Compiling 3 files (.ex)
Generated comeonin app
==> elixir_make
Compiling 6 files (.ex)
Generated elixir_make app
==> argon2_elixir

** (ArgumentError) argument error
(stdlib 5.2.3) io.erl:103: :io.put_chars(:standard_io, <<77, 105, 99, 114, 111, 115, 111, 102, 116, 32, 40, 82, 41, 32, 80, 114, 111, 103, 114, 97, 109, 32, 77, 97, 105, 110, 116, 101, 110, 97, 110, 99, 101, 32, 85, 116, 105, 108, 105, 116, 121, 32, 86, 101, 114, 115, 227, 111, 32, 49, ...>>)
(elixir 1.16.3) lib/system.ex:1149: System.do_port_byte/3
(elixir 1.16.3) lib/system.ex:1135: System.do_cmd/3
(elixir_make 0.7.7) lib/elixir_make/compiler.ex:115: ElixirMake.Compiler.cmd/5
(elixir_make 0.7.7) lib/elixir_make/compiler.ex:92: ElixirMake.Compiler.make/2
(elixir_make 0.7.7) lib/elixir_make/compiler.ex:53: ElixirMake.Compiler.compile/1
(mix 1.16.3) lib/mix/task.ex:478: anonymous fn/3 in Mix.Task.run_task/5
(mix 1.16.3) lib/mix/tasks/compile.all.ex:122: Mix.Tasks.Compile.All.run_compiler/2

Expected behavior

Excellent work for everyone,
I have a problem compiling the "Argon2_Elixir" module to generate authorization via "mix.gen.auth --hashing-lib argon2".

I installed nmake and the necessary development dependencies, but unfortunately I was not successful.

I would like a "path" to achieve the result, so I can collaborate.

Thank you for everyone's attention.

Hi @moacirbishopcamata, try calling chcp 65001 before running the command. This is happening because Windows is returning non-UTF8 from its terminal, and that causes IO to crash because of bad UTF8.

Thank you very much for your quick attention.

The error now appears in the migration "mix ecto.migrate";
chcp 65001 && mix ecto.migrate
Active code page: 65001
==> argon2_elixir

could not compile dependency :argon2_elixir, "mix compile" failed. Errors may have been logged
above. You can recompile this dependency with "mix deps.compile argon2_elixir --force", update it with "mix deps.update argon2_elixir" or clean it with "mix deps.clean argon2_elixir" ** (ArgumentError) argument error (stdlib 5.2.3) io.erl:103: :io.put_chars(:standard_io, <<77, 105, 99, 114, 111, 115, 111, 102, 116, 32, 40, 82, 41, 32, 80, 114, 111, 103, 114, 97, 109, 32, 77, 97, 105, 110, 116, 101, 110, 97, 110, 99, 101, 32, 85, 116, 105, 108, 105, 116, 121, 32, 86, 101, 114, 115, 227, 111, 32, 49, ...>>)
(elixir 1.16.3) lib/system.ex:1149: System.do_port_byte/3
(elixir 1.16.3) lib/system.ex:1135: System.do_cmd/3
(elixir_make 0.8.3) lib/elixir_make/compiler.ex:115: ElixirMake.Compiler.cmd/5
(elixir_make 0.8.3) lib/elixir_make/compiler.ex:92: ElixirMake.Compiler.make/2
(elixir_make 0.8.3) lib/elixir_make/compiler.ex:53: ElixirMake.Compiler.compile/1
(mix 1.16.3) lib/mix/task.ex:478: anonymous fn/3 in Mix.Task.run_task/5
(mix 1.16.3) lib/mix/tasks/compile.all.ex:122: Mix.Tasks.Compile.All.run_compiler/2

The database is PostgreSQL v15.

I think I'm doing something wrong in the creation command: mix phx.gen.auth Accounts User users --live --hashing-lib argon2 --binary-id

Thanks again.

I proceeded with the recommendations, but failed in the result:
mix deps.compile argon2_elixir --force
==> argon2_elixir

could not compile dependency :argon2_elixir, "mix compile" failed. Errors may have been logged above. You can recompile this dependency with "mix deps.compile argon2_elixir --force", update it with "mix deps.update argon2_elixir" or clean it with "mix deps.clean argon2_elixir"
** (ArgumentError) argument error
(stdlib 5.2.3) io.erl:103: :io.put_chars(:standard_io, <<77, 105, 99, 114, 111, 115, 111, 102, 116, 32, 40, 82, 41, 32, 80, 114, 111, 103, 114, 97, 109, 32, 77, 97, 105, 110, 116, 101, 110, 97, 110, 99, 101, 32, 85, 116, 105, 108, 105, 116, 121, 32, 86, 101, 114, 115, 227, 111, 32, 49, ...>>)
(elixir 1.16.3) lib/system.ex:1149: System.do_port_byte/3
(elixir 1.16.3) lib/system.ex:1135: System.do_cmd/3
(elixir_make 0.8.3) lib/elixir_make/compiler.ex:115: ElixirMake.Compiler.cmd/5
(elixir_make 0.8.3) lib/elixir_make/compiler.ex:92: ElixirMake.Compiler.make/2
(elixir_make 0.8.3) lib/elixir_make/compiler.ex:53: ElixirMake.Compiler.compile/1
(mix 1.16.3) lib/mix/task.ex:478: anonymous fn/3 in Mix.Task.run_task/5
(mix 1.16.3) lib/mix/tasks/compile.all.ex:122: Mix.Tasks.Compile.All.run_compiler/2

Can you try going to deps/argon2_elixir and calling nmakeyourself? Or clone the official repository. I will see if I can add something to make sure elixir_make does not crash.

As for cloning the repository, I've already done it with the steps indicated by the team that develops it and their command tip chcp 65001, but the error is the same for the rep.: argon2_elixir:

** (ArgumentError) argument error
(stdlib 5.2.3) io.erl:103: :io.put_chars(:standard_io, <<77, 105, 99, 114, 111, 115, 111, 102, 116, 32, 40, 82, 41, 32, 80, 114, 111, 103, 114, 97, 109, 32, 77, 97, 105, 110, 116, 101, 110, 97, 110, 99, 101, 32, 85, 116, 105, 108, 105, 116, 121, 32, 86, 101, 114, 115, 227, 111, 32, 49, ...>>)
(elixir 1.16.3) lib/system.ex:1149: System.do_port_byte/3
(elixir 1.16.3) lib/system.ex:1135: System.do_cmd/3
(elixir_make 0.7.7) lib/elixir_make/compiler.ex:115: ElixirMake.Compiler.cmd/5
(elixir_make 0.7.7) lib/elixir_make/compiler.ex:92: ElixirMake.Compiler.make/2
(elixir_make 0.7.7) lib/elixir_make/compiler.ex:53: ElixirMake.Compiler.compile/1
(mix 1.16.3) lib/mix/task.ex:478: anonymous fn/3 in Mix.Task.run_task/5
(mix 1.16.3) lib/mix/tasks/compile.all.ex:122: Mix.Tasks.Compile.All.run_compiler/2

I don't want to bother you much longer.
But if it helps I'm willing to scratch my itch ;).

With your help of course.

e already done it with the steps indicated by the team that develops it and their command tip chcp 65001, but the error is the same for the rep.: argon2_elixir:

What is the exact command that you ran? It should be nmake or nmake compile. Erlang/Elixir should not be involved. :)

And it is ok to bother. If you are running into this, someone else might also.

Of course:

nmake Makefile.win

Microsoft (R) Program Maintenance Utility Version 14.00.24247.2
Copyright Microsoft Corporation. All rights reserved.
makefile(34) : fatal error U1036: syntax error : too many names to left of '='
Stop.

Could it be trying to run Makefile instead of Makefile.win? There is nothing on line 34 for Makefile.win but there is a = on the regular one: https://github.com/riverrun/argon2_elixir/blob/master/Makefile#L34

A new elixir_make has been released, which would show the error upfront. :)

Suppressing the default Makefile and the result was:
nmake Makefile.win

Microsoft (R) Program Maintenance Utility Version 14.00.24247.2
Copyright Microsoft Corporation. All rights reserved.
del /Q /F priv
Cannot find E:\argon2_elixir\priv
erl -noshell -eval "io:format("ERTS_INCLUDE_PATH=~ts/erts-~ts/include/", [code:root_dir(), erlang:system_info(version)])." -s init stop > Makefile.auto.win
nmake / /F Makefile.win priv\argon2_nif.dll

Microsoft (R) Program Maintenance Utility Version 14.00.24247.2
Copyright Microsoft Corporation. All rights reserved.
if NOT EXISTS "priv" mkdir "priv"
cl /O2 /EHsc /I"argon2\include" /I"argon2\src" /I"c:/Program Files/Erlang OTP/erts-14.2.5/include/" /LD /MD /Fepriv\argon2_nif.dll argon2\source\argon2.c argon2\source\core.c argon2\source\blake2\blake2b.c argon2\source\thread.c argon2\source\coding.c argon2\source \ref.c c_src\argon2_nif.c
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24247.2 for x86
Copyright (C) Microsoft Corporation. All rights reserved.

argon2.c
c1: fatal error C1083: Cannot open source file: 'argon2\src\argon2.c': No such file or directory
core.c
c1: fatal error C1083: Cannot open source file: 'argon2\src\core.c': No such file or directory
blake2b.c
c1: fatal error C1083: Cannot open source file: 'argon2\src\blake2\blake2b.c': No such file or directory
thread.c
c1: fatal error C1083: Cannot open source file: 'argon2\src\thread.c': No such file or directory
encoding.c
c1: fatal error C1083: Cannot open source file: 'argon2\src\encoding.c': No such file or directory
ref.c
c1: fatal error C1083: Cannot open source file: 'argon2\src\ref.c': No such file or directory
argon2_nif.c
c_src\argon2_nif.c(26): fatal error C1083: Cannot open include file: 'stdio.h': No such file or directory
Generating Code...
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.EXE"' : return code '0x2'
Stop.
NMAKE: fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\nmake.EXE"' : return code '0x2'
Stop.

Thank you very much for your help.

And from all the collaborators of the Elixir team.