Problem with platform tools installation

Hello,

I’m a complete newbie in OCaml so please excuse my poor skills.

I’ve been trying to install OCaml on Windows following the instructions given at Installing OCaml · OCaml Documentation.

I’ve installed the DkML distribution. Trying to install platform tools (typing
opam install ocaml-lsp-server odoc ocamlformat utop), however I first get the following:

[WARNING] Detected that the system native code OCaml compiler is not present. Creating it now. ETA: 15 minutes.

Then some installation takes place, and finally I get the following error:

I’ve been trying to search for a solution but I haven’t found anything.
Is there any way to fix this issue? Thanks!

The actual error will be much higher; you are just seeing diagnostics at the end. Could you paste the full output? (I doubt you can paste that much in discuss.ocaml.org but https://github.com/diskuv/dkml-installer-ocaml/issues/new will work).

Alternatively, if you have the time, could you consider trying out the newer Windows installation “opam 2.2” instead? That would be:

  1. Open Add or remove programs from Windows Search (type Windows key and then start typing “Add or remove programs”), and then uninstall DkML Native; you can ignore any failures. You can now close “Add or remove programs”.

  2. Open PowerShell and run the following:

    if (Test-Path "$env:LOCALAPPDATA\opam") { del -force - recurse "$env:LOCALAPPDATA\opam" }
    
  3. Follow the steps in [ANN] opam 2.2.0 is out!. After that Introduction to opam Switches · OCaml Documentation and Your First OCaml Program · OCaml Documentation should be the right tutorials to continue learning.

2 Likes

Maybe just install a Linux VM and make your developer life easier.

Thanks a lot for your time!
I’ve uninstalled DkML Native and typed

if (Test-Path "$env:LOCALAPPDATA\opam") { del -force - recurse "$env:LOCALAPPDATA\opam" }

but I get:

Sorry… copy and paste added a space before “recurse”:

if (Test-Path "$env:LOCALAPPDATA\opam") { del -force -recurse "$env:LOCALAPPDATA\opam" }

Thanks, it works! What should I do then?

Actually, I’ve tried.
I’ve installed wsl, then I’ve installed VSCode following the instructions at “Installation” from Developing in the Windows Subsystem for Linux with Visual Studio Code then I’ve installed opam with

sudo apt install opam

and then I’ve successively typed:

opam init
eval $(opam env)
opam install ocp-indent merlin ocaml-lsp-server utop graphics
eval $(opam env)
opam user-setup install
eval $(opam env)

and I’ve installed OCaml and Reason IDE on VSCode and OCaml tuareg-master but I don’t know what to do after that…

I’m really sorry but I’ve typed:

if (Test-Path "$env:LOCALAPPDATA\opam") { del -force -recurse "$env:LOCALAPPDATA\opam" }

and then I’ve been to [ANN] opam 2.2.0 is out! but I don’t know what to do then.

I suggest checking your installation to confirm that OCaml works as expected.

Afterwards you may be interested in following a tour of OCaml.

Happy hacking!

Hello, I’ve installed Utop on wsl (and I am still unable to code in OCaml on VSCode) but since I’ve uninstalled everything related to DkML Distribution I don’t have OCaml on Windows…

  1. For a WSL installation, it sounds like you need to setup your editor to play together the subsystem. It would be helpful if you share a more descriptive error message though.
  2. For a native Windows installation, have you tried running the suggested command in a PowerShell after uninstalling the DkML distribution?
Invoke-Expression "& { $(Invoke-RestMethod https://raw.githubusercontent.com/ocaml/opam/master/shell/install.ps1) }"

Thanks for your time, I’ve typed:

Invoke-Expression "& { $(Invoke-RestMethod https://raw.githubusercontent.com/ocaml/opam/master/shell/install.ps1) }"

and then, following what is said at https://discuss.ocaml.org/t/ann-opam-2-2-0-is-out/14893:

opam init --reinit -ni

but as I get:


I assume I’ve followed the wrong instructions.

You did the right instructions.

That error Curl failed: ... exited with code 35 is a CURLE_SSL_CONNECT_ERROR (35):

A problem occurred somewhere in the SSL/TLS handshake. You really want the error buffer and read the message there as it pinpoints the problem slightly more. Could be certificates (file formats, paths, permissions), passwords, and others.

Looks like your Internet traffic is being intercepted or interrupted, or your machine has its own SSL certificates, and that has nothing to do with OCaml.

Could be a MITM proxy (a corporate proxy or a device on your home network) or any overly aggressive anti-malware tool (MacAfee, “web shields”, etc.). There is very little anyone will be able to do for you in this forum if these network failures are repeatable (and it sounds like it is). At best, try disabling your anti-malware/anti-virus before you run opam init --reinit -ni. But I’m not optimistic that will work.

It doesn’t work but thanks for your time and explanations.