tarides / ocaml-platform-installer

The best way for developers to write software in OCaml
ISC License
61 stars 8 forks source link

Continue installing if a tool is not available #90

Closed Julow closed 2 years ago

Julow commented 2 years ago

Currently, if a tool is not compatible with the selected compiler, an uncaught exception happens and the process is killed.

To avoid this, incompatible tools are logged and the installer is allowed to continue with the other tools in the list. Missing tools are also printed again at the end for clarity.

For example, ocaml-lsp-server is not compatible with ocaml.5.0.0~alpha0:

* Inferring tools version...
  -> dune will be installed as dune.3.3.1-ocaml5.0.0~alpha0
  -> dune-release will be installed as dune-release+bin+platform.1.6.2-ocaml5.0.0~alpha0
  -> merlin will be installed as merlin+bin+platform.4.4.1~5.0preview-ocaml5.0.0~alpha0
ocaml-platform: internal error, uncaught exception:
                Not_found

The output now looks like this:

* Inferring tools version...
  -> dune will be installed as dune.3.3.1-ocaml5.0.0~alpha0
  -> dune-release will be installed as dune-release+bin+platform.1.6.2-ocaml5.0.0~alpha0
  -> merlin will be installed as merlin+bin+platform.4.4.1~5.0preview-ocaml5.0.0~alpha0
ocaml-platform: [WARNING] ocaml-lsp-server cannot be installed with OCaml 5.0.0~alpha0
  -> odoc will be installed as odoc+bin+platform.2.1.0-ocaml5.0.0~alpha0
  -> ocamlformat will be installed as ocamlformat+bin+platform.0.22.4-ocaml5.0.0~alpha0
* Building the tools...
  -> Creating a sandbox...
  -> [1/5] Building ocamlformat...
  -> [2/5] Building odoc...
  -> [3/5] Building merlin...
  -> [4/5] Building dune-release...
  -> [5/5] Building dune...
* Installing tools...
  -> All tools installed. For more information on the platform tools, run `ocaml-platform --help`
* Success.
ocaml-platform: [WARNING] The following tools haven't been installed: ocaml-lsp-server