Jbuilder support for lwt.ppx?

Is there a way to preprocess with lwt.ppx in jbuilder? If not, what needs to happen for it to be supported?

1 Like

I answered on the Lwt repo first. For readers here:

Yes, but for now you have to pin [Lwt] master. IIRC:

opam pin add --dev-repo lwt

Here is an example jbuild for using the PPX:

(jbuild_version 1)

(executable
 ((name hello_world)
  (libraries (lwt.unix))
  (preprocess
   (pps (lwt.ppx)))))

We plan to publish the jbuilder-based Lwt in OPAM in the next release, 3.1.0, ETA mid-late July.

Let me know if you have any trouble.

Thanks to @andrewray for the build system port.

1 Like

Thanks for the answer!

jbuilder-based LWT is not in OPAM yet it seems. Any workarounds?

From what I see, 3.1 is published and the source includes lwt.ppx with ocaml-migrate-parsetree support.

1 Like

Indeed, Lwt 3.1.0 (about 1.5 months ago) is the first release with Jbuilder support. I believe it works as expected for a Jbuilder project. We also have tests that the Jbuilder packaging is correct.

Sorry, it was false alarm. It works nicely after all.

1 Like