-
Notifications
You must be signed in to change notification settings - Fork 371
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
One opam file for multiple packages #3793
Comments
One of the UI question then becomes: how do you install the sub-package unix? For instance:
This could lead to the following resolution scheme:
|
Ah, my understanding of it so far was more limited, here is what I had in mind:
Basically, it would be like assuming you have a command type multi_opam = defs * (pkgname * defs) list
let expand_opams (base_defs, sub_pkgs) =
let pkgs =
(if has_field "name" base_defs then [get_field "name" base_defs, base_defs] else []) @
List.map (fun (pkgname, defs) -> pkgname, base_defs ++ sub_pkgs) sub_pkgs
in
List.iter (fun (pkgname, opam) -> write (pkgname ^".opam") opam) pkgs and that is (virtually) run before opam does the search for package definitions (where Would that be sufficient, or at least a good start ? It may probably be also worth discussing adding hierarchical packages to the repository, but IMHO in that case it would be better to start from the repository shape point of view rather than package definitions. What do you think ? |
But what is the concrete syntax to install sub-packages? You mean opam-publish will have to expand these files during the submission? |
yes, I guess referring to the directory or opam file would include them all (for Also, |
It seems to me that this is significantly complexifying the current opam model (I also already see problem with the install of If this is only for pins (as far as I understand). Why don't we rather define a protocol (step) that given the package name allows to generate the |
I have opened #3797 which from a workflow perspective would, if feasible, provide a better answer to the problem than this proposal (and to a few others along the way). |
This could make it much nicer to handle for packages with multiple definitions from the same source.
Quoting @avsm:
Instead of having
mirage.opam
,unix.opam
.The idea could be as simple as "interpret the file as multiple
foo.opam
files, forfoo
as eachpackage *
section, and the contents the common part + that section"The text was updated successfully, but these errors were encountered: