Skip to content

opam tree <local dir/file> doesn't take into account the dependencies of the packages requested if a package of the same name is already installed #6543

@kit-ty-kate

Description

@kit-ty-kate

Currently with opam 2.3.0:

### : make sure the dependencies are taken from the correct opam description
### opam switch create opam-description-1 --empty
### <pkg:miou.0.3.1>
opam-version: "2.0"
### <pkg:miou.0.3.0>
opam-version: "2.0"
### <pin:test/opam>
opam-version: "2.0"
depends: ["miou"]
### opam pin add test.custom ./test

Package test does not exist, create as a NEW package? [y/n] y
[test.custom] synchronised (file://${BASEDIR}/test)
test is now pinned to file://${BASEDIR}/test (version custom)

The following actions will be performed:
=== install 2 packages
  - install miou 0.3.1           [required by test]
  - install test custom (pinned)

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> installed miou.0.3.1
-> retrieved test.custom  (file://${BASEDIR}/test)
-> installed test.custom
Done.
### <pin:test/opam>
opam-version: "2.0"
depends: ["miou" {= "0.3.0"}]
### opam tree ./test
test.custom
'-- miou.0.3.1
### : same but with non-pinned packages
### opam switch create opam-description-2 --empty
### <pkg:miou.0.3.1>
opam-version: "2.0"
### <pkg:miou.0.3.0>
opam-version: "2.0"
### <pkg:test.1>
opam-version: "2.0"
depends: ["miou"]
### opam install test
The following actions will be performed:
=== install 2 packages
  - install miou 0.3.1 [required by test]
  - install test 1

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> installed miou.0.3.1
-> installed test.1
Done.
### <pin:test/opam>
opam-version: "2.0"
build: "false"
depends: ["miou" {= "0.3.0"}]
### opam tree ./test
test.1

With the current master (708d62e) we get a similar result, except the last line becomes:

test.1
'-- miou.0.3.1

which also shouldn't happen.

The expected result for both calls to opam tree ./test are of course:

test.dev
'-- miou.0.3.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions