This thread was about version 0.1.x, and there have been major changes in 0.2.x and 0.3.x that address that. (Each major release had its own discuss.ocaml thread. In hindsight that was a mistake. More on that later)
In particular 0.2.6 introduced a binary release: [ANN] Windows-friendly OCaml 4.12 distribution 2nd preview release (0.2.0) - #6 by jbeckford . But the simple summary is there are some really important binaries that will fail on the end-user’s machine since they are compiled with hardcoded absolute paths:
ocamlc -config
has hardcoded paths. If you were to move an OCaml compiler to a different directory, anyone callingocamlc -config
(Dune, etc.) would break.- I think
ocamlfind
andocamlbuild
have hardcoded paths, and there are others I’ve stumbled across.
On Linux desktops it is OK to hardcode paths because almost all Linux desktop users have sudo
to install to standardized /usr/bin
and /usr/lib
locations. Similar situation exists for macOS desktop users. But many Windows desktop users do not have Administrator rights, and software must be installed in an arbitrary path like D:\Users\Student1234
.
Until hardcoded paths disappear, the safest and simplest way is to compile the correct hardcoded path into the binaries at install time. There is an alternative that Esy uses: binary patching. For many people binary patching would be okay, but software distributed under the “Diskuv” umbrella needs to be reproducible + auditable.
Status of the various binaries:
- Opam is relocatable (it doesn’t seem to have hardcoded paths). And Opam in particular has a time-consuming compilation process. So today if you use the Diskuv OCaml installer the
opam.exe
is downloaded as a binary asset. - Dune is relocatable. It is not downloaded today as a binary asset because it compiles so quickly … downloading it is premature optimization.
- Work is being done (not by me!) to make
ocamlc
relocatable. When that is complete, the compiling step forocamlc
will disappear from the installer. - No one, to my knowledge, is working on making other binaries relocatable.
Will keep using this thread going forward
For reference the other threads were:
0.2.x: [ANN] Windows-friendly OCaml 4.12 distribution 2nd preview release (0.2.0)
0.3.x: [ANN] New release of Windows DKML with system compiler and easy Opam switch creation
The upcoming 0.4.x (which introduces a single setup.exe installer) will be announced in this thread.