3

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 ?

ivg
  • 34,431
  • 2
  • 35
  • 63
BillyBadBoy
  • 552
  • 3
  • 18

3 Answers3

4

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
ivg
  • 34,431
  • 2
  • 35
  • 63
  • I keep having this issue even after update/upgrade: `ocamlfind list | grep sexplib` does not list sexplib.syntax – Marko Feb 19 '16 at 16:31
  • I tried installing core 113.00.00 first - maybe this is relevant? – BillyBadBoy Feb 19 '16 at 16:42
  • what version of core did you finally get? Did you pin it? – ivg Feb 19 '16 at 17:11
  • I pinned it, but later removed the pin (opam pin remove core), then did and update/upgrade. – BillyBadBoy Feb 19 '16 at 17:27
  • @BillyBadBoy: I tried installing core.113.00.00 first, then updating/upgrading. That left me with no core for an unmet dependency `core -> variantslib < 109.16.00`. I ended up switching back to the previous state. – Marko Feb 19 '16 at 17:52
  • So, finally, have you succeed? And if not, did you try to install the latest `core.113.24.01`? – ivg Feb 19 '16 at 17:57
  • @ivg: no success yet, but core.113.24.01 is installed and reported by `ocamlfind list | grep core` – Marko Feb 20 '16 at 15:01
2

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";;
dim
  • 31
  • 2
  • I have ppx_jane and sexplib installed but sitll could not make the following work `type t = { foo: int; bar: float } with sexp ;;` with core-0.9.1 – krokodil Jun 09 '17 at 00:42
1

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

AltGr
  • 331
  • 2
  • 4