Open jonahbeckford opened 6 months ago
Thanks for the report. We should indeed fix this. I wonder if there's a way to do this purely in sh (or at least bash). Would be unfortunate to spin up sed just for this.
I wonder if there's a way to do this purely in sh (or at least bash).
${ocamlc_where//:/%.}
should work in bash.
For now, I'm just filing an issue even though I document the solution below. I'm in the middle of too many open PRs.
Expected Behavior
opam exec -- dune build "@merlin-from-subdir"
should succeed.Root Cause
I came across this testing out a new feature patch to Dune.
Consider https://github.com/ocaml/dune/blob/a2a13a7e63b158fad52b2db373ee96fde550e9e5/test/blackbox-tests/test-cases/merlin/merlin-from-subdir.t/run.t#L1-L2
Now
ocamlc -where
on native Windows will always have a colon. Here is mine:C:\Users\beckf\AppData\Local\Programs\DKMLNA~1\desktop\bc\lib\ocaml
But the build prefix path map specifications require that colons (and two other characters) are escaped. https://reproducible-builds.org/specs/build-path-prefix-map/ recommends that we:
So replacing
ocamlc_where="$(ocamlc -where)"
withocamlc_where="$(ocamlc -where | sed 's/:/%./g')"
fixes the problem. The other characters should be replaced as well.Actual Behavior