mirleft / ocaml-x509

X509 (RFC5280) handling in OCaml
BSD 2-Clause "Simplified" License
52 stars 33 forks source link

Incompatible with sexplib/ppx_sexp_conv v0.11.0 #105

Closed copy closed 6 years ago

copy commented 6 years ago

Related to https://github.com/mirleft/ocaml-nocrypto/issues/143. After pinning nocrypto to git+https://github.com/gasche/ocaml-nocrypto.git#master-ocamlbuild-pack it is possible to install nocrypto and sexplib=v0.11.0 (currently they're marked as conflicting). However, x509 has the same problem and fails to build. In order to reproduce you need to apply the aforementioned pin and upgrade sexplib.

File "lib/x509.ml", line 1:
Error: The implementation lib/x509.ml
       does not match the interface lib/x509.cmi:
       ...
       In module Validation:
       Values do not match:
         val ca_error_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> ca_error
       is not included in
         val ca_error_of_sexp : Sexplib.Sexp.t -> ca_error
       File "lib/x509.mli", line 510, characters 2-51: Expected declaration
       File "lib/x509_certificate.ml", line 340, characters 2-223:
         Actual declaration
Command exited with code 2.
pkg.ml: [ERROR] cmd ['ocamlbuild' '-use-ocamlfind' '-classic-display' '-j' '4' '-tag' 'debug'
     '-build-dir' '_build' 'opam' 'pkg/META' 'CHANGES.md' 'LICENSE.md'
     'README.md' 'lib/x509.a' 'lib/x509.cmxs' 'lib/x509.cmxa' 'lib/x509.cma'
     'lib/x509_crl_types.cmx' 'lib/x509_crl.cmx' 'lib/x509_ca.cmx'
     'lib/x509_pem.cmx' 'lib/x509_encoding.cmx' 'lib/x509_authenticator.cmx'
     'lib/x509_extension.cmx' 'lib/x509_request_types.cmx'
     'lib/x509_extension_types.cmx' 'lib/x509_types.cmx'
     'lib/x509_certificate.cmx' 'lib/asn_grammars.cmx' 'lib/registry.cmx'
     'lib/x509_common.cmx' 'lib/x509.cmx' 'lib/x509.cmi' 'lib/x509.mli']: exited with 10

cc @gasche

Related PR on nocrypto: https://github.com/mirleft/ocaml-nocrypto/pull/144

gasche commented 6 years ago

There are two important components to the nocrypto fix:

Maybe you could try reproducing these fixes for x509, to see if you can fix the build. If you can't, I can give it a try.

copy commented 6 years ago

I'm trying to fix the second problem by adding ppx_sexp_conv to _tags here. This works for building the library, but building the tests still fails:

Error: No implementations provided for the following modules:
         Ppx_sexp_conv_lib referenced from /home/fabian/.opam2/4.06.1/lib/nocrypto/nocrypto.cmxa(Nocrypto)
Command exited with code 2.
pkg.ml: [ERROR] cmd ['ocamlbuild' '-use-ocamlfind' '-classic-display' '-j' '4' '-tag' 'debug'
     '-build-dir' '_build' 'opam' 'pkg/META' 'CHANGES.md' 'LICENSE.md'
     'README.md' 'lib/x509.a' 'lib/x509.cmxs' 'lib/x509.cmxa' 'lib/x509.cma'
     'lib/x509_crl_types.cmx' 'lib/x509_crl.cmx' 'lib/x509_ca.cmx'
     'lib/x509_pem.cmx' 'lib/x509_encoding.cmx' 'lib/x509_authenticator.cmx'
     'lib/x509_extension.cmx' 'lib/x509_request_types.cmx'
     'lib/x509_extension_types.cmx' 'lib/x509_types.cmx'
     'lib/x509_certificate.cmx' 'lib/asn_grammars.cmx' 'lib/registry.cmx'
     'lib/x509_common.cmx' 'lib/x509.cmx' 'lib/x509.cmi' 'lib/x509.mli'
     'tests/unittestrunner.native']: exited with 10

My ocamlbuild knowledge isn't sufficient to fix this problem. Any idea?

gasche commented 6 years ago

I would just add ppx_sexp_conv to the package tag of the <tests/.*> selector -- there is a similar change in https://github.com/mirleft/ocaml-nocrypto/pull/144/commits/a9da8a8883e05460dc98ad8dd616aad46bb82741.

copy commented 6 years ago

I would just add ppx_sexp_conv to the package tag of the <tests/.*> selector -- there is a similar change in mirleft/ocaml-nocrypto@a9da8a8.

This didn't help; I already added it to the true: section anyway.

gasche commented 6 years ago

I just tried on my machine and could build ocaml.x509's master branch with sexplib and ppx_sexp_conv at v0.11.0 just fine. (The tests build and run correctly).

copy commented 6 years ago

Indeed, it looks like a spurious issue in my switch. I'll reopen if the issue comes up again. Sorry about the noise!