1

I am compiling my application with mix compile and there an error is occurring for the dependency salty.

I have already added the dependency salty and libsodium. But still error is not resolved.

this is my mix.exs file with all the dependencies.

defp deps do
    [
      {:poison, "~> 3.0", override: true},
      {:syndicate, in_umbrella: true},
      {:xarango, "~> 0.7.0"},
      {:ecto, "~> 3.1"},
      {:phoenix, "~> 1.4.0"},
      {:gettext, "~> 0.11"},
      {:cowboy, "~> 2.6"},
      {:joken, "~> 2.0"},
      {:ecto_sql, "~> 3.0"},
      {:jason, "~> 1.0"},
      {:postgrex, ">= 0.0.0"},
      {:sage, "~> 0.4.0"},
      {:salty, "~> 0.1.3", hex: :libsalty},
      {:libsodium, "~> 0.0.10"}
    ]
  end

it should compile perfectly but it is throwing an error

 SALTY_CONST_INT64(box_curve25519xchacha20poly1305_SEEDBYTES);
 ^
src/salty_nif.c: In function ‘salty_aead_xchacha20poly1305_ietf_ABYTES’:
src/salty_nif.c:632:1: warning: control reaches end of non-void function [-Wreturn-type]
 SALTY_CONST_INT64(aead_xchacha20poly1305_ietf_ABYTES);
 ^
src/salty_nif.c: In function ‘salty_aead_xchacha20poly1305_ietf_NPUBBYTES’:
src/salty_nif.c:631:1: warning: control reaches end of non-void function [-Wreturn-type]
 SALTY_CONST_INT64(aead_xchacha20poly1305_ietf_NPUBBYTES);
 ^
src/salty_nif.c: In function ‘salty_aead_xchacha20poly1305_ietf_NSECBYTES’:
src/salty_nif.c:630:1: warning: control reaches end of non-void function [-Wreturn-type]
 SALTY_CONST_INT64(aead_xchacha20poly1305_ietf_NSECBYTES);
 ^
src/salty_nif.c: In function ‘salty_aead_xchacha20poly1305_ietf_KEYBYTES’:
src/salty_nif.c:629:1: warning: control reaches end of non-void function [-Wreturn-type]
 SALTY_CONST_INT64(aead_xchacha20poly1305_ietf_KEYBYTES);
 ^
src/salty_nif.c: In function ‘salty_aead_chacha20poly1305_ietf_ABYTES’:
src/salty_nif.c:578:1: warning: control reaches end of non-void function [-Wreturn-type]
 SALTY_CONST_INT64(aead_chacha20poly1305_ietf_ABYTES);
 ^
src/salty_nif.c: In function ‘salty_aead_chacha20poly1305_ietf_NPUBBYTES’:
src/salty_nif.c:577:1: warning: control reaches end of non-void function [-Wreturn-type]
 SALTY_CONST_INT64(aead_chacha20poly1305_ietf_NPUBBYTES);
 ^
src/salty_nif.c: In function ‘salty_aead_chacha20poly1305_ietf_NSECBYTES’:
src/salty_nif.c:576:1: warning: control reaches end of non-void function [-Wreturn-type]
 SALTY_CONST_INT64(aead_chacha20poly1305_ietf_NSECBYTES);
 ^
src/salty_nif.c: In function ‘salty_aead_chacha20poly1305_ietf_KEYBYTES’:
src/salty_nif.c:575:1: warning: control reaches end of non-void function [-Wreturn-type]
 SALTY_CONST_INT64(aead_chacha20poly1305_ietf_KEYBYTES);
 ^
Makefile:37: recipe for target 'priv/salty_nif.so' failed
make: *** [priv/salty_nif.so] Error 1
 SALTY_CONST_INT64(box_curve25519xchacha20poly1305_SEEDBYTES);
 ^
src/salty_nif.c: In function ‘salty_aead_xchacha20poly1305_ietf_ABYTES’:
src/salty_nif.c:632:1: warning: control reaches end of non-void function [-Wreturn-type]
 SALTY_CONST_INT64(aead_xchacha20poly1305_ietf_ABYTES);
 ^
src/salty_nif.c: In function ‘salty_aead_xchacha20poly1305_ietf_NPUBBYTES’:
src/salty_nif.c:631:1: warning: control reaches end of non-void function [-Wreturn-type]
 SALTY_CONST_INT64(aead_xchacha20poly1305_ietf_NPUBBYTES);
 ^
src/salty_nif.c: In function ‘salty_aead_xchacha20poly1305_ietf_NSECBYTES’:
src/salty_nif.c:630:1: warning: control reaches end of non-void function [-Wreturn-type]
 SALTY_CONST_INT64(aead_xchacha20poly1305_ietf_NSECBYTES);
 ^
src/salty_nif.c: In function ‘salty_aead_xchacha20poly1305_ietf_KEYBYTES’:
src/salty_nif.c:629:1: warning: control reaches end of non-void function [-Wreturn-type]
 SALTY_CONST_INT64(aead_xchacha20poly1305_ietf_KEYBYTES);
 ^
src/salty_nif.c: In function ‘salty_aead_chacha20poly1305_ietf_ABYTES’:
src/salty_nif.c:578:1: warning: control reaches end of non-void function [-Wreturn-type]
 SALTY_CONST_INT64(aead_chacha20poly1305_ietf_ABYTES);
 ^
src/salty_nif.c: In function ‘salty_aead_chacha20poly1305_ietf_NPUBBYTES’:
src/salty_nif.c:577:1: warning: control reaches end of non-void function [-Wreturn-type]
 SALTY_CONST_INT64(aead_chacha20poly1305_ietf_NPUBBYTES);
 ^
src/salty_nif.c: In function ‘salty_aead_chacha20poly1305_ietf_NSECBYTES’:
src/salty_nif.c:576:1: warning: control reaches end of non-void function [-Wreturn-type]
 SALTY_CONST_INT64(aead_chacha20poly1305_ietf_NSECBYTES);
 ^
src/salty_nif.c: In function ‘salty_aead_chacha20poly1305_ietf_KEYBYTES’:
src/salty_nif.c:575:1: warning: control reaches end of non-void function [-Wreturn-type]
 SALTY_CONST_INT64(aead_chacha20poly1305_ietf_KEYBYTES);
 ^
Makefile:37: recipe for target 'priv/salty_nif.so' failed
make: *** [priv/salty_nif.so] Error 1

could not compile dependency :salty, "mix compile" failed. You can recompile this dependency with "mix deps.compile salty", update it with "mix deps.update salty" or clean it with "mix deps.clean salty"
** (Mix) Could not compile with "make" (exit status: 2).
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. If you're on Fedora, run
"dnf group install 'Development Tools'".
SmartieHead
  • 63
  • 3
  • 8
  • You need to have gcc and make installed. did you follow this error message? – Tano Jun 19 '19 at 07:57
  • 1
    yeah..its already installed. and also erlang-dev package is installed – SmartieHead Jun 19 '19 at 08:58
  • The [README file](https://github.com/ArteMisc/libsalty#requirements) says "Libsalty requires that libsodium 1.0.12 or later is already installed on your system. If you receive compiler warnings or a missing symbol error when trying to use libsalty, it's likely that you're running on a system with an old version of libsodium." Perhaps that's worth checking? – legoscia Jun 19 '19 at 12:26
  • 1
    but whenever i try to install libsodium by ```apt-get install libsodium-dev ``` it says its already upto date. ```Reading package lists... Done Building dependency tree Reading state information... Done libsodium-dev is already the newest version (1.0.8-5). 0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded. ``` – SmartieHead Jun 19 '19 at 12:59
  • 1
    Package manager default repositories usually do not have the most up to date versions of packages. It sounds like you will need to get a newer version of libsodium from elsewhere. – Justin Wood Jun 19 '19 at 13:26
  • 1
    where will i get that? – SmartieHead Jun 20 '19 at 05:17
  • @RadhikaPatil Are you using Ubuntu? Looking at https://packages.ubuntu.com/libsodium-dev , it seems like there is a newer libsodium version in Ubuntu 18.04 and later. Any chance you can upgrade Ubuntu? – legoscia Jun 20 '19 at 09:21
  • [https://download.libsodium.org/libsodium/releases/] i got newer version of libsodium from here..just installed and it resolved the issue – SmartieHead Jun 20 '19 at 09:44

1 Answers1

0

As noted in the comments to question, installing libsodium 1.0.12+ addresses the issue.

oldhomemovie
  • 14,621
  • 13
  • 64
  • 99