Windows build fixes (MSYS2, Cygwin, etc.) #112
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes various issues:
ocamlfinddoes not build with OCaml 5.0+ on Cygwin (a build failure occurs owing to mishandling of the;inpathin the generation offindlib.conf). (GHA: Add OCaml 5.4 to the test matrix opam#6732)findlib.confis (silently) misgenerated which causes bothocamlfind listandtopfindto fail. (MSys2 fails to compile topkg.1.1.0 opam-repository#28636)ocamlfind installcontains an incorrect check forMETA.pkgeven whenmetadiris not in use (which happened to affect the non-opam installation ofnum).-sis not a necessary, nor even always valid, flag tocygpathany more and the technically the legacy command for retrieving the Standard Library is broken on old versions of OCaml.The opening commits are fairly straightforward. The last commit is fiddly, but enacts the following sequence of changes:
findlib.confis shifted from being a build operation to aconfigureoperation. That requires the tracking of the native / "Unix" version of various path variables inconfigure, but is fundamentally simpler overall, because we only have to worry about escaping the backslashes which physically go intofindlib.confand not also escaping characters which may interfere with an escapingsedexpression!tools/patchto be able to assume that it has received a native path (modulo the highly legacy stuff for the MinGW environment, but this probably ought to all be removed).Fixes Cygwin failure in ocaml/opam#6732
Closes ocaml/opam-repository#28636
cc @kit-ty-kate (opam), @jmid (opam-repository), @Leonidas-from-XIV (Dune package management)