-
Notifications
You must be signed in to change notification settings - Fork 574
Properly specify dependencies of librairies in opam files #10982
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
pasting my comment from #11114 (comment) random thought looking at this file. I was investigating adding pins here instead of our setup script, but modifying this file by hand seems hard (no documentation on how to do it that I could find) and error prone (as it is supposed to be a machine generated file). It would be nice to be able to list all the dependencies, all the pins, and the OCaml version we use, in a single |
@mimoo I was wondering about this. Is your idea to create our own format in a A nice compromise, I think, would be to do this (the first solution): https://opam.ocaml.org/doc/Tricks.html#Provide-a-set-of-packages-for-a-group-of-users-to-install That is, make a package definition for the whole repository with all of our needed dependencies, which is how they're supposed to be specified in the first place. |
I think the ideal world is this:
This allows us to always have these files that specify EVERYTHING from the OCaml version to where all the dependencies (and their versions) are located. Without that, you never know what you're really doing. What switch are you using? Do you have the right dependencies installed on your switch or system? Do you have the right pins in place? Do you have the right OCaml versino? etc. I suspect that these are the source for the most time wasted with the build system. I don't like the
It looks like you can't do any of that with dune/opam. esy sounded like it would get us closer to a world like this, but it seems to have many bug and still relies heavily on you writing dune files. I don't think there's an out-of-the-box solution that exists in the OCaml ecosystem. I remember reading about https://ocamlpro.github.io/drom/ but it was quite messy as well (and not actively maintained) |
Tell me if I'm wrong but it seems to me that There is currently Then at the top level, we have a
This is not true anymore with the Nix setup thanks to @balsoft ! Currently if you setup nix on your system, you can just |
I don't think so because:
this is cool! I still haven't setup nix on my mac, I'm wondering at which point it would make sense to move there to build and run tests :o I've heard it needs some time investment |
I'm not sure what you mean or want here? Can you give an example of what you'd want in terms of interaction?
You can specify the version of OCaml needed like any other package
You can! With the |
Just to give an example of a what a complete
|
Basically all of our errors (someone posted another one on slack today) come from: "I ran At the very least dune should tell you "your switch dependencies are at the wrong version" or "your ocaml version is wrong" But really, ideally, I should never have to worry about having messed up my switch. Dependencies and pins listed in some file should be the source of truth whenever I run
isn't all of that completely ignored by dune? |
The discussion continued a bit on Slack, the gist is the |
Regarding specifying dependencies in opam files, it seems that the opam-dune-lint tool should be able to do this automatically. However it does not work with dune 3 at the moment (there is an issue about it). And there is also this related dune issue about checking that the library used are the one declared in opam files (or the dune-project one). It seems that we can wait until this is sorted out to specify the dependencies in the opam files, so until then, we could use a wrapper around dune that works with the current |
yeah I tried using opam-dune-lint in the past and it doesn't work well. I agree that a |
Pins are currently performed via thescripts/pin-external-packages.sh
script.opam
supports pins in the switch description (and should support relative paths).See if we can remove the script and specify everything in the switch description.(moved to #11120There are already opam files for libraries, we should properly specify the deps of these libraries in opam files. Potentially using an automatic tool to ensure dune, dune-project and dune files are synchronized.
The text was updated successfully, but these errors were encountered: