BillyBadBoy
BillyBadBoy

Reputation: 580

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 ?

Upvotes: 3

Views: 745

Answers (3)

AltGr
AltGr

Reputation: 381

An aspect that hasn't been mentionned above is that installing the opam package sexplib is not enough to get the findlib sexplib.syntax, even with version 113.00.00 or earlier: be sure to also install opam package type_conv

Upvotes: 1

dim
dim

Reputation: 31

core.syntax is no longer supported starting from the 113.24.00 release. I did a minor release of core (113.24.02) to make it effective.

You should now use ppx_jane. It is the equivalent of core.syntax for Jane Street ppx rewriters. The Real World OCaml instructions have been updated.

You can use ppx_jane either as a regular findlib package or directly:

(* Regular findlib package *)
# #require "ppx_jane";;
(* Directly *)
# #ppx "ppx-jane -as-ppx";;

Upvotes: 2

ivg
ivg

Reputation: 35280

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

Upvotes: 4

Related Questions