akabe / docker-iocaml-datascience

Dockerfile of Jupyter (IPython notebook) and IOCaml (OCaml kernel) with libraries for data science and machine learning
MIT License
28 stars 3 forks source link

cohttp.async cannot load due to async_ssl #16

Open akabe opened 7 years ago

akabe commented 7 years ago

#require "cohttp.async" fails during loading async_ssl as follows:

/home/opam/.opam/4.04.1/lib/async_ssl/bindings: added to search path
/home/opam/.opam/4.04.1/lib/async_ssl/bindings/async_ssl_bindings.cma: loaded
/home/opam/.opam/4.04.1/lib/async_ssl: added to search path
/home/opam/.opam/4.04.1/lib/async_ssl/async_ssl.cma: loaded
Cannot load required shared library dllasync_ssl_stubs.
Reason: /home/opam/.opam/4.04.1/lib/stublibs/dllasync_ssl_stubs.so: /home/opam/.opam/4.04.1/lib/stublibs/dllasync_ssl_stubs.so: undefined symbol: ASN1_STRING_length.
/home/opam/.opam/4.04.1/lib/ipaddr/unix: added to search path
/home/opam/.opam/4.04.1/lib/ipaddr/unix/ipaddr_unix.cma: loaded
/home/opam/.opam/4.04.1/lib/conduit/conduit-async.cma: loaded
Characters -1--1:
  #require "cohttp.async";;

Error: Reference to undefined global `Async_ssl__Ssl'

Package async_ssl.bindings solves this problem, but I don't know how to load it from cohttp.async.

Test code

#thread;;
#require "cohttp.async" ;;

let main_async () =
  let open Async.Std in
  let open Cohttp in
  let open Cohttp_async in
  Client.get (Uri.of_string "https://example.com/") >>= fun (resp, body) ->
  Body.to_string body >>| fun body ->
  assert(Response.status resp = `OK) ;
  printf "%s@." body
;;

let () = Async.Std.Thread_safe.block_on_async_exn main_async ;;