[ANN] OCaml Platform Installer alpha release

Let me try to explain a little bit more!

So, there are two distinct process:

  1. Installing ocaml-platform. This is done by the installer script which, as you found out, also installs opam.
  2. Installing the platform tools: merlin, dune, ocamlformat, … This is done by running ocaml-platform (more explanation of what happens during a run of ocaml-platform below).

For 1., I agree that using a script is not ideal at all. We do want to have a system package, ideally as part of a distribution. However, we are really at an early stage, and first focused on developing the “core” functionality, for feedback before going further.
Note that sudo is only used when needed (for the install command), and that we encourage users to check what is inside the script: Taken from the README:

Don’t hesitate to have a look at what the script does. In a nutshell, the script will install a static binary into /usr/local/bin/ocaml-platform as well as the opam binary if it isn’t already installed.

For 2. here is what happens when you run ocaml-platform (also detailed in the README):

  • First, “driving” opam, ocaml-platform infer a version of each platform tools (dune merlin etc). It will use the best one available for your version of OCaml, except for ocamlformat where it will first search for a .ocamlformat with a specified version.
  • Then, ocaml-platform checks which of the tools.version it has in a local cache (which is initially empty).
  • Using opam, it builds in a “sandbox switch” the ones to build (the ones that are not already in the cache)
  • it populates the local cache with the newly built package
  • Using opam, it installs everything from the local cache (which is a local opam repo).

So, to answer your question:

You simply need to run ocaml-plaform, it will know that there is a new version of dune by asking opam the best version available. (I answered incorrectly the first time as I thought you were specifically speaking about a new version of ocaml-platform, my apologies!)

Yes, I forgot about opam’s installation… I meant that only ocaml-platform (and opam…) is downloaded through the install script. Other tools are downloaded through opam.

I simply meant that, when discussing how the tool would work, we tried not to miss security issues. Since most of the communication with the outside world is done through opam, we felt it was okay, but I am no security expert… and would love specific advices on the matter :slight_smile:

@hannes I hope that I answered your questions in a clearer way!


@edwin that’s a good point! There are still some things to work out: since the tool is not switch dependent, having multiple versions of it (even in multiple switches) might create problem (for instance, v2 updates the cache to the v2 version, and v1 cannot use the cache anymore. (Similar to opam 1 and 2 with the update of .opam!))

1 Like