Skip to content

[windows] staged_pps passes incorrect path separator to cmd.exe #10867

@ejgallego

Description

@ejgallego

I am trying to build some of my packages with native Windows opam switches as created by opam 2.2.

Things work mostly fine, except for my projects using staged_pps:

$ (cd _build/default && C:\Users\User\AppData\Local\opam\default\bin\ocamldep.opt.exe -modules -ppx ".ppx/1f4626a10100bf9c3a282e83fe079d93/ppx.exe --as-ppx --cookie \"library-name=\\\"serlib_funind\\\"\"" -impl serlib/plugins/funind/ser_g_indfun.ml) > _build/default/serlib/plugins/funind/.serlib_funind.objs/serlib_funind__Ser_g_indfun.impl.d
> '.ppx' is not recognized as an internal or external command,
> operable program or batch file.
> File "serlib/plugins/funind/ser_g_indfun.ml", line 1:
> Error: Error while running external preprocessor
> Command line: .ppx/1f4626a10100bf9c3a282e83fe079d93/ppx.exe --as-ppx --cookie "library-name=\"serlib_funind\"" "C:\Users\User\AppData\Local\Temp\build_17b787_dune\camlppx7ef3dd" "C:\Users\User\AppData\Local\Temp\build_17b787_dune\camlppx361290"

As identified by @nojb , the problem seems to stem from the use of .ppx/1f4626a10100bf9c3a282e83fe079d93/ppx.exe as the executable name, cmd.exe will handle this as .ppx /option1 /option2 leading to the error message.

Using .ppx\1f4626a10100bf9c3a282e83fe079d93\ppx.exe as the path seems to work (famous last words).

(*) I couldn't try a dune patch to confirm changing that would solve the issue due to other opam 2.2 + windows problems, in particular with pinning of git repos.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions