Can't install dune on Windows 10
Expected Behavior
Install Dune
Actual Behavior
Dune not installed
Reproduction
- opam install dune from Admin terminal
- error
Specifications
- Version of
dune(output ofdune --version): can't install this - Version of
ocaml(output ofocamlc --version): reports as not existing (I obviously have opam 2.3.0 installed) - Operating system (distribution and version): Windows 10
Additional information
opam install dune
The following actions will be performed:
=== install 1 package
β dune 3.18.2
<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><> π«
β¬ retrieved dune.3.18.2 (cached)
#=== ERROR while installing dune.3.18.2 =======================================#
Cannot copy C:\...\AppData\Local\opam\default\.opam-switch\build\dune.3.18.2\_build\install\default\bin\dune.exe to C:\...\AppData\Local\opam\default\bin\dune.exe (C:\Program Files\opam\bin\opam.exe: "open" failed on C:\...\AppData\Local\opam\default\bin\dune.exe: Permission denied).
<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><> π«
ββ The following actions failed
β β install dune 3.18.2
ββ
βΆβ No changes have been performed
# To update the current shell environment, run: (& opam env) -split '\r?\n' | ForEach-Object { Invoke-Expression $_ }
@nojb anything rings a bell?
The problem here is that opam install dune is being done with the admin terminal. I would wager that if that was not done, this would work correctly. There are analogous issues with sudo and opam, but windows is a bit different since admin terminals still don't have all the permissions to modify files unless explicitly asked for.
Are the three dots ... something that OPAM does to abbreviate long paths?
Maybe @kit-ty-kate can confirm.
Are the three dots
...something that OPAM does to abbreviate long paths?
no, i think it's the author's way to hide their HOME directory the same way someone on unix would replace it with ~/ if they don't want it to be public.
As for the issue, @privacyguy123 have you enabled Window's developer mode? opam init should have warned you that Windows won't let you use symlinks in some cases without it, and recommended to enable it. See https://learn.microsoft.com/en-gb/windows/apps/get-started/enable-your-device-for-development
I have the same issue trying to install dune 3.20.2 on windows 10 from an non admin terminal (powershell). Trying to figure out the process tree of executable having a handle on that file...I see ocamllsp.exe, conhost.exe and dune.exe itself having a handle on that file. Not sure if that helps.
I killed the process dune.exe and relaunched the installation and voilΓ , it worked. So I assume during long installation process of several packages, when dune is launched several times, it may happen some time that the process do not terminate correctly and permissions to copy/move it are not granted.