Stuck installing dune on Windows

Currently attempting to get ocaml up and running in VSCode on windows 11 (win64). Have attempted getting the dkml distribution running, which has given me utop, ocaml, ocaml, opam. But for some reason I don’t have dkml (have followed the instructions on the site).

When I attempt ‘opam install dune’ I get the following error:

[ERROR] dune = 3.12.1 unmet availability conditions: ‘os != “win32” | os-distribution = “cygwinports”’

and if I attempt other dune versions I get:

[ERROR] dune = 3.14.0: not available because the package is pinned to version 3.12.1

I’ve done all of the installation in a windows power shell environment. I am also aware of the page about sunsetting opam-repositry-mingw, but unsure how to circumnavigate this.

I have also attempted manual installation but that is throwing checksum mismatches.

Any help would be very much appreciated as this is quite frustrating.

Sorry, I don’t have a solution for right now, but you’re being hit by Mark old dune releases as not compatible with windows by raphael-proust · Pull Request #25484 · ocaml/opam-repository · GitHub and I expect it will be fixed within the next few days (not helped by the various regional public holidays, on top of weekends)

1 Like

@Ocamllearnze Could you copy the following line into PowerShell (especially the #bd158... part):

opam repository set-url default git+https://github.com/ocaml/opam-repository.git#bd158f9d1ca3e810f610d21b4547b4be82a4326f

That will take a while to complete, but after it completes you will have rolled your package repository to the last known good snapshot for Windows. opam install dune should work for you (ping here if it doesn’t).

Once an announcement is made that the central package repository is fixed you can hop back on with:

opam repository set-url default https://opam.ocaml.org

Thanks for your patience.

2 Likes

The package repository has been fixed. If you used the magic hack command above, then you should use

opam repository set-url default https://opam.ocaml.org
opam update

to remove that temporary hack.

Edit: Added opam update