Skip to content
This repository has been archived by the owner on Nov 26, 2020. It is now read-only.

Install error: warnings being treated as errors #41

Closed
sevenEng opened this issue Feb 13, 2017 · 4 comments
Closed

Install error: warnings being treated as errors #41

sevenEng opened this issue Feb 13, 2017 · 4 comments

Comments

@sevenEng
Copy link

These are some system combinations that I've tried to install sodium to:

  • Ubuntu 16.04 / OCaml 4.03.0 / opam 1.2.2 (my machine)
  • Ubuntu 16.04 / OCaml 4.04.0 / opam 1.2.2 (docker container)
  • debian 9 / OCaml 4.03.0 / opam 1.2.2 (docker container)

And the command that trigers this and the output is:

+ ocamlfind ocamlc -ccopt -I/usr/local/include -I /home/ql272/.opam/4.03.0/lib/ctypes -ccopt '--std=c99 -Wall -pedantic -Werror -Wno-pointer-sign' -c lib/sodium_stubs.c
lib/sodium_stubs.c: In function ‘caml__1_sodium_init’:
lib/sodium_stubs.c:6:4: error: ignoring return value of ‘sodium_init’, declared with attribute warn_unused_result [-Werror=unused-result]
    sodium_init();
    ^
lib/sodium_stubs.c: In function ‘caml__3_sodium_memcmp’:
lib/sodium_stubs.c:21:4: error: ignoring return value of ‘sodium_memcmp’, declared with attribute warn_unused_result [-Werror=unused-result]
    sodium_memcmp(x13, x14, x15);
    ^
cc1: all warnings being treated as errors
Command exited with code 2.

The whole output could be found here

Simple searching suggests that it's caused by the -Werror option, but I'm not sure where and how to work around this.

FWIW, I want to use ocaml-macaroons in one of my web apps, and ocaml-sodium is its depopts.

@dsheets
Copy link
Owner

dsheets commented Feb 14, 2017

What version of ocaml-sodium are you using? Could you try the master branch? The library needs to have another release made but it has been stalled on #40 for a number of reasons. I can make a new release soon if this is causing you issues. Sorry about that. Please let me know if the build succeeds with master. Thanks!

@sevenEng
Copy link
Author

Hey, thanks for responding. I always tried with the verison 0.5.0.

A quick try using the following conf on the master branch still doesn't work:

Ubuntu 16.04 / OCaml 4.04.0 / opam 1.2.2 (docker container)

It fails with the same kind of error, but on different places, here is the .out build file dump

CTYPES_LIB_DIR=/home/opam/.opam/4.04.0/lib/ctypes OCAML_LIB_DIR=/home/opam/.opam/4.04.0/lib/ocaml ocamlbuild -use-ocamlfind -classic-display lib/sodium.cma lib/sodium.cmxa lib/sodium.cmxs
ocamlfind ocamlopt unix.cmxa -I /home/opam/.opam/4.04.0/lib/ocamlbuild /home/opam/.opam/4.04.0/lib/ocamlbuild/ocamlbuildlib.cmxa -linkpkg myocamlbuild.ml /home/opam/.opam/4.04.0/lib/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
ocamlfind ocamldep -package ctypes.stubs -modules lib_gen/sodium_bindgen.ml > lib_gen/sodium_bindgen.ml.depends
ocamlfind ocamldep -package ctypes.stubs -modules lib_gen/sodium_bindings.ml > lib_gen/sodium_bindings.ml.depends
ocamlfind ocamldep -package bytes -package bigarray -package ctypes.stubs -modules lib/sodium_storage.ml > lib/sodium_storage.ml.depends
ocamlfind ocamldep -package ctypes.stubs -modules lib_gen/sodium_types.ml > lib_gen/sodium_types.ml.depends
ocamlfind ocamldep -package ctypes.stubs -modules lib_gen/sodium_typegen.ml > lib_gen/sodium_typegen.ml.depends
ocamlfind ocamlc -c -bin-annot -safe-string -package ctypes.stubs -w @5@8@10@11@12@14@23@24@26@29 -I lib_gen -I lib -o lib_gen/sodium_types.cmo lib_gen/sodium_types.ml
ocamlfind ocamlc -c -bin-annot -safe-string -package ctypes.stubs -w @5@8@10@11@12@14@23@24@26@29 -I lib_gen -I lib -o lib_gen/sodium_typegen.cmo lib_gen/sodium_typegen.ml
ocamlfind ocamlc -linkpkg -package ctypes.stubs lib_gen/sodium_types.cmo lib_gen/sodium_typegen.cmo -o lib_gen/sodium_typegen.byte
lib_gen/sodium_typegen.byte
cc -I /home/opam/.opam/4.04.0/lib/ctypes -I /home/opam/.opam/4.04.0/lib/ocaml -o lib_gen/sodium_types_detect lib_gen/sodium_types_detect.c
lib_gen/sodium_types_detect > lib/sodium_types_detected.ml
ocamlfind ocamldep -package bytes -package bigarray -package ctypes.stubs -modules lib/sodium_types_detected.ml > lib/sodium_types_detected.ml.depends
ocamlfind ocamlc -c -bin-annot -safe-string -package bytes -package bigarray -package ctypes.stubs -w @5@8@10@11@12@14@23@24@26@29 -I lib -o lib/sodium_storage.cmo lib/sodium_storage.ml
ocamlfind ocamlc -c -bin-annot -safe-string -package bytes -package bigarray -package ctypes.stubs -w @5@8@10@11@12@14@23@24@26@29 -I lib -o lib/sodium_types_detected.cmo lib/sodium_types_detected.ml
ocamlfind ocamlc -c -bin-annot -safe-string -package ctypes.stubs -w @5@8@10@11@12@14@23@24@26@29 -I lib_gen -I lib -o lib_gen/sodium_bindings.cmo lib_gen/sodium_bindings.ml
ocamlfind ocamlc -c -bin-annot -safe-string -package ctypes.stubs -w @5@8@10@11@12@14@23@24@26@29 -I lib_gen -I lib -o lib_gen/sodium_bindgen.cmo lib_gen/sodium_bindgen.ml
ocamlfind ocamlc -linkpkg -package ctypes.stubs lib/sodium_storage.cmo lib/sodium_types_detected.cmo lib_gen/sodium_types.cmo lib_gen/sodium_bindings.cmo lib_gen/sodium_bindgen.cmo -o lib_gen/sodium_bindgen.byte
lib_gen/sodium_bindgen.byte
ocamlfind ocamlc -ccopt -I/usr/local/include -I /home/opam/.opam/4.04.0/lib/ctypes -ccopt '--std=c99 -Wall -pedantic -Werror -Wno-pointer-sign' -c lib/sodium_stubs.c
+ ocamlfind ocamlc -ccopt -I/usr/local/include -I /home/opam/.opam/4.04.0/lib/ctypes -ccopt '--std=c99 -Wall -pedantic -Werror -Wno-pointer-sign' -c lib/sodium_stubs.c
lib/sodium_stubs.c: In function 'caml__29_crypto_pwhash_argon2i_saltbytes':
lib/sodium_stubs.c:181:18: error: implicit declaration of function 'crypto_pwhash_argon2i_saltbytes' [-Werror=implicit-function-declaration]
    size_t x110 = crypto_pwhash_argon2i_saltbytes();
                  ^
lib/sodium_stubs.c: In function 'caml__30_crypto_pwhash_argon2i_strbytes':
lib/sodium_stubs.c:186:18: error: implicit declaration of function 'crypto_pwhash_argon2i_strbytes' [-Werror=implicit-function-declaration]
    size_t x112 = crypto_pwhash_argon2i_strbytes();
                  ^
lib/sodium_stubs.c: In function 'caml__31_crypto_pwhash_argon2i_memlimit_interactive':
lib/sodium_stubs.c:191:18: error: implicit declaration of function 'crypto_pwhash_argon2i_memlimit_interactive' [-Werror=implicit-function-declaration]
    size_t x114 = crypto_pwhash_argon2i_memlimit_interactive();
                  ^
lib/sodium_stubs.c: In function 'caml__32_crypto_pwhash_argon2i_memlimit_moderate':
lib/sodium_stubs.c:196:18: error: implicit declaration of function 'crypto_pwhash_argon2i_memlimit_moderate' [-Werror=implicit-function-declaration]
    size_t x116 = crypto_pwhash_argon2i_memlimit_moderate();
                  ^
lib/sodium_stubs.c: In function 'caml__33_crypto_pwhash_argon2i_memlimit_sensitive':
lib/sodium_stubs.c:201:18: error: implicit declaration of function 'crypto_pwhash_argon2i_memlimit_sensitive' [-Werror=implicit-function-declaration]
    size_t x118 = crypto_pwhash_argon2i_memlimit_sensitive();
                  ^
lib/sodium_stubs.c: In function 'caml__34_crypto_pwhash_argon2i_opslimit_interactive':
lib/sodium_stubs.c:206:15: error: implicit declaration of function 'crypto_pwhash_argon2i_opslimit_interactive' [-Werror=implicit-function-declaration]
    int x120 = crypto_pwhash_argon2i_opslimit_interactive();
               ^
lib/sodium_stubs.c: In function 'caml__35_crypto_pwhash_argon2i_opslimit_moderate':
lib/sodium_stubs.c:211:15: error: implicit declaration of function 'crypto_pwhash_argon2i_opslimit_moderate' [-Werror=implicit-function-declaration]
    int x122 = crypto_pwhash_argon2i_opslimit_moderate();
               ^
lib/sodium_stubs.c: In function 'caml__36_crypto_pwhash_argon2i_opslimit_sensitive':
lib/sodium_stubs.c:216:15: error: implicit declaration of function 'crypto_pwhash_argon2i_opslimit_sensitive' [-Werror=implicit-function-declaration]
    int x124 = crypto_pwhash_argon2i_opslimit_sensitive();
               ^
lib/sodium_stubs.c: In function 'caml__37_crypto_pwhash_argon2i_alg_argon2i13':
lib/sodium_stubs.c:221:15: error: implicit declaration of function 'crypto_pwhash_argon2i_alg_argon2i13' [-Werror=implicit-function-declaration]
    int x126 = crypto_pwhash_argon2i_alg_argon2i13();
               ^
lib/sodium_stubs.c: In function 'caml__38_crypto_pwhash_argon2i':
lib/sodium_stubs.c:237:4: error: implicit declaration of function 'crypto_pwhash_argon2i' [-Werror=implicit-function-declaration]
    crypto_pwhash_argon2i(x135, x136, x139, x140, x143, x144, x147, x150);
    ^
lib/sodium_stubs.c: In function 'caml__74_crypto_pwhash_argon2i_str':
lib/sodium_stubs.c:646:15: error: implicit declaration of function 'crypto_pwhash_argon2i_str' [-Werror=implicit-function-declaration]
    int x490 = crypto_pwhash_argon2i_str(x479, x480, x481, x484, x487);
               ^
lib/sodium_stubs.c: In function 'caml__75_crypto_pwhash_argon2i_str_verify':
lib/sodium_stubs.c:655:15: error: implicit declaration of function 'crypto_pwhash_argon2i_str_verify' [-Werror=implicit-function-declaration]
    int x499 = crypto_pwhash_argon2i_str_verify(x494, x495, x496);
               ^
cc1: all warnings being treated as errors
Command exited with code 2.
Makefile:13: recipe for target 'all' failed

@dsheets
Copy link
Owner

dsheets commented Feb 14, 2017

This is good! You are now receiving errors because the version of libsodium you have installed is too old for @klakplok's shiny new Argon2i password hash bindings. You need to have libsodium >=1.0.9.

@sevenEng
Copy link
Author

sevenEng commented Feb 15, 2017

Yep, it worked with a newer version of libsodium! Thanks for the help! 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants