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
A way to build OPAM files without knowing their names #4487
Comments
Aren't the opam files committed in your project? In which case |
This is now how I roll: I commit the generated OPAM file. But even then, I want to add a CI that checks that it is in sync for the dune-project and, in there, a target for OPAM files would be handy. It does seem like a very specific feature though, so it doesn't necessarily make so much sense to add it.
Le 22 avril 2022 18:50:08 UTC, Rudi Grinberg ***@***.***> a écrit :
…Aren't the opam files committed in your project? In which case `opam install . --deps-only` should work as expected?
--
Reply to this email directly or view it on GitHub:
#4487 (comment)
You are receiving this because you authored the thread.
Message ID: ***@***.***>
|
Another option would be to extend |
For now, my CI that checks for sync actually calls
It does seem like a nice idea to extend |
Hi there,
I hope there is indeed no way to do what I ask for and I hope this makes sense to you! Thank you by advance on the time you'll spend on this.
Wanted Feature
Dune can generate OPAM files which is truly great. It generates one per package defined in the
dune-project
file. I know two ways to ask Dune to generate these OPAM files: viadune build @install
and viadune build whatever.opam
. The former also builds a lot of other objects (which is potentially time consuming and might even fail) and the latter requires to know the name of the OPAM file one wants to generate. Could there be a way to generate the OPAM files – and only them – without knowing their names? For instance with a@opam
target?Context & Example Use
My goal is to write a generic CI script able to build a whole project. In particular, this script needs to ensure that the dependencies of the project are installed beforehand. With OPAM files, I would just do
opam install . --deps-only
. If I want to use only thedune-project
, I need a way to generate the OPAM files. Since the dependencies are not installed yet, I cannot simply rundune build@install
. And since I want my script to be generic, I cannot expect to know the OPAM file names. I think it would be perfect to have a virtual target that generates all the OPAM files.Mitigation
I see two ways to do it currently, although I do not find either of them so satisfactory. The first way is to run
dune build @install
which will take some time and fail but still generate the OPAM files. The second way is to extract the package names from thedune-project
with somesed
magic.The text was updated successfully, but these errors were encountered: