Skip to content

Commit f974540

Browse files
authored
Merge pull request #6055 from rjbou/cudf-encode
Package name encoding in conflict message
2 parents 80ccb00 + ac5510f commit f974540

File tree

4 files changed

+45
-1
lines changed

4 files changed

+45
-1
lines changed

master_changes.md

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ users)
2727
## Actions
2828

2929
## Install
30+
* Fix package name display for no agreement conflicts [#6055 @rjbou - fix #6030]
3031

3132
## Remove
3233

@@ -110,6 +111,7 @@ users)
110111
* cli versioning: untie output from current major version [#6045 @rjbou]
111112
* Set `opam-version` to 2.2 for some conflict message tests based on opam repository to stabilise their output [#6045 @rjbou]
112113
* [BUG]: head -c is not posix compliant. Use cut -b instead. [#5989 @madroach]
114+
* Add bad cudf package name encoding (dose3 lib) [#6055 @rjbou]
113115

114116
### Engine
115117

src/solver/opamCudf.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ module Package = struct
426426
type t = Cudf.package
427427
include Dose_common.CudfAdd
428428
let to_string = string_of_package
429-
let name_to_string t = t.Cudf.package
429+
let name_to_string t = OpamPackage.name_to_string (cudf2opam t)
430430
let version_to_string t = string_of_int t.Cudf.version
431431
let to_json = to_json
432432
let of_json = of_json

tests/reftests/dune.inc

+18
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,24 @@
542542
%{targets}
543543
(run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:empty-conflicts-006.test} %{read-lines:testing-env}))))
544544

545+
(rule
546+
(alias reftest-empty-conflicts-007)
547+
(action
548+
(diff empty-conflicts-007.test empty-conflicts-007.out)))
549+
550+
(alias
551+
(name reftest)
552+
(deps (alias reftest-empty-conflicts-007)))
553+
554+
(rule
555+
(targets empty-conflicts-007.out)
556+
(deps root-N0REP0)
557+
(package opam)
558+
(action
559+
(with-stdout-to
560+
%{targets}
561+
(run ./run.exe %{exe:../../src/client/opamMain.exe.exe} %{dep:empty-conflicts-007.test} %{read-lines:testing-env}))))
562+
545563
(rule
546564
(alias reftest-env)
547565
(action
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
N0REP0
2+
### : Test the output of 'No agreement' package name, du to Dose_Common.package encoding
3+
### : see https://github.com/ocaml/opam/issues/6030
4+
### <pkg:foo.1>
5+
opam-version: "2.0"
6+
depends: "ba_z" { > "2" }
7+
### <pkg:bar.1>
8+
opam-version: "2.0"
9+
depends: "ba_z" { < "2" }
10+
### <pkg:ba_z.1>
11+
opam-version: "2.0"
12+
### <pkg:ba_z.2>
13+
opam-version: "2.0"
14+
### <pkg:ba_z.3>
15+
opam-version: "2.0"
16+
### opam switch create --empty encode-cudf
17+
### opam install bar foo
18+
[ERROR] Package conflict!
19+
* No agreement on the version of ba_z:
20+
- bar -> ba_z < 2
21+
- foo -> ba_z >= 3
22+
23+
No solution found, exiting
24+
# Return code 20 #

0 commit comments

Comments
 (0)