tweag / opam-nix

Turn opam-based OCaml projects into Nix derivations
MIT License
111 stars 33 forks source link

opam-nix does not error out when pinning dependencies failed, making debugging difficult #92

Open kentookura opened 4 months ago

kentookura commented 4 months ago

I would like there to be better error handling when pinning dependencies. I had added a *.opam.template file and the opam file was updated after running dune build. The OCaml environment built successfully, but the pinned dependency was not at the specified version. It turns out that there was an error when pinning the dependency which I only discovered when trying to build the repository with vanilla opam. The error was caused by the fact that the repo that I pinned contained multiple packages which my project depended on, so there was a bounds issue until I added a pin-depends entry for each package in the repo.

I hope I managed to explain what happened clearly enough.

Describe the solution you'd like

Vanilla opam actually fails in this scenario, so at the very least I would like there to be a message that pinning the dependencies failed

balsoft commented 4 months ago

Can you provide an example repo?

kentookura commented 4 months ago

https://github.com/kentookura/opam-nix-pins

kentookura commented 4 months ago

Note that pinning ppx_irmin is necessary even though the project has no explicit dependency on that library.