Skip to content
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

[opam 2.1~beta2] opam 2.1 does not seem to have an equivalant for opam depext -u #4355

Closed
kit-ty-kate opened this issue Sep 13, 2020 · 5 comments · Fixed by #4379
Closed
Assignees
Milestone

Comments

@kit-ty-kate
Copy link
Member

In #3975 opam integrated opam-depext into opam.
However currently there doesn't seem to be possible to get the same behaviour as opam depext with the -u argument that was used to have a system agnostic way to update the system repositories. This was a rather useful command to have in some CI situations.

OpamSysInteract.update still exists but is not used anywhere.

@AltGr
Copy link
Member

AltGr commented Sep 14, 2020

Ah, seems that has been overlooked, should be fairly easy to remedy...
Not sure where it would fit, though, because we probably don't want to do it before all queries to the OS packages (e.g. when the switch state is loaded).
Maybe just opam update --system-packages ?

@kit-ty-kate
Copy link
Member Author

kit-ty-kate commented Sep 14, 2020

What about reintroducing the opam depext subcommand? Except now it's builtin.

This would bring a more smooth user experience upgrading from opam 2.0 to opam 2.1, would bring back opam depext -l <pkg> to get the name of the system packages to install – useful to, for example, remove them later (this is used in the Travis script in ocaml-repository currently for instance).

@dra27
Copy link
Member

dra27 commented Sep 14, 2020

The downside of bringing opam-depext in as a builtin, is that the gamut of opam-depext's CLI then has to be emulated, so it's potentially better to put the commands more logically elsewhere. I haven't checked - which options are missing apart from -u and -l?

opam-update seems a logical home, but perhaps with a name that more clearly links it to depexts, than system switches? Would opam update --depexts be better?

@AltGr
Copy link
Member

AltGr commented Sep 15, 2020

opam depext -l <pkg> is just a wrapper over opam list --external --resolve <pkg>, so that would be for compatibility or convenience, but not a requirement feature-wise.
I still agree with @rjbou's point on this that, would you really need backwards-compatibility, you should remain able to install the plugin, that should actually still work on 2.1, even if it's not needed anymore (it was marked incompatible with opam 2.1 to avoid confusion, though).

I know the CLI is not as clear and streamlined as it could be, but I don't have a good feeling about duplicating features in different CLI areas just for better compatibility with an older plugin;
of course if there are other missing features like depext -u, we should find a way to re-introduce them.

@avsm
Copy link
Member

avsm commented Sep 15, 2020

I agree that we shouldn't duplicate CLI functionality.

Putting this in opam update seems logical. Although it's the reverse of the semantics of opam install, we should probably make this not the default, so opam update --with-depexts activates the functionality. The reason is that it's only necessary for CI to have this option, as in the desktop case the user has other mechanisms to ensure their system packages are updated.

@AltGr AltGr self-assigned this Oct 6, 2020
AltGr added a commit to OCamlPro/opam that referenced this issue Oct 6, 2020
This is not strictly an opam command, but it's useful to have here.
Closes ocaml#4355
AltGr added a commit to OCamlPro/opam that referenced this issue Oct 7, 2020
This is not strictly an opam command, but it's useful to have here.
Closes ocaml#4355
@rjbou rjbou added this to the 2.1.0~beta3 milestone Oct 12, 2020
@rjbou rjbou linked a pull request Oct 12, 2020 that will close this issue
rjbou pushed a commit to OCamlPro/opam that referenced this issue Dec 11, 2020
This is not strictly an opam command, but it's useful to have here.
Closes ocaml#4355
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants