This commit is contained in:
swrup 2025-11-11 02:07:51 +01:00
parent aa2ff7b2f0
commit 2f3113f55d
11742 changed files with 1223940 additions and 0 deletions

View file

@ -0,0 +1,38 @@
Repro for #8158: we set up a ppx rewriter (that does nothing) in ppx/ and an
executable that uses as staged_pps it in bin/.
This test ensures that path expansion is done relatively to the right
directory.
$ cat > dune-project << EOF
> (lang dune 1.1)
> EOF
$ mkdir ppx
$ cat > ppx/dune << EOF
> (library
> (name ppx_noop)
> (kind ppx_rewriter)
> (ppx.driver (main Ppx_noop.main)))
> EOF
$ cat > ppx/ppx_noop.ml << EOF
> let main () =
> match Sys.argv with
> | [| _; "--as-ppx"; input_file; output_file |] ->
> Filename.quote_command "cp" [input_file; output_file]
> |> Sys.command
> |> exit
> | _ -> assert false
> EOF
$ mkdir bin
$ cat > bin/dune << EOF
> (executable
> (name e)
> (preprocess
> (staged_pps ppx_noop)))
> EOF
$ touch bin/e.ml
This works:
$ dune exec bin/e.exe