When users specify multiple global ppx transformations via preprocessors in a dune file, the order they apply is alphabetically by library name and described like this on the ppxlib documentation https://ocaml-ppx.github.io/ppxlib/ppxlib/driver.html#global-transfo-phase (Thanks for the ref @sim642)
This is problematic because ppx ordering is semantically significant: the output of one ppx often serves as input to another, and many ppxes don't commute. Using the name as a order is problematic since users can't change it (and they make authors responsible for the ppx name)
Current Behavior
Given this dune file:
(library
(name mylib)
(preprocess (pps ppx_jane ppx_deriving ppx_blob)))
Expected: ppxes are applied in the order written: ppx_jane → ppx_deriving → ppx_blob
Actual: Dune sorts them alphabetically and applies them as: ppx_blob → ppx_deriving → ppx_jane
Cross-reference: ocaml/dune#13551
When users specify multiple global ppx transformations via preprocessors in a
dunefile, the order they apply is alphabetically by library name and described like this on the ppxlib documentation https://ocaml-ppx.github.io/ppxlib/ppxlib/driver.html#global-transfo-phase (Thanks for the ref @sim642)This is problematic because ppx ordering is semantically significant: the output of one ppx often serves as input to another, and many ppxes don't commute. Using the name as a order is problematic since users can't change it (and they make authors responsible for the ppx name)
Current Behavior
Given this
dunefile:Expected: ppxes are applied in the order written:
ppx_jane→ppx_deriving→ppx_blobActual: Dune sorts them alphabetically and applies them as:
ppx_blob→ppx_deriving→ppx_janeCross-reference: ocaml/dune#13551