steveryan

steveryan

Issue installing Argon2_elixir (can't compile comeonin)

Hey, I’m pretty new to elixir and am following along with Programming Phoenix >1.4. I’m trying to get argon_2 working (seems like the successor to comeonin, which is what the book recommends).

Seeing the following issue, and am not sure where to go from here. Any thoughts?

My info:
Mac OS 10.14.6
Erlang/OTP 22 [erts-10.6.4] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe] [dtrace]
Elixir 1.10.2 (compiled with Erlang/OTP 22)

Full Error below

** (Mix.Error) Could not compile Comeonin.
Please make sure that you are using Erlang / OTP version 18.0 or later
and that you have a C compiler installed.
Please follow the directions below for the operating system you are
using:
Mac OS X: You need to have gcc and make installed. Try running the
commands gcc --version and / or make --version. If these programs
are not installed, you will be prompted to install them.
Linux: You need to have gcc and make installed. If you are using
Ubuntu or any other Debian-based system, install the packages
build-essential. Also install erlang-dev package if not
included in your Erlang/OTP version.
See Requirements · riverrun/comeonin Wiki · GitHub for more
information.
/Users/steve/Sites/rumbl/deps/comeonin/mix.exs:44: Mix.Tasks.Compile.Comeonin.build_error/1
/Users/steve/Sites/rumbl/deps/comeonin/mix.exs:19: Mix.Tasks.Compile.Comeonin.run/1
(mix 1.10.2) lib/mix/task.ex:330: Mix.Task.run_task/3
(mix 1.10.2) lib/mix/tasks/compile.all.ex:76: Mix.Tasks.Compile.All.run_compiler/2
(mix 1.10.2) lib/mix/tasks/compile.all.ex:56: Mix.Tasks.Compile.All.do_compile/4
(mix 1.10.2) lib/mix/tasks/compile.all.ex:27: anonymous fn/2 in Mix.Tasks.Compile.All.run/1
(mix 1.10.2) lib/mix/tasks/compile.all.ex:43: Mix.Tasks.Compile.All.with_logger_app/2
(mix 1.10.2) lib/mix/task.ex:330: Mix.Task.run_task/3ElixirLS

steves-mbp:rumbl steve$ gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include/c++/4.2.1
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.7.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

steves-mbp:rumbl steve$ make --version
GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-apple-darwin11.3.0

Marked As Solved

mindok

mindok

Before doing anything manually in deps I’d focus on figuring out the underlying issue. I suspect it is one of two - either broken git (in turn breaking mix), or broken make. To troubleshoot, I’d suggest the following

  1. git/mix isn’t bringing down deps/argon2_elixir properly - check whether the there is an argon2 subdirectory and that it has plenty of c files - if so, the argon2_elixir is more than likely downloading ok. If not, this is likely a git problem rather than a mix problem. You can isolate this by trying to clone into a fresh directory using the --recursive option. I think this is the most likely problem. Once you have it resolved (e.g. by creating appropriate ssh key as per the link to the discussion I posted), you should find mix behaves itself for deps with git submodules. You may need to blow away deps/argon2_elixir and re-fetch.
  2. make is broken on your machine. Again, the best way to isolate issues here is to clone the argon2_elixir repo with the --recursive option into a new directory. Change into that directory and run make. If if complains or says it has nothing to do you have a problem there. We will need more info to help troubleshoot that.

Also Liked

steveryan

steveryan

Really appreciate all the help here. Looking at your post:

  1. deps/argon2_elixir does contain a folder argon2. Within that folder there is an include folder that has a single file, argon2.h, and a src folder which has 14 files most of which are .c files, with some .h files.

Trying number 2 now, and will update with the results

EDIT: Thinking your git comment was right, as this is in the output when I tried recursively cloning argon2_elixir:

git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: clone of ‘git@github.com:riverrun/phc-winner-argon2.git’ into submodule path ‘/Users/steve/Sites/argon2_elixir/argon2’ failed
Failed to clone ‘argon2’. Retry scheduled

Ok so after adding an SSH key I was able to clone the repo properly. From within that directory I ran make and got

steves-mbp:argon2_elixir steve$ make
mkdir -p priv
cc -pthread -O3 -Wall -g -Iargon2/include -Iargon2/src -Ic_src -I"/usr/local/Cellar/erlang/22.2.8/lib/erlang/erts-10.6.4/include/" -dynamiclib -undefined dynamic_lookup argon2/src/argon2.c argon2/src/core.c argon2/src/blake2/blake2b.c argon2/src/thread.c argon2/src/encoding.c argon2/src/ref.c c_src/argon2_nif.c -o priv/argon2_nif.so
steves-mbp:argon2_elixir Steve$

Since this didn’t complain about any errors, I took it that mix was working. So I went back to my project, and completely removed argon2_elixir and comeonin. I then re-added argon2_elixir and ran mix deps.get and mix deps.compile and got the following output:

steves-mbp:rumbl steve$ mix deps.compile
===> Compiling ranch
===> Compiling telemetry
==> comeonin
Compiling 4 files (.ex)
Generated comeonin app
==> argon2_elixir
mkdir -p priv
cc -pthread -O3 -Wall -g -Iargon2/include -Iargon2/src -Ic_src -I"/usr/local/Cellar/erlang/22.2.8/lib/erlang/erts-10.6.4/include/" -dynamiclib -undefined dynamic_lookup argon2/src/argon2.c argon2/src/core.c argon2/src/blake2/blake2b.c argon2/src/thread.c argon2/src/encoding.c argon2/src/ref.c c_src/argon2_nif.c -o priv/argon2_nif.so
Compiling 3 files (.ex)
Generated argon2_elixir app
===> Compiling cowlib
===> Compiling cowboy

Everything seemed to work fine, but I’m still seeing the error, could not compile comeonin

kokolegorille

kokolegorille

No, not really, it is the recommended password hashing function for comeonin, and depends on it.

It would be nice to know how You did that… with asdf? packages? other?

Do You have XCode installed?

That sounds like a Mac related issue :slight_smile:

kokolegorille

kokolegorille

Most people prefer to use a package manager…

I also prefer to use asdf-vm.

You probably can find some topics to help You if You choose this installation path.

mindok

mindok

I just tried to clone argon2_elixir recursively (to pick up the submodules) and that seems to break (permissions error). I’ll dig in a little more, but I don’t think it’s a Mac issue at this stage. Error I got was:

 !  ~/c/e/temp  git clone https://github.com/riverrun/argon2_elixir.git --recursive   Sat 28 Mar 2020 11:47:22 AWST
Cloning into 'argon2_elixir'...
remote: Enumerating objects: 17, done.
remote: Counting objects: 100% (17/17), done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 657 (delta 7), reused 14 (delta 5), pack-reused 640
Receiving objects: 100% (657/657), 113.82 KiB | 282.00 KiB/s, done.
Resolving deltas: 100% (371/371), done.
Submodule 'argon2' (git@github.com:riverrun/phc-winner-argon2.git) registered for path 'argon2'
Cloning into '/home/john/code/elix/temp/argon2_elixir/argon2'...
Warning: Permanently added the RSA host key for IP address '52.64.108.95' to the list of known hosts.
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'git@github.com:riverrun/phc-winner-argon2.git' into submodule path '/home/john/code/elix/temp/argon2_elixir/argon2' failed
Failed to clone 'argon2'. Retry scheduled
Cloning into '/home/john/code/elix/temp/argon2_elixir/argon2'...
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
fatal: clone of 'git@github.com:riverrun/phc-winner-argon2.git' into submodule path '/home/john/code/elix/temp/argon2_elixir/argon2' failed
Failed to clone 'argon2' a second time, aborting

mindok

mindok

So I manually cloned https://github.com/riverrun/phc-winner-argon2.git into an argon2 subdirectory of argon2_elixir, ran make and it built ok. For me it looks like there’s something weird with bringing in the git submodule automatically.

EDIT: Try git clone https://github.com/riverrun/argon2_elixir.git --recursive - if that complains then you might have to do some git kung-fu to get dependencies with git submodules to work properly. There’s a discussion here that might help: https://github.com/facebookresearch/deepmask/issues/23

Where Next?

Popular in Questions Top

senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
sergio
In Ruby, I can go: User.find_by(email: "foobar@email.com").update(email: "hello@email.com") How can I do something similar in Elixir? ...
New
dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
lessless
I believe there are people here who are dealing with CSV files import on the daily basis, and since Excel is a really popular tool there ...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New

Other popular topics Top

vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
New
vac
Hi, I'm quite new in Elixir and I'm trying to format a string to a PEM format. I have the certificate value like MIIDBTCCAe2...... and ...
New
danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 27727 240
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New

We're in Beta

About us Mission Statement