Sudha247 / ocaml-joy

MIT License
21 stars 14 forks source link

Unable to load `joy` on utop #89

Open Sudha247 opened 6 months ago

Sudha247 commented 6 months ago

Trying to load joy on utop throws this error:

#require "joy";;
The files /home/sudha/.opam/5.1.0/lib/joy/joy.cma
and /home/sudha/.opam/5.1.0/lib/ocaml/compiler-libs/toploop.cmi
disagree over interface Shape
FayCarsons commented 5 months ago

I ran into this problem while preparing for my presentation. It seems like the solution is to rename Shape to something else (not Primitive, tried that and it doesn't work either). Suggestions?

nikochiko commented 4 months ago

Think this might have to do with (wrapped false) in dune.

It exposes all modules to the top-level.

Dune doc recommends against it for this exact reason:

(wrapped ) specifies whether the library modules should be available only through the top-level library module, or if they should all be exposed at the top level. The default is true, and it’s highly recommended to keep it this way. Because OCaml top-level modules must all be unique when linking an executables, polluting the top-level namespace will make your library unusable with other libraries if there is a module name clash. This option is only intended for libraries that manually prefix all their modules by the library name and to ease porting of existing projects to Dune.