electricFeel / savory

An Elixir port of
15 stars 10 forks source link

Savory cannot be installed as a dependency on modern versions of Elixir #2

Open grempe opened 9 years ago

grempe commented 9 years ago

The following error is shown if you try to use Savory in a modern version of Elixir as a dependency:

** (Mix) You're trying to run :savory on Elixir v1.0.4 but it has declared in its mix.exs file it supports only Elixir ~> 0.15.1

Can you please release a new version on hex.pm that works with Elixir 1.0+ (and presumably with libsodium 1.0.2 which is the most current version).

Thank you!

grempe commented 9 years ago

I made a local fork just to quickly try out compiling on my own machine (OS X Yosemite with clang 6.1.0) and the following error is thrown for mix compile:

/tmp/savory (master ✗)$ mix compile
Compiling salt_nif.c
mkdir -p priv/x86_64-apple-darwin14.1.0 &&\
    cc -c -g -Wall -fPIC  -I/usr/local/Cellar/erlang/17.5/lib/erlang/erts-6.4/include -I/usr/local/Cellar/erlang/17.5/lib/erlang/lib/erl_interface-3.7.20/include -Wall -Werror -I/usr/local/include/sodium src/salt_nif.c -o src/salt_nif.o 2>&1 >/dev/null
cc src/salt_nif.o -shared -L"/usr/local/Cellar/erlang/17.5/lib/erlang/lib/erl_interface-3.7.20/lib" -lerl_interface -lei -L/usr/local/lib -Wl,-R/usr/local/lib -lsodium   -o priv/x86_64-apple-darwin14.1.0/salt_nif.so
ld: unknown option: -R/usr/local/lib
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [all] Error 1
** (Mix.Error) error running make
    mix.exs:33: Savory.Mixfile.run_make/1
    (mix) lib/mix/task.ex:272: Mix.Task.run_alias/3
    (mix) lib/mix/task.ex:236: Mix.Task.run/2
    (mix) lib/mix/cli.ex:55: Mix.CLI.run_task/2
    (elixir) lib/code.ex:307: Code.require_file/2
andoriyu commented 9 years ago

It has nothing to do with elixir. I successfully compiled savory on freebsd, just by bumping elixir version on mix.exs and changing make to gmake.

starting supervisor
starting server
........

Finished in 0.09 seconds (0.09s on load, 0.00s on tests)
8 tests, 0 failures
grempe commented 9 years ago

I agree that the compilation issues are a separate issue. However I believe the package on hex,pm is out of date and depends on old Elixir and cannot be installed as a dependency with Elixir 1,0+. A new package version is required to be committed and pushed to hex.

https://github.com/electricFeel/savory/blob/master/mix.exs