ocaml-ppx / ocamlformat

Auto-formatter for OCaml code
MIT License
633 stars 179 forks source link

Bug: Package conflict with `ocamlformat-lib <0.25.1` #2556

Closed lentil32 closed 5 months ago

lentil32 commented 5 months ago

Describe the bug When setting up the development environment for ocamlformat, version conflict occurs with ocamlformat-lib. Pinned one is 0.26.2 but dependency says <0.25.1 needed.

How to Reproduce Steps to reproduce the behavior:

$ opam switch create ocamlformat
$ opam install . --deps-only
[ocamlformat-bench.~dev] synchronised (git+file:///Users/user/src/ocamlformat#main)
[ocamlformat-lib.0.26.2] synchronised (git+file:///Users/user/src/ocamlformat#main)
[ocamlformat.0.24.1] synchronised (git+file:///Users/user/src/ocamlformat#main)
[NOTE] Ignoring uncommitted changes in /Users/user/src/ocamlformat (`--working-dir' not active).
[ocamlformat-rpc-lib.0.26.2] synchronised (git+file:///Users/user/src/ocamlformat#main)
[ERROR] Package conflict!
  * Missing dependency:
    - ocamlformat-lib < 0.25.1
    no matching version

No solution found, exiting
Julow commented 5 months ago

Hi, it seems that the pinned packages don't agree on the version: ocamlformat-lib.0.26.2, ocamlformat.0.24.1. Could there be global pins that interfere ? (opam pin list)

lentil32 commented 5 months ago

Hi, it seems that the pinned packages don't agree on the version: ocamlformat-lib.0.26.2, ocamlformat.0.24.1. Could there be global pins that interfere ? (opam pin list)

Hello. The original log was not from perfectly clean setup, so I add here cleaner one for more information.

$ opam switch remove ocamlformat
$ opam switch create ocamlformat
$ eval $(opam env --switch=ocamlformat --set-switch)
$ opam switch
#  switch       compiler                    description
   default      ocaml-base-compiler.5.1.1   default
→  ocamlformat  ocamlformat.0.26.2          ocamlformat

$ opam pin list
### <empty>

$ opam install . --deps-only
[ERROR] Package conflict!
  * Missing dependency:
    - ocamlformat-lib < 0.25.1
    no matching version

No solution found, exiting

$ opam install ocamlformat.0.24.1
### successfully installed

$ opam install . --deps-only
[ERROR] Package conflict!
  * Missing dependency:
    - ocamlformat-lib < 0.25.1
    no matching version

No solution found, exiting
Julow commented 5 months ago

Sorry for the slow reply. The project is composed of several packages and that confuses the default opam install. Here's the command I use:

opam install --deps-only -t ./ocamlformat-lib.opam ./ocamlformat.opam ./ocamlformat-rpc-lib.opam
lentil32 commented 5 months ago

Thank you for information