Search code examples
emacsocamlopamutop

utop error: No such package: sexplib.syntax - required by `core.syntax'


I'm trying to set up an emacs ocaml environment following the Real World Ocaml instructions here, but when I start utop I get the error:

No such package: sexplib.syntax - required by `core.syntax'

If I run: ocamlfind list | grep sexp from the command-line I get :

ppx_sexp_conv       (version: 113.24.00)
ppx_sexp_conv.expander (version: 113.24.00)
ppx_sexp_conv.expander.for_ppx_deriving (version: n/a)
ppx_sexp_message    (version: 113.24.00)
ppx_sexp_value      (version: 113.24.00)
sexplib             (version: 113.24.00)
sexplib.num         (version: 113.24.00)
sexplib.unix        (version: 113.24.00)

which to my novice eyes suggests that sexplib.syntax doesn't exist.

Does anyone know how to fix this ?


Solution

  • I suspect that this is a bug, induced by a recent transition of the core suite from camlp4 to ppx. It should be fixed in 113.24.01, so make sure that you have

     opam update
     opam upgrade
    

    and then install the latest version:

     opam install core.113.24.01
    

    If this doesn't help, then the other option, would be to fallback to an older version, before the transition, something like

     opam install core.113.00.00
    

    In order to prevent automatic upgrade of the library, you can pin it:

     opam pin add core 113.00.00