Add opam tree subcommand#5171
Conversation
rjbou
left a comment
There was a problem hiding this comment.
Thank you for feature & PR!
First part of the review, most comments are about opam lib usage, organisation, etc. Default behaviour code is ok, I'll review other functions later.
Regarding the feature:
- As mentioned in one of the comments, it handles only installed packages. It needs to be checked/specified or extended, depending on what we need
- We need to add handling of test/doc/build dependencies, ftm they are dropped
- Should this feature be at toplevel or a subcommand of
opam list? In that case how can it be combined? Module itself is quite long also too.
I'll also add a test, to be populated.
All of
Yes 🚀 Should test/doc/build deps be distinguishable in the tree e.g. ? It would be a bit complicated to do this since test and doc are processed in
Personally I'm against Also, |
bd9a6b8 to
b30a667
Compare
|
It seems I have to either get rid of |
|
Good for me (and more consistent about the command itself, its difference with I've also added a test in |
|
@rjbou I'm not very sure how to add a new subcommand to or or something else? |
|
The first one: an entry for |
|
I think this is now ready for review 🎉 I accidentally edited the API changes in |
|
It would be nice if we could also support JSON output for CI use. |
|
I'm working on more inclusive Opam dependency support on GitHub, which requires that: ocaml/setup-ocaml#555 |
|
@smorimoto I've just added a basic support of JSON output. It would look like this: What do you think about it? |
|
Could the JSON thing be its own PR instead? This is going to make the review process even more long and there would be more things to argue on. |
|
@cannorin That looks good to me. |
|
@smorimoto this is not "one small commit", a json output would be used by programs outside of opam so the format is extremely important to get right as a change in the format would break ever users of it, and that requires extra time |
|
Agreed - please can this PR not acquire new features. PRs against your own fork are a better way to start previewing the next stage while this part gets reviewed. |
|
On second thought, it surely makes sense. |
|
ok, I'll revert it. |
f946b3f to
dbb7550
Compare
| in | ||
| let no_switch = | ||
| mk_flag ~cli (cli_from cli2_2) ["no-switch"] ~section:selection_docs | ||
| "Do not take into account switch consistency" |
There was a problem hiding this comment.
As far as I'm concerned, no :-)
There was a problem hiding this comment.
new version
"Ignore active switch and simulate installing packages from an empty \
switch to draw the forest"
There was a problem hiding this comment.
installing packages to an empty switch?
|
Thanks a lot! |
|
Thanks all! |
|
Thanks everyone 🚀 🚀 🚀 |
Closes #3775 .
This PR adds a subcommand
opam treewhich displays a dependency tree as a Unicode art or ASCII art.It can also display a reverse-dependency tree (through
opam tree --rev-depsoption oropam whyalias), which can be useful to examine how dependency versions get constrained.TODO
.mlimaster_changes.mdfile