Opam install not installing from preferred repo

I am trying to install vcaml from the janestreet-bleeding repository and am running into a versioning issue. Here’s what I’m doing:

opam switch create . 4.14.1 --repos=janestreet-bleeding=https://ocaml.janestreet.com/opam-repository,default=https://opam.ocaml.org
eval $(opam env)
opam install dune merlin utop vcaml --yes

The problem is it tries to install vcaml version 0.15.0, which is what’s available in opam; however, janestreet-bleeding has v0.16~preview.128.10+111, which is newer, and is the one I want to use. I specified janestreet-bleeding first in my repos list, and indeed can confirm the ranking with opam repos list. I can also confirm with opam list that when dependencies are resolved, janestreet-bleeding is preferred; when possible packages are on v0.16~preview.128.10+111. But for some reason this isn’t true when I’m requesting vcaml to be installed directly. I do not want to request a specific version of vcaml - I want to say “give me the latest (whatever is currently in janestreet-bleeding).” How can I do this?

When debugging issues like this, it’s often useful to specify the exact version you want and see if it’s satisfiable at all. Some stray dependency might be dragging it back to the currently published version.

Have you tried opam install vdom.v0.16~preview.128.10+111, and if it does work, could you post the results of that run vs a standard opam install vdom?

1 Like

Thank you for that tip! Indeed, it was not satisfiable - it looks like the janestreet-bleeding repository is currently missing jsonaf. I’ve poked the appropriate people to resolve that.