mirleft / ocaml-nocrypto

OCaml cryptographic library
ISC License
111 stars 53 forks source link

Values do not match: val hash_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> hash is not included in val hash_of_sexp : Sexplib.Sexp.t -> hash #156

Open XVilka opened 5 years ago

XVilka commented 5 years ago

Building nocrypto at Alpine Edge docker container, got this error:

ERROR] The compilation of nocrypto failed at "/home/user/.opam/default/bin/ocaml pkg/pkg.ml build --pinned false --tests false --jobs 1 --with-lwt true --xen false --freestanding false".

#=== ERROR while compiling nocrypto.0.5.4-1 ===================================#
# context              2.0.3 | linux/x86_64 | ocaml-system.4.07.1 | https://opam.ocaml.org#e143b0a1
# path                 ~/.opam/default/.opam-switch/build/nocrypto.0.5.4-1
# command              ~/.opam/default/bin/ocaml pkg/pkg.ml build --pinned false --tests false --jobs 1 --with-lwt true --xen false --freestanding false
# exit-code            1
# env-file             ~/.opam/log/nocrypto-1-f44153.env
# output-file          ~/.opam/log/nocrypto-1-f44153.out
### output ###
# pkg.ml: [ERROR] cmd ['ocamlbuild' '-use-ocamlfind' '-classic-display' '-tag' 'debug'
# [...]
#      'accelerate' 'opam' 'pkg/META' 'CHANGES.md' 'LICENSE.md' 'README.md'
#      'src/dllnocrypto_stubs.so' 'src/libnocrypto_stubs.a' 'src/nocrypto.a'
#      'src/nocrypto.cmxs' 'src/nocrypto.cmxa' 'src/nocrypto.cma'
#      'src/nocrypto.cmx' 'src/nocrypto.cmi' 'src/nocrypto.mli'
#      'unix/nocrypto_unix.a' 'unix/nocrypto_unix.cmxs'
#      'unix/nocrypto_unix.cmxa' 'unix/nocrypto_unix.cma'
#      'unix/nocrypto_entropy_unix.cmx' 'unix/nocrypto_entropy_unix.cmi'
#      'unix/nocrypto_entropy_unix.mli' 'lwt/nocrypto_lwt.a'
#      'lwt/nocrypto_lwt.cmxs' 'lwt/nocrypto_lwt.cmxa' 'lwt/nocrypto_lwt.cma'
#      'lwt/nocrypto_entropy_lwt.cmx' 'lwt/nocrypto_entropy_lwt.cmi'
#      'lwt/nocrypto_entropy_lwt.mli']: exited with 10

*.out file contents is:

ocamlfind ocamlopt -pack -g -bin-annot -package ppx_sexp_conv -package bytes -package cstruct -I src src/native.cmx src/uncommon.cmx src/base64.cmx src/hash.cmx src/cipher_stream.cmx src/ccm.cmx src/numeric.cmx src/gcm.cmx src/cipher_block.cmx src/fortuna.cmx src/hmac_drgb.cmx src/rng.cmx src/rsa.cmx src/dsa.cmx src/dh.cmx -o src/nocrypto.cmx
+ ocamlfind ocamlopt -pack -g -bin-annot -package ppx_sexp_conv -package bytes -package cstruct -I src src/native.cmx src/uncommon.cmx src/base64.cmx src/hash.cmx src/cipher_stream.cmx src/ccm.cmx src/numeric.cmx src/gcm.cmx src/cipher_block.cmx src/fortuna.cmx src/hmac_drgb.cmx src/rng.cmx src/rsa.cmx src/dsa.cmx src/dh.cmx -o src/nocrypto.cmx
File "src/nocrypto.cmx", line 1:
Error: The implementation (obtained by packing)
       does not match the interface src/nocrypto.mli:
       ...
       In module Hash:
       Values do not match:
         val hash_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> hash
       is not included in
         val hash_of_sexp : Sexplib.Sexp.t -> hash
       File "src/nocrypto.mli", line 217, characters 2-43:
         Expected declaration
       File "src/hash.ml", line 114, characters 0-86: Actual declaration
Command exited with code 2.
pkg.ml: [ERROR] cmd ['ocamlbuild' '-use-ocamlfind' '-classic-display' '-tag' 'debug'
     '-build-dir' '_build' '-plugin-tag' 'package(ocb-stubblr)' '-tag'
     'accelerate' 'opam' 'pkg/META' 'CHANGES.md' 'LICENSE.md' 'README.md'
     'src/dllnocrypto_stubs.so' 'src/libnocrypto_stubs.a' 'src/nocrypto.a'
     'src/nocrypto.cmxs' 'src/nocrypto.cmxa' 'src/nocrypto.cma'
     'src/nocrypto.cmx' 'src/nocrypto.cmi' 'src/nocrypto.mli'
     'unix/nocrypto_unix.a' 'unix/nocrypto_unix.cmxs'
     'unix/nocrypto_unix.cmxa' 'unix/nocrypto_unix.cma'
     'unix/nocrypto_entropy_unix.cmx' 'unix/nocrypto_entropy_unix.cmi'
     'unix/nocrypto_entropy_unix.mli' 'lwt/nocrypto_lwt.a'
     'lwt/nocrypto_lwt.cmxs' 'lwt/nocrypto_lwt.cmxa' 'lwt/nocrypto_lwt.cma'
     'lwt/nocrypto_entropy_lwt.cmx' 'lwt/nocrypto_entropy_lwt.cmi'
     'lwt/nocrypto_entropy_lwt.mli']: exited with 10
avsm commented 5 years ago

I'm looking into this. It smells a bit like a compiler bug in 4.07 to do with packing, since it's very hard to reproduce.

avsm commented 5 years ago

did you have cstruct.4.0.0 pinned while building this @XVilka ?

XVilka commented 5 years ago

@avsm indeed, I have Cstruct pinned to the git repo.