janestreet / ppx_sexp_conv

Generation of S-expression conversion functions from type definitions
MIT License
89 stars 17 forks source link

Crash on `#require "ppx_sexp_conv"` #7

Closed liweijian closed 8 years ago

liweijian commented 8 years ago

I just opam update and opam upgrade, here's the error

utop # #require "ppx_sexp_conv";;
File "", line 1, characters 0-4:                                                                                                                                            Error: Parse error: illegal begin of top_phrase                                                                                                                             Fatal error: exception Exit
Raised at file "bytes.ml", line 220, characters 25-34
$ 

The version of ppx_sexp_conv:

 opam info ppx_sexp_conv                                                                                                                              
             package: ppx_sexp_conv
             version: 113.09.00
          repository: default
        upstream-url: https://github.com/janestreet/ppx_sexp_conv/archive/113.09.00.tar.gz
       upstream-kind: http
   upstream-checksum: fb5c83972255f00e901bf42523d8837e
            homepage: https://github.com/janestreet/ppx_sexp_conv
         bug-reports: https://github.com/janestreet/ppx_sexp_conv/issues
            dev-repo: https://github.com/janestreet/ppx_sexp_conv.git
              author: Jane Street Group, LLC <opensource@janestreet.com>
             license: Apache-2.0
             depends: ocamlfind >= 1.3.2 & ppx_type_conv (>= 113.09.00 & < 113.10.00) & ppx_core (>= 113.09.00 & < 113.10.00) & ppx_deriving & ppx_tools & ppx_driver (>= 113.09.00 & < 113.10.00) & ocamlbuild
  installed-versions: 113.09.00 [4.02.3], 113.33.01+4.03 [4.03.0]
  available-versions: 113.09.00, 113.24.00, 113.33.00, 113.33.00+4.03, 113.33.01+4.03, 113.33.03
         description: Generation of S-expression conversion functions from type definitions
Part of the Jane Street's PPX rewriters collection.

OCaml version is: 4.02.3

trefis commented 8 years ago

Check your .ocamlinit, you must have something mentionning camlp4 in there which is not compatible with ppx.

liweijian commented 8 years ago

@trefis

$ cat ~/.ocamlinit                                                                                                                                     
#use "topfind";;
#thread;;

#require "core.top";;
#require "core.syntax";;
#require "core_bench";;

(* Added by OPAM. *)
let () =
  try Topdirs.dir_directory (Sys.getenv "OCAML_TOPLEVEL_PATH")
  with Not_found -> ()
;;

open Core.Std
open Core_bench.Std

Does there anything mention camlp4?

trefis commented 8 years ago

I believe core.syntax is camlp4-related. Try requiring ppx_jane instead?

liweijian commented 8 years ago

Great thanks, it works now:)