4 ms·
"use opam" is always the answer but in reality its the worst package manager ever. I've never seen so many packages fail to install, so many broken dependencies
by Milpotel 1y ago
"use opam" is always the answer but in reality its the worst package manager ever. I've never seen so many packages fail to install, so many broken dependencies and miscompilations that resulted in segfaults due to wrong dependencies. I just gave up with Ocaml due to the crappy ecosystem, although I could have lived with the other idiosyncrasies.
- nukifw 1y agoThere is a lot of work on Dune Package Management that will fix some legacy issues related to OPAM, https://dune.readthedocs.io/en/stable/tutorials/dune-package-management/setup.html https://dune.readthedocs.io/en/stable/tutorials/dune-package... !! Stay tuned!
- johnisgood 1y agoDune is not a dependency manager, it is a build tool. Opam is the dependency manager. By default, Dune doesn't fetch dependencies, opam does that. That said, Dune does use opam, yeah.
- nukifw 1y agoAnd the next milestone of Dune is to become an alternative package manager via Dune package Management, using a store in a "nixish" way.
- johnisgood 1y agoI suppose it is still going to use opam internally, right?
- yawaramin 1y agoNo, it is doing its own package management implementation.
- johnisgood 1y agoSo dune is going to replace opam? Where can I read more about this if so?
- yawaramin 1y agohttps://discuss.ocaml.org/t/dune-package-management-update/16477 https://discuss.ocaml.org/t/dune-package-management-update/1...
- nukifw 1y agoPackage description, but it use its own engine.
- johnisgood 1y agoI have never had issues and been writing OCaml and using opam for years. Can you be more specific? (Why the down-vote? He does need to be specific, right? Additionally, my experiences are somehow invalid?)
- sestep 1y agoAnd even if you do get opam working for a project, it's not at all reproducible and will just randomly break at some point in the future. For instance, I had this in a Dockerfile for one project: RUN eval $(opam env) && opam install --yes dune=3.7.0 One day the build just randomly broke. Had to replace it with this: RUN eval $(opam env) && opam install --yes dune=3.19.1 Not a big change, but the fact that this happens at all is just another part of building with OCaml feeling like building on a foundation of sand. Modern languages have at least learned how to make things reproducible with e.g. lockfiles, but OCaml has not.
- johnisgood 1y agoUse "opam lock" and "opam pin". Additionally, Dune's lockdir feature uses opam's solver internally to generate a lock directory containing ".opam.locked" files for every dependency. This is Dune's way of having fully reproducible builds without relying on opam's switch state alone. Additionally, see: https://dune.readthedocs.io/en/stable/tutorials/dune-package-management/setup.html https://dune.readthedocs.io/en/stable/tutorials/dune-package....
- sestep 1y agoNo, the problem is that dune=3.7.0 got removed from the registry entirely.
- johnisgood 1y agoIt is still there according to "opam show dune --all-versions", so no, it has not been removed. Anyways, what you could do is: opam pin add dune 3.7.0 opam install dune Alternatively, you can use the tarball directly: opam pin add dune https://github.com/ocaml/dune/releases/download/3.7.0/dune-3.7.0.tbz
- sestep 1y agoI tried going back to change my Dockerfile to see if that would work, and it did not: RUN eval $(opam env) && opam pin add dune 3.7.0 && opam install --yes dune Similar error to before: [ERROR] Package dune has no known version 3.7.0 in the repositories You're right that I could change it to grab directly from GitHub, but at that point I can also just change it to a different version of Dune, as I said above. None of this negates my original point.
- debugnik 1y agoI mean, it's quite clunky, but on Linux or WSL I've never had the broken experience you talk about. Could you share your setup? Was this maybe on bare macOS or Windows, in which case I totally believe it because they've been neglected?
- Milpotel 1y agoNo, just Linux or inside Docker (on Linux).