Skip to content

opam upgrade -a package fails to resolve dependencies because it refuses to downgrade #3737

@RalfJung

Description

@RalfJung

In https://gitlab.mpi-sws.org/iris/iris/-/jobs/23068, you can see that opam fails to execute opam upgrade -y --all build-dep/ coq with the error

The following dependencies couldn't be met:
  - coq-iris-builddep -> coq-stdpp (= dev.2018-11-12.0.1a00ee7e & = dev)
      no matching version
Your request can't be satisfied:
  - No available version of coq-stdpp satisfies the constraints

That error message is heavily misleading, the required version of coq-stdpp exists -- but it is older than the currently installed version. I can reproduce this locally easily by creating a situation in which installing the latest package in build-dep/ requires downgrading another package.

Curiously, if I remove the -a, the downgrade works as expected. However, the entire point of using opam upgrade -a PACKAGE is make sure that PAKCAGE is installed and everything is up-to-date in a single transaction. It seems that that's not actually currently possible in opam.

# opam config report
# opam-version      2.0.3 
# self-upgrade      no
# system            arch=x86_64 os=linux os-distribution=debian os-version=9
# solver            builtin-mccs+glpk
# install-criteria  -removed,-count[version-lag,request],-count[version-lag,changed],-changed
# upgrade-criteria  -removed,-count[version-lag,solution],-new
# jobs              20
# repositories      2 (http), 1 (version-controlled) (default repo at ae294685)
# pinned            1 (rsync), 1 (version)
# current-switch    ocaml-base-compiler.4.02.3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions