Quantcast
Channel: OCaml - Topics tagged dune
Viewing all articles
Browse latest Browse all 521

Generating files from ppx with dune

$
0
0

I’m attempting to develop a ppx that consumes code in an extension point (i.e. [%txt "foobar"]) and puts a result in a file somewhere.

I’ve written the ppx part which seems to work fine, but I’m trying to figure out if there’s a way to write a dune rule to depend on the generated file from the ppx. So far I’ve tried writing something like

(rule
  (deps my_file.pp.ml)
  (targets my_file.txt)
  (action (run true)))

among other deps (such as my_file.exe, my_file.ml) but dune seems to always say

Error: Rule failed to generate the following targets:
  src/my_file.txt

I’m wondering if this is something that I’m messing up (i.e. putting my_file.txt in the wrong place), or if this isn’t generally supported with dune.

Any help is greatly appreciated!

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 521

Trending Articles