I encountered the following error while using utop to play with a small library of mine.
Fatal error: exception Persistent_env.Error(_)
I am not sure whether this issue is related to dune-utop
, utop
or even OCaml itself. I created a tiny project in which the problem can be easily replicated: dune-utop-bug.zip. It consists of only two files:
dune:
(library
(name bug)
(libraries interval_crlibm))
bug.ml:
let zero_interval = Interval.I.zero
let zero = zero_interval.Interval.low
I can start utop by running dune utop .
. Then, I am having the following interaction with utop, resulting in the error I mentioned:
β( 17:42:26 )β< command 0 >ββββββββββββββββββββββββββββββββββββββββββββββββββββ{ counter: 0 }β
utop # Bug.zero;;
- : float = 0.
β( 17:42:26 )β< command 1 >ββββββββββββββββββββββββββββββββββββββββββββββββββββ{ counter: 0 }β
utop # open Interval;;
Line 1:
Error: The files /home/jonathan/neurarith/_build/default/snippets/dune-utop-bug/.utop/utop.exe
and /home/jonathan/.opam/default/lib/ocaml/compiler-libs/interval.cmi
make inconsistent assumptions over interface Interval
β( 17:42:38 )β< command 2 >ββββββββββββββββββββββββββββββββββββββββββββββββ--ββ{ counter: 0 }β
utop # Bug.zero_interval;;
Fatal error: exception Persistent_env.Error(_)
This seems to be related to utop confusing two completely different Interval
modules. Can someone tell me more about whatβs happening here? Do you have a workaround? Also, please tell me if I should post this somewhere else.
Configuration: I am using OCaml 4.11.1 with dune 2.7.1.