Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dune dependency error with dune pkg lock #11096

Closed
maiste opened this issue Nov 4, 2024 · 0 comments · Fixed by #11103
Closed

dune dependency error with dune pkg lock #11096

maiste opened this issue Nov 4, 2024 · 0 comments · Fixed by #11103

Comments

@maiste
Copy link
Collaborator

maiste commented Nov 4, 2024

The #10918 introduced a bug or a regression in the way the dune pkg lock command work. I checked and the behavior wasn't present in the commit before.

Expected Behavior

When running a project with dune in the depends stanza of a dune-project file, it should build without any error. It was the previous behaviour before the mentioned PR.

Actual Behavior

The computation fails, and it prints the following stack trace:

Internal error, please report upstream including the contents of _build/log.
Description:
  ("can't find a valid solution for the dependencies", { name = "foo" })
Raised at Stdune__Code_error.raise in file
  "otherlibs/stdune/src/code_error.ml", line 10, characters 30-62
Called from Dune_pkg__Opam_solver.reject_unreachable_packages.(fun) in file
  "src/dune_pkg/opam_solver.ml", lines 830-832, characters 14-56
Called from Stdlib__Map.Make.merge in file "map.ml", line 406, characters
  44-63
Called from Stdlib__Map.Make.merge in file "map.ml", line 403, characters
  64-79
Called from Stdlib__Map.Make.merge in file "map.ml", line 403, characters
  25-40
Called from Stdlib__Map.Make.merge in file "map.ml", line 403, characters
  25-40
Called from Stdlib__Map.Make.merge in file "map.ml", line 403, characters
  64-79
Called from Dune_pkg__Opam_solver.reject_unreachable_packages.(fun) in file
  "src/dune_pkg/opam_solver.ml", lines 802-841, characters 6-32
Called from Dune_pkg__Opam_solver.solve_lock_dir.(fun) in file
  "src/dune_pkg/opam_solver.ml", line 949, characters 10-78
Called from Fiber__Scheduler.exec in file "vendor/fiber/src/scheduler.ml",
  line 76, characters 8-11
Re-raised at Stdune__Exn.raise_with_backtrace in file
  "otherlibs/stdune/src/exn.ml", line 38, characters 27-56
Called from Fiber__Scheduler.exec in file "vendor/fiber/src/scheduler.ml",
  line 76, characters 8-11

I must not crash.  Uncertainty is the mind-killer. Exceptions are the
little-death that brings total obliteration.  I will fully express my cases. 
Execution will pass over me and through me.  And when it has gone past, I
will unwind the stack along its path.  Where the cases are handled there will
be nothing.  Only I will remain.

Reproduction

You can find some logs in the binary distribution preview test: https://github.com/ocaml-dune/binary-distribution/actions/runs/11656938519/job/32453884724#step:7:49

Otherwise, to reproduce, you just need to run with an executable of dune build from main:

dune init proj foo 
cd foo
dune pkg lock

If you remove the dune dependency from the (depends ...) stanza of the dune-project file, it will work without error.

maiste added a commit to maiste/dune that referenced this issue Nov 4, 2024
Signed-off-by: Etienne Marais <dev@maiste.fr>
rgrinberg pushed a commit to maiste/dune that referenced this issue Nov 5, 2024
Signed-off-by: Etienne Marais <dev@maiste.fr>
rgrinberg pushed a commit that referenced this issue Nov 5, 2024
Signed-off-by: Etienne Marais <dev@maiste.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant