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.0~beta2] opam upgrades suggests beta variants by default #4404

Closed
yannl35133 opened this issue Oct 26, 2020 · 5 comments
Closed

[Opam 2.1.0~beta2] opam upgrades suggests beta variants by default #4404

yannl35133 opened this issue Oct 26, 2020 · 5 comments
Assignees
Milestone

Comments

@yannl35133
Copy link

By default, opam upgrade wants to upgrade ocaml to its highest version (4.13.0 as of now), even if this variant is in beta.
I think this is not a good idea in general. I don't know about it, but it may be due to the fact tham opam itself is in a beta version, but even then ocaml-beta-repository is not enabled, so I don't think it should be proposed.

@rjbou rjbou added this to the 2.1.0~beta3 milestone Oct 27, 2020
@AltGr
Copy link
Member

AltGr commented Oct 28, 2020

New in 2.1 is a package flag hidden-version that is designed specifically for this kinds of cases, where you want a given package or version to only be chosen if there is no alternate way of satisfying the user request.

It is not yet being used in opam-repository, but that will come once 2.1 is released. The current ocaml-beta-repository hack should make sure you don't get ocaml betas unless you explicitely enabled them though; I am closing (since we have a new feature for this case), but if you hadn't enabled the beta repositories you should maybe report to ocaml/opam-repository, it might be a packaging issue.

Thanks for reporting!

@AltGr AltGr closed this as completed Oct 28, 2020
@yannl35133
Copy link
Author

I'm not sure you understood correctly my problem, otherwise I have not understood you.

When I do opam upgrade, opam wants to upgrade ocaml to version 4.13, but cannot because ocaml-beta-repository is not enabled, so it displays that it couldn't.
I think that, when ocaml-beta-repository are disabled, opam should not try to upgrade it (or at least not display that it tried), because ocaml 4.13 should not even be an option.

As far as I understand, tagging beta versions of ocaml as hidden would implement a more relaxed (but ok to me) version of what I imagine, but the way it is handled now by opam seems wrong to me.

@yannl35133 yannl35133 changed the title [Opam beta 3] opam upgrades suggests beta variants by default [Opam 2.1.0~beta2] opam upgrades suggests beta variants by default Oct 28, 2020
@yannl35133
Copy link
Author

I get this message when I do opam upgrade

The following packages are not being upgraded because the new versions conflict with other installed packages:
  - camlp4.4.11+system
  - ocaml.4.13.0
    ∗ base.v0.14.0 is installed and requires ocaml (>= 4.07.0 & < 4.12)
    ∗ camlp4.4.11+system is installed and requires ocaml (>= 4.11 & < 4.12)
    ∗ coq.8.12.1 is installed and requires ocaml (>= 4.05.0 & < 4.12)
    ∗ dot-merlin-reader.3.4.1 is installed and requires ocaml (>= 4.02.1 & < 4.12.0)
    ∗ dune.2.7.1 is installed and requires ocaml < 4.08~~
    ∗ extlib.1.7.7 is installed and requires ocaml < 4.12.0
    ∗ merlin.3.4.1 is installed and requires ocaml (>= 4.02.3 & < 4.12)
    ∗ ocaml-lsp-server.1.1.0 is installed and requires ocaml (>= 4.06 & < 4.12)
    ∗ ocaml-migrate-parsetree.2.1.0 is installed and requires ocaml (>= 4.02.3 & < 4.13)
    ∗ ocamlformat.0.15.1 is installed and requires ocaml (>= 4.06 & < 4.12)
    ∗ ppxlib.0.19.0 is installed and requires ocaml (>= 4.04.1 & < 4.13)
    ∗ stdlib-shims.0.1.0 is installed and requires ocaml < 4.12.0~~
  - ocaml-config.2
  - ocamlgraph.2.0.0
    ∗ dose3.5.0.1 is installed and requires ocamlgraph (>= 1.8.6 & < 2.0.0)
However, you may "opam upgrade" these packages explicitly, which will ask permission to downgrade or uninstall the conflicting packages.

Can you confirm this is an issue and that it will be fixed with the flag hidden-version?

@dra27
Copy link
Member

dra27 commented Nov 16, 2020

Just to be able to do a meaningful example, what’s opam list --roots in your switch?

@yannl35133
Copy link
Author

$ opam list --roots
# Packages matching: root
# Name              # Installed # Synopsis
coq                 8.12.1      Formal proof management system
coqide              8.12.1      IDE of the Coq formal proof management system
dune                2.7.1       Fast, portable, and opinionated build system
graphics            5.1.0       The OCaml graphics library
heptagon            1.05.00     Compiler for the Heptagon/BZR synchronous programming language
menhir              20200624    An LR(1) parser generator
merlin              3.4.1       Editor helper, provides completion, typing and source browsing in Vim and Emacs
ocaml-base-compiler 4.11.1      Official release 4.11.1
ocaml-lsp-server    1.1.0       pinned to version 1.1.0 at git+https://github.com/ocaml/ocaml-lsp.git
ocamlformat         0.15.1      Auto-formatter for OCaml code
ocp-indent          1.8.1       A simple tool to indent OCaml programs
opam-depext         1.1.4       Install OS distribution packages
opam-devel          2.1.0~beta2 opam 2.1 bootstrapped binary
posix-semaphore     0.5.0-0     POSIX semaphore
user-setup          0.7         Helper for the configuration of editors for the use of OCaml tools
zarith              1.11        Implements arithmetic and logical operations over arbitrary-precision integers

For an easier example, I have another switch for dune only :

$ opam upgrade
Everything as up-to-date as possible (run with --verbose to show unavailable upgrades).

The following packages are not being upgraded because the new versions conflict with other installed packages:
  - ocaml.4.13.0
    ∗ dune.2.7.1 is installed and requires ocaml < 4.08~~
  - ocaml-config.2
However, you may "opam upgrade" these packages explicitly, which will ask permission to downgrade or uninstall the conflicting packages.
Nothing to do.
$ opam list --roots
# Packages matching: root
# Name              # Installed # Synopsis
dune                2.7.1       pinned to version 2.7.1 at git+https://github.com/ocaml/dune
ocaml-base-compiler 4.11.1      Official release 4.11.1

@rjbou rjbou mentioned this issue Mar 10, 2021
2 tasks
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

No branches or pull requests

4 participants