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

Question about linking actual rewriter with ocamlbuild #20

Closed
Kakadu opened this issue Apr 23, 2018 · 3 comments
Closed

Question about linking actual rewriter with ocamlbuild #20

Kakadu opened this issue Apr 23, 2018 · 3 comments

Comments

@Kakadu
Copy link
Contributor

Kakadu commented Apr 23, 2018

There is a command to build custom rewriter using ocamlfind but I currently have some troubles making things work

The problem is that current approach relies on the fact that ppx plugin is built as findlib library. And if I'm developing syntax extension in my project and want to run some tests than I need to compile syntax extension and after that compile tests with adjusted OCAMLPATH variable. I tried to pass cmxa manually and remove dependency on findlib package but it seems that the order of cmxa's matters and only way to do every all right is to reference PPX package. With this approach there is also an issue with dependencies: tests should be recompiled when the package changes and this currently doesn't work as I want.

Can you give me a piece of advice without recommending switching to dune?

P.S. This is a question mentioned in #18

@ghost
Copy link

ghost commented Apr 23, 2018

You can try replacing -package ppxlib.runner by my-rewriter.cmxa runner.cmx where runner.ml contains:

Ppxlib.Driver.standalone ()

then things should be linked in the right order

@Kakadu
Copy link
Contributor Author

Kakadu commented Apr 24, 2018

@diml It is very helpful. Do you think about adding it to the README?

@ghost
Copy link

ghost commented Apr 24, 2018

that seems fine to me. Would you mind writing a PR? :)

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

1 participant