Skip to content

Commit

Permalink
Use backslashes when passing staged pps driver on Windows
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolás Ojeda Bär <n.oje.bar@gmail.com>
  • Loading branch information
nojb committed Sep 1, 2024
1 parent c82db6a commit 150354b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/dune_rules/pp_spec_rules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,16 @@ let pp_one_module
~dir:(Super_context.context sctx |> Context.build_dir |> Path.build)
(S [ Dep (Path.build exe); As driver_flags; As flags ]))
in
let args =
match args with
| exe :: args when Sys.win32 ->
(* On Windows, [exe] is executed by the compiler using
[Sys.command], ie [cmd.exe]. Thus, its path must contain
backslashes only, as forward slashes are used to introduce
options, eg "dir/?". *)
String.concat ~sep:"\\" (String.split_on_char ~sep:'/' exe) :: args
| _ -> args
in
[ "-ppx"; String.quote_list_for_shell args ]
in
let pp =
Expand Down

0 comments on commit 150354b

Please sign in to comment.