Hello, I’ve just installed the ocaml dev environment on a windows 11 system, using opam 2.2.
Trying the hello world example using Dune i found that on first run, the executable takes more than 20 secs to start. Successive run starts immediately.
I remember that utop did the same thing on first run. Any hints?
That sounds like Windows Defender or some other malware/anti-virus checker on your machine doing a scan. If it is, eventually it will get worse; you will start running into your executables randomly being deleted. Try adding a folder exclusion to your development directory (ex. C:\source) in Defender/Norton/whatever you have; Add an exclusion to Windows Security - Microsoft Support (edit) has instructions for Defender.
Thank you, I’m running Avira AV, excuded the project folder and the problem seems to be solved.
Do you think I have to exclude some other folder or file?
The opam init is independent of the shell, except perhaps under Cygwin. (Someone from the opam team will need to answer that)
I typically use PowerShell inside Windows Terminal or inside Visual Studio Code for OCaml development. That makes it easy to copy and paste commands from Unix-oriented sites … without having to translate / into \, etc.