`preprocess` `per_module` dependencies are not relative
Nobody has claimed this yet.
- Dominant language
- OCaml
- Stars
- 1.9k
- Forks
- 500
- Avg merge
- 15h 21m
- Merged PRs (30d)
- 277
Description
Expected Behavior
When using preprocess the binary in an run action should be part of
(library
...
(preprocess (per_module
((action (run ./gen/gen.exe %{input-file})) myModule))))
Should depend on ./gen/gen.exe and build myModule.
Actual Behavior
Preprocessing with ./gen/gen.exe in rule but in preprocess stanzas, it can't find the rule to build gen.exe because it expects ./gen/gen.exe live relative to the workspace and not relative to the dune file that contains the preprocess stanza:
$ dune build
File "src/.merlin-conf/_unknown_", line 1, characters 0-0:
Error: No rule found for gen/gen.exe
[1]
Reproduction
- PR with a reproducing test: https://github.com/ocaml/dune/pull/7463
Specifications
- Version of
dune(output ofdune --version): currentmain - Version of
ocaml(output ofocamlc --version): 4.14.1 - Operating system (distribution and version): Fedora GNU/Linux
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reproducing test in PR #7463 and the Dune contributor guidance in doc/hacking.rst. Reproduce the preprocess/per_module case on current main, then trace how ./gen/gen.exe is resolved relative to the Dune file; done means the dependency is found and myModule builds successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ocaml
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100