riverrun / argon2_elixir

Elixir wrapper for the Argon2 password hashing algorithm
Apache License 2.0
229 stars 34 forks source link

Compilation failure with Erlang 26 on Windows 10 #59

Closed kotsius closed 1 year ago

kotsius commented 1 year ago

Upgrading to Erlang 26 (Elixir v15.0.4) on Windows 10 leads to the following endless loop:

sCapture-838

Everything worked fine under Erlang 25. I have no idea whether this issue is specific to argon2_elixir, please advise.

riverrun commented 1 year ago

Sorry for the delay in getting back to you.

I think the best idea for you is to reach out to https://elixirforum.com/ and see if you can get any feedback there - from Windows users.

If it turns out that changes need to be made to argon2_elixir, then please let me know, and I will be glad to help.

akirion commented 1 year ago

I was able to reproduce this error. After some iterations it stops with:

argon2_error_001

U1082 seems to be nmakes way to say 'out of memory'. So its maybe a temporary filename, that is too long?

iex(1)> :io.format('~ts',[[34, 67, 58, 92, 87, 105, 110, 100, 111, 119, 115, 92, 83, 121, 115, 116, 101, 109, 51, 50, 92, 119, 104, 101, 114, 101, 46, 69, 88, 69, 34, 58, 32, 66, 101, 102, 101, 104,108, 32, 107, 111, 110, 110, 116, 101, 32, 110, 105, 99]])

"C:\Windows\System32\where.EXE": Befehl konnte nic:ok

Which translates to '"C:\Windows\System32\where.EXE": Command could not...' Unfortunatly the message is truncated. Is there a way to stop elixir to truncate error messages?

Maybe only a side note: The Elixir installation moved recently from "Program Files (x86)" (Elixir 1.14) to "Program Files" (Elixir 1.15)

kotsius commented 1 year ago

On akirion's side note: Elixir 1.15 on Erlang 25 compiles, whereas Elixir 1.14 on Erlang 26 does not. Therefore, this seems to be an Erlang 26 issue, not an Elixir 1.15 one, implying that the change to the 64bit 'Program Files' installation directory is likely irrelevant.

akirion commented 1 year ago

Good news. I was able to find a fix for this problem. The issue is in the following line 49 of Makefile.win:

erl -noshell -s init stop -eval "io:setopts(standard_io, [{encoding, unicode}]), io:format(\"ERTS_INCLUDE_PATH=~ts/erts-~ts/include/\", [code:root_dir(), erlang:system_info(version)])." > $@

First I had a look at the Makefile from Exqlite, which compiled just fine, and noticed that the -s argument is in the last position. That solves the loop, but results in a freeze at the same position. Unfortunatly the unicode fix seems to cause this, because after I changed the line to:

erl -noshell -eval "io:format(\"ERTS_INCLUDE_PATH=~ts/erts-~ts/include/\", [code:root_dir(), erlang:system_info(version)])." -s init stop > $@

everything compiled without any further errors.

riverrun commented 1 year ago

@akirion could you please open a pull request?

riverrun commented 1 year ago

Fixed in #60 - thanks to @akirion

kotsius commented 1 year ago

Just to confirm that the issue has now been resolved. Thank you @akirion and @riverrun!