Skip to content

Commit

Permalink
fix: Add dune to existing packages to allow resolving
Browse files Browse the repository at this point in the history
Signed-off-by: Marek Kubica <marek@tarides.com>
  • Loading branch information
Leonidas-from-XIV committed Nov 5, 2024
1 parent 5707bf0 commit 57f2e02
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions src/dune_pkg/opam_solver.ml
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,13 @@ let reject_unreachable_packages =
let version = Package_version.of_string "dev" in
Some version)
in
(* Dune is removed from the packages, but added here to allow formula
resolution to pick "dune" *)
let pkgs_by_version =
Package_name.Map.update pkgs_by_version Dune_dep.name ~f:(function
| Some _ as version -> version
| None -> Some (Package_version.of_string "dev"))
in
let pkgs_by_name =
Package_name.Map.merge pkgs_by_name local_packages ~f:(fun name lhs rhs ->
match lhs, rhs with
Expand Down
6 changes: 3 additions & 3 deletions test/blackbox-tests/test-cases/pkg/implicit-dune-constraint.t
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@ Create a fake project and ensure `dune` can be used as a dependency:
> (allow_empty)
> (depends dune))
> EOF
$ dune pkg lock 2>&1 | head -2
Internal error, please report upstream including the contents of _build/log.
Description:
$ dune pkg lock
Solution for dune.lock:
(no dependencies to lock)

0 comments on commit 57f2e02

Please sign in to comment.