wrong call to --ppx flags (slash issue)
Nobody has claimed this yet.
- Dominant language
- OCaml
- Stars
- 1.9k
- Forks
- 500
- Avg merge
- 15h 21m
- Merged PRs (30d)
- 277
Description
Expected Behavior
We should be able to execute test of ppx_import
Actual Behavior
We can't compile test
Reproduction
- PR with a reproducing test: not yet
- clone
- dune runtest
Specifications
- Version of
dune(output ofdune --version): https://github.com/ocaml/dune/commit/ef1ee9a0d175bb076d0debf917f7c67a3939af6a - Version of
ocaml(output ofocamlc --version): 4.13 - Operating system (distribution and version): windows
Additional information
I tried to debug:
This line seem the culprit https://github.com/ocaml/dune/blob/78fa5d22c3cc09345bfe3eb25fb57e0cd7e3c4bc/src/dune_rules/preprocessing.ml#L293
The command is: ocamldep.opt.exe -modules -ppx ".ppx/57e0400f3b219ff4fc65d1fbd820e35d/ppx.exe --as-ppx" -impl src_test/ppx_deriving_sexp/test_ppx_deriving_sexp.ml
Since -ppx go through Sys.command. So we need to not normalize:
ocamldep.opt.exe -modules -ppx ".ppx\57e0400f3b219ff4fc65d1fbd820e35d\ppx.exe --as-ppx" -impl src_test/ppx_deriving_sexp/test_ppx_deriving_sexp.ml work as intended.
I tried to replace with: Path.Build.L.relative build_dir (".ppx" :: key :: "ppx.exe" :: []) but Path module seem to like normalized path /:
https://github.com/ocaml/dune/blob/ef1ee9a0d175bb076d0debf917f7c67a3939af6a/otherlibs/stdune/path.ml#L253
Have you any pointer to continue ?
- Link to gist with verbose output (run
dunewith the--verboseflag):
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 src/dune_rules/preprocessing.ml around line 293 and compare its path handling with otherlibs/stdune/path.ml around line 253. Run dune runtest for the ppx_import reproduction on Windows and inspect the generated ocamldep command. Done means the ppx test compiles and the command uses a Windows-compatible path without breaking other platforms.
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