Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opam package is broken #1

Closed
Drup opened this issue Jan 6, 2016 · 7 comments
Closed

Opam package is broken #1

Drup opened this issue Jan 6, 2016 · 7 comments

Comments

@Drup
Copy link

Drup commented Jan 6, 2016

#require "ppx_core";;
module P = Ppx_core ;;
Error: Reference to undefined global `Ppx_core'

Same deal for compilation, obviously. I don't even understand how your other packages are compiling. :|

@ghost
Copy link

ghost commented Jan 6, 2016

It's related to janestreet/ppx_sexp_conv#1. Because ppx_sexp_conv and other deriving plugins depends on ppx_core, ppx_core must have a META that works well with ppx_deriving. That means that ppx_core doesn't behave as a normal library by default...

It will be simpler when ppx_deriving uses ocamlfind directly.

Currently one workaround is to do this:

#predicates "ppx_driver";;
#require "ppx_core";;

However that also means that packages like ppx_sexp_conv will behave as libraries...

#predicates "ppx_driver";;
#require "ppx_sexp_conv";;
# module P = Ppx_sexp_conv;;
module P = Ppx_sexp_conv
# type t = int [@@deriving sexp];;
Cannot locate deriver sexp

@Drup
Copy link
Author

Drup commented Jan 6, 2016

Couldn't you have two ocamlfind packages, one deriving-like and one library-like ?

Also, what do I have to put in my _tags to make the whole thing working ?

@ghost
Copy link

ghost commented Jan 6, 2016

Couldn't you have two ocamlfind packages, one deriving-like and one library-like ?

I'll try to sort something out for the next release

Also, what do I have to put in my _tags to make the whole thing working ?

If you mean "what is the equivalent of #predicates "ppx_driver";;", it is:

<**/*.ml{,i}>: predicate(ppx_driver)

@Drup
Copy link
Author

Drup commented Jan 6, 2016

Ok, thanks!

@Drup
Copy link
Author

Drup commented Mar 2, 2016

FYI, I forgot to answer but the right line is:

<*/*.{native,byte}>: predicate(ppx_driver)

This bug is horrible for newcomers, by the way. If you don't solve it, you should at least document it explicitly.

j0sh added a commit to j0sh/ocaml-sqlexpr that referenced this issue Mar 3, 2016
The '-predicates' flag is necessary due to the issue here:
janestreet-deprecated/ppx_core#1

While the recommended fix is to edit the local _tags file, that
introduces a hard dependency on OCaml >= 4.02 due to some changes
in the ocamlbuild _tags syntax. To maintain compatibility with older
OCaml versions, specify the -predicates build flag as done here.
j0sh added a commit to j0sh/ocaml-sqlexpr that referenced this issue Mar 3, 2016
The '-predicates' flag is necessary due to the issue here:
janestreet-deprecated/ppx_core#1

While the recommended fix is to edit the local _tags file, that
introduces a hard dependency on OCaml >= 4.02 due to some changes
in the ocamlbuild _tags syntax. To maintain compatibility with older
OCaml versions, specify the -predicates build flag as done here.
@ghost
Copy link

ghost commented Mar 3, 2016

Is the problem still present with the 113.24 release? I changed things so that ppx_deriving plugins depends on ppx_core.for-ppx-deriving...

@mshinwell
Copy link

No comment back from the reporter, so assuming fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants