[wg-windows] Status of the OCaml Installer for Windows: the way forward?
Leonardo Laguna Ruiz
modlfo at gmail.com
Sat May 30 12:11:51 BST 2015
Hi, I use ocaml in linux, osx and windows. I don’t use any library that I cannot easily compile in all platforms. On windows I use the MSVC port since I can link .lib files that I have not compile by myself. In order to get Ocaml in windows I have setup a repo with Ocaml MSVC 2013 64 bits. There I have a few libraries and tools I use.
- containers
- ocamlgraph
- ppx_deriving
- extlib
- yojson (and it’s dependencies)
- merlin (which I use with sublime text)
- lwt
- batteries
Developing Ocaml programs in windows is not a pleasant experience since it lacks of tools that I consider essential like:
- utop
- oasis
- ocamldebug (which does not work very well)
So I usually write the code on OS X or linux; then I use ocamlbuild+cmake to build the executable in all platforms. When I have C/C++ bindings I use ocamlbuild to generate a .o or .obj file which I link to the rest of the code using cmake. Using cmake also simplifies compilation and linking C++ code.
At work I have developed a few internal tools. The main problem is that our developers working on windows (which are a majority) cannot take full advantage of the ocaml tools. It really sets them off having to use cygwin to build and having only debugging through a console application.
In my company we are currently not distributing any application or library written in Ocaml. This is in part due to the uncertain support of the Ocaml infrastructure in windows.
In summary the points that are important for me when creating an ocaml for windows distribution.
1.- Having the possibility of easily select the tools (MSVC, MinGW,Cygwin) that you want to use.
2.- Distribute asmrun and byterun as binaries for all ocaml ports (this will simply the first point) .
3.- Get rid of bash (cygwin) in ocaml tools (ocamlbuild)
4.- Include the common tools to build, edit and debug code. In my case, oasis, merlin, utop and some graphical debugger.
5.- Integration with multiplatform build system like cmake (which I have partially done)
Leonardo
> On 29 May 2015, at 21:02, Jonathan Protzenko <jonathan.protzenko at gmail.com> wrote:
>
> Dear OCaml-on-Windows aficionados,
>
> I thought I'd give a quick update on the status of my installer and more generally the way I see things moving forward in the OCaml for Windows ecosystem.
>
> About the installer: it hasn't been updated for a while. I'll issue a new release shortly. I'll drop the ActiveTCL step (no stable URL, causes problems) and I'll also drop Emacs (I don't think anyone uses that setup for real).
>
> About the way forward: there's two assumptions that I'd like to bring to this mailing-list.
> - Most OCaml packages need / assume a Unix-ish environment to build.
> - Binary packages are likely not going to happen soon.
>
> Therefore, what is urgently needed is:
> i) an installer that brings you the bare minimum (ocaml, flexdll, plus perhaps camlp4, ocamlfind and batteries), and
> ii) a unix-ish environment to make sure tools like ocamlbuild find the required utilities such as "bash" that they (infortunately) require in order to run, and
> iii) a way to distribute the toolchain (the assembler, a.k.a. i686-mingw-w64-as) required by ocaml (more precisely, by flexdll),
> iv) a package manager that can take it from there and fetch/compile the rest.
>
> The installer I provide satisfies i). Since it installs Cygwin, ii) and iii) are satisfied as well, because cygwin packages the /native/ compilers from the mingw64 project. The only remaining pain point is iv), and for that I really think we need OPAM to work out of the box on Windows.
>
> Once OPAM works superbly well, we won't need the installer anymore, because:
> - OPAM will be distributed as a statically-linked binary, that
> - takes care of installing even the OCaml compiler itself, and
> - is capable of installing the remaining binaries, as long as
> - the user operates in a cygwin environment so as to get bash, sed, and the toolchain from mingw.
>
> Please keep in mind that we're only talking of Cygwin as a way to get a Unix-ish environment. In the scenario outlined above, the OCaml compilers are, and generate, native windows programs.
>
> Of course, that's a very biased point of view, but I'd be happy to hear other's thoughts as to what exactly this doesn't fit their needs!
>
> Best,
>
> Jonathan
> _______________________________________________
> wg-windows mailing list
> wg-windows at lists.ocaml.org
> http://lists.ocaml.org/listinfo/wg-windows
More information about the wg-windows
mailing list