dune icon indicating copy to clipboard operation
dune copied to clipboard

pkg: `dune pkg lock` raises a code error if you try to name a repository "upstream"

Open gridbugs opened this issue 1 year ago • 3 comments

My dune-workspace:

(lang dune 3.15)

(lock_dir
 (repositories upstream))

(repository
 (name upstream)
 (source "git+https://github.com/ocaml/opam-repository"))

Running dune pkg lock gives the error:

Internal error, please report upstream including the contents of _build/log.
Description:
  ("Map.of_list_exn", { key = "upstream" })
Raised at Stdune__Code_error.raise in file
  "otherlibs/stdune/src/code_error.ml", line 10, characters 30-62
Called from Dune__exe__Lock.solve_lock_dir in file "bin/pkg/lock.ml", line
  53, characters 4-39
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.

gridbugs avatar Jun 04 '24 14:06 gridbugs

I did notice that also when I wanted to override upstream. What I didn't understand is why during the solve dune is adding upstream and overlay when an user start declaring some repository in the dune-workspace ?

moyodiallo avatar Jun 06 '24 19:06 moyodiallo

This should be changed to give a proper error message. Dune reserves two repository names at the moment

rgrinberg avatar Jun 07 '24 19:06 rgrinberg

I did notice that also when I wanted to override upstream. What I didn't understand is why during the solve dune is adding upstream and overlay when an user start declaring some repository in the dune-workspace ?

My change was misleading me #10613 when testing it. Of course the config of repositories in dune-workspace overrides the default ones upstream and overlay.

moyodiallo avatar Jun 10 '24 17:06 moyodiallo

This seems to have been fixed with #12548

punchagan avatar Nov 03 '25 11:11 punchagan