I am looking at the following project. It seems like it would be cool to port it to OCaml 5, and the authors have had difficulties with the transition, apparently because of the tight integration with internals of the toplevel.
When I try to build the following project, I get an error in the file src/core/shell.ml
saying that in the following code,
type exec_request =
{
exec_code : string [@key "code"];
exec_silent : bool [@key "silent"];
exec_store_history : bool [@key "store_history"];
exec_user_expr : Json.t [@key "user_expressions"];
exec_allow_stdin : bool [@key "allow_stdin"] [@default true];
exec_stop_on_error : bool [@key "stop_on_error"] [@default false];
} [@@deriving yojson]
[@@yojson.allow_extra_fields]
there are unbound values string_of_yojson
, bool_of_yojson
, etc.
Clearly the macro system is resolving these annotations into calls from these functions in the ppx_yojson_conv_lib
library, which cannot be found.
If I add open Ppx_yojson_conv_lib.Yojson_conv
at the top of the file, the problem is fixed.
To me, this makes sense. We cannot access names that are not in scope.
My question is, how did the original author get this to compile in the first place without opening these namespaces? Is there something in the deriving libraries, or a configuration setting in dune etc., that would allow you to automatically open certain namespaces globally throughout a project?