aantron / dream

Tidy, feature-complete Web framework
https://aantron.github.io/dream/
MIT License
1.61k stars 129 forks source link

Documenting Windows support (Cygwin/DKML) #313

Open csaltachin opened 10 months ago

csaltachin commented 10 months ago

Hey all, I was looking through the README/docs/issues but couldn't find anything too clear about current Windows support. I'm still not very knowledgeable when it comes to OCaml CIs, or building OCaml projects/libraries in general, so I'm happy to be corrected -- but looking at this repo's GitHub Actions test workflow (e.g. latest run here), it seems like the only Windows OCaml/opam environment being targeted is the Cygwin + opam-repository-mingw environment ("OCaml for Windows").

There is another major OCaml Windows distribution since at least a year ago (?) called Diskuv OCaml (DKML) (OCaml docs here, DKML installer repo here). From my understanding, it uses the same compiler version (4.14.0), but does not overlay the official opam repo with opam-repository-mingw by default, does not support opam-depext, uses different building tools for more "native" Windows support (?), and so on. (Again, I'm happy to be corrected on the specifics.)

The thing is that, in the ocaml.org docs linked above, DKML currently appears as a recommendation with better overall support than the Cygwin environment (which is listed as deprecated!). So I think it'd be nice to add some small note on the README regarding which Windows environment(s) is Dream currently intended to support/to be tested on. It's probably not a big deal, but it could help Windows folks interested in Dream have an easier time figuring out whether they'd rather just switch to WSL, or switch to the current Cygwin environment, or wait for tier 1 Windows support with opam 2.2.

Incidentally, here is what prompted me to ask about this: I installed a DKML environment and was following one of the very first tutorials in the OCaml docs (here), where the example is to install Dream via opam and use the library in a project. But dream depends indirectly on conf-pkg-config and I run into ocaml/opam-repository#24851. And, well, I don't think either of these is necessarily a Dream problem, and WSL is a convenient enough alternative for me, but I can see more people getting tripped up like I did.

aantron commented 10 months ago

Indeed, Dream currently aims to support only MinGW, as I haven't had time to try DKML yet.

By the way, I initially started out in OCaml on Windows in Cygwin, but with MSVC. However, this was before opam, and for the last many years, the MinGW approach was much easier.

I think we should add a note to the README. As for what to do, it may be best to wait for opam 2.2 to be ready.