ocaml / opam

opam is a source-based package manager. It supports multiple simultaneous compiler installations, flexible package constraints, and a Git-friendly development workflow.
https://opam.ocaml.org
Other
1.21k stars 348 forks source link

spurious percent-encoding in output #6030

Closed emillon closed 2 days ago

emillon commented 2 weeks ago

Hi, I'm using opam 2.2.0~beta3 on windows. I've noticed that a package name is percent-encoded in an error message:

C:\Users\etien\src\dune>opam install -y lwt cinaps core_bench "csexp>=1.3.0" js_of_ocaml js_of_ocaml-compiler "mdx>=2.3.0" menhir ocamlfind ocamlformat.0.26.1 "odoc>=2.4.0" "ppx_expect>=v0.16.0" ppx_inline_test
 ppxlib ctypes "utop>=2.6.0" "melange>=4.0.0-414"
[ERROR] Package conflict!
  * No agreement on the version of ppx%5fexpect:
    - ppx_expect >= v0.16.0
    - core_bench → ppx_jane < v0.15 → ppx_expect < v0.15
  * No agreement on the version of ocaml-base-compiler:
    - (invariant) → ocaml-base-compiler = 4.14.1
    - core_bench → core = 109.24.00 → ocaml < 4.01.0 → ocaml-base-compiler = 3.09.1

The first occurrence is displayed as ppx%5fexpect, while the rest is displayed correctly as ppx_expect. Maybe that's a styling issue, since the invalid one is printed in bold while the other ones are using normal text (this on windows Terminal).

image

dra27 commented 1 week ago

This isn't Windows-specific:

opam@eb69dfc8d71b:~$ opam-dev install core_bench.v0.15.0 "ppx_expect>=v0.16.0"
[ERROR] Package conflict!
  * No agreement on the version of ppx%5fexpect:
    - ppx_expect >= v0.16.0
    - core_bench = v0.15.0 -> ppx_jane < v0.16 -> ppx_expect < v0.15
  * Incompatible packages:

IIRC the _ is not valid in CUDF, so it looks as though we're not translating a package name back in the "No agreement on the version" part of the message.

dra27 commented 1 week ago

This is also present in 2.1 (but not 2.0) - looks like it would have come in with #4349 (although it's not necessarily an issue directly with the PR)