this repo has no description

Simplify interface, and add execute field

+98 -245
+1 -3
example/example.ml
··· 12 12 W.init rpc 13 13 Toplevel_api_gen. 14 14 { 15 - path = "/static/cmis"; 16 - cmas = []; 17 - cmis = { dynamic_cmis = []; static_cmis = [] }; 18 15 stdlib_dcs = "/lib/ocaml/dynamic_cmis.json"; 19 16 findlib_index = "/lib/findlib_index"; 20 17 findlib_requires = [ "astring" ]; 18 + execute = true; 21 19 } 22 20 in 23 21 Lwt.return (Ok rpc)
+1 -19
example/example2.ml
··· 3 3 open Js_top_worker_rpc 4 4 module W = Js_top_worker_client.W 5 5 6 - let dcs = 7 - Js_top_worker_rpc.Toplevel_api_gen. 8 - { 9 - dcs_url = "cmis/"; 10 - dcs_toplevel_modules = 11 - [ 12 - "CamlinternalOO"; 13 - "Stdlib"; 14 - "CamlinternalFormat"; 15 - "Std_exit"; 16 - "CamlinternalMod"; 17 - "CamlinternalFormatBasics"; 18 - "CamlinternalLazy"; 19 - ]; 20 - dcs_file_prefixes = [ "stdlib__" ]; 21 - } 22 6 23 7 let log s = Console.console##log (Js.string s) 24 8 ··· 29 13 W.init rpc 30 14 Toplevel_api_gen. 31 15 { 32 - path = "/static/cmis"; 33 - cmas = []; 34 - cmis = { dynamic_cmis = [ dcs ]; static_cmis = [] }; 35 16 stdlib_dcs = "/lib/ocaml/dynamic_cmis.json"; 36 17 findlib_index = "/lib/findlib_index"; 37 18 findlib_requires = []; 19 + execute = true; 38 20 } 39 21 in 40 22 Lwt.return (Ok rpc)
+1 -19
example/example3.ml
··· 3 3 open Js_top_worker_rpc 4 4 module W = Js_top_worker_client.W 5 5 6 - let dcs = 7 - Js_top_worker_rpc.Toplevel_api_gen. 8 - { 9 - dcs_url = "cmis/"; 10 - dcs_toplevel_modules = 11 - [ 12 - "CamlinternalOO"; 13 - "Stdlib"; 14 - "CamlinternalFormat"; 15 - "Std_exit"; 16 - "CamlinternalMod"; 17 - "CamlinternalFormatBasics"; 18 - "CamlinternalLazy"; 19 - ]; 20 - dcs_file_prefixes = [ "stdlib__" ]; 21 - } 22 6 23 7 let log s = Console.console##log (Js.string s) 24 8 ··· 29 13 W.init rpc 30 14 Toplevel_api_gen. 31 15 { 32 - path = "/static/cmis"; 33 - cmas = []; 34 - cmis = { dynamic_cmis = [ dcs ]; static_cmis = [] }; 35 16 stdlib_dcs = "/lib/ocaml/dynamic_cmis.json"; 36 17 findlib_index = "/lib/findlib_index"; 37 18 findlib_requires = []; 19 + execute = true; 38 20 } 39 21 in 40 22 Lwt.return (Ok rpc)
+1 -20
example/example4.ml
··· 3 3 open Js_top_worker_rpc 4 4 module W = Js_top_worker_client.W 5 5 6 - let dcs = 7 - Js_top_worker_rpc.Toplevel_api_gen. 8 - { 9 - dcs_url = "cmis/"; 10 - dcs_toplevel_modules = 11 - [ 12 - "CamlinternalOO"; 13 - "Stdlib"; 14 - "CamlinternalFormat"; 15 - "Std_exit"; 16 - "CamlinternalMod"; 17 - "CamlinternalFormatBasics"; 18 - "CamlinternalLazy"; 19 - ]; 20 - dcs_file_prefixes = [ "stdlib__" ]; 21 - } 22 - 23 6 let log s = Console.console##log (Js.string s) 24 7 25 8 let initialise s callback = ··· 29 12 W.init rpc 30 13 Toplevel_api_gen. 31 14 { 32 - path = "/static/cmis"; 33 - cmas = []; 34 - cmis = { dynamic_cmis = [ dcs ]; static_cmis = [] }; 35 15 stdlib_dcs = "/lib/ocaml/dynamic_cmis.json"; 36 16 findlib_index = "/lib/findlib_index"; 37 17 findlib_requires = []; 18 + execute = true; 38 19 } 39 20 in 40 21 Lwt.return (Ok rpc)
+1 -1
example/unix_worker.ml
··· 117 117 let findlib_init _ = () 118 118 let get_stdlib_dcs _uri = [] 119 119 120 - let require () packages = 120 + let require _ () packages = 121 121 try 122 122 let eff_packages = 123 123 Findlib.package_deep_ancestors !Topfind.predicates packages
+3 -3
idl/js_top_worker_client.ml
··· 68 68 module Wraw = Toplevel_api_gen.Make (Rpc_lwt.GenClient ()) 69 69 70 70 module W : sig 71 - type init_libs = Toplevel_api_gen.init_libs 71 + type init_config = Toplevel_api_gen.init_config 72 72 type err = Toplevel_api_gen.err 73 73 type exec_result = Toplevel_api_gen.exec_result 74 74 75 75 val init : 76 76 rpc -> 77 - Toplevel_api_gen.init_libs -> 77 + Toplevel_api_gen.init_config -> 78 78 (unit, Toplevel_api_gen.err) result Lwt.t 79 79 80 80 val setup : ··· 105 105 string -> 106 106 (string, Toplevel_api_gen.err) result Lwt.t 107 107 end = struct 108 - type init_libs = Toplevel_api_gen.init_libs 108 + type init_config = Toplevel_api_gen.init_config 109 109 type err = Toplevel_api_gen.err 110 110 type exec_result = Toplevel_api_gen.exec_result 111 111
+2 -2
idl/js_top_worker_client.mli
··· 24 24 25 25 The following types are redeclared here for convenience. *) 26 26 27 - type init_libs = Toplevel_api_gen.init_libs 27 + type init_config = Toplevel_api_gen.init_config 28 28 type err = Toplevel_api_gen.err 29 29 type exec_result = Toplevel_api_gen.exec_result 30 30 ··· 35 35 worker by the timeout set in the {!val-start} call, the {!Lwt} thread will 36 36 be {{!Lwt.fail}failed}. *) 37 37 38 - val init : rpc -> init_libs -> (unit, err) result Lwt.t 38 + val init : rpc -> init_config -> (unit, err) result Lwt.t 39 39 (** Initialise the toplevel. This must be called before any other API. *) 40 40 41 41 val setup : rpc -> unit -> (exec_result, err) result Lwt.t
+1 -1
idl/js_top_worker_client_fut.ml
··· 73 73 module Wraw = Toplevel_api_gen.Make (Rpc_fut.GenClient ()) 74 74 75 75 module W = struct 76 - type init_libs = Toplevel_api_gen.init_libs 76 + type init_config = Toplevel_api_gen.init_config 77 77 type err = Toplevel_api_gen.err 78 78 type exec_result = Toplevel_api_gen.exec_result 79 79
+8 -5
idl/toplevel_api.ml
··· 183 183 } 184 184 [@@deriving rpcty] 185 185 186 - type init_libs = { path : string; cmis : cmis; cmas : cma list; findlib_index : string; findlib_requires : string list; stdlib_dcs : string } [@@deriving rpcty] 186 + type init_config = { 187 + findlib_index : string; (** URL to the findlib index file *) 188 + findlib_requires : string list; (** Findlib packages to require *) 189 + stdlib_dcs : string; (** URL to the dynamic cmis for the OCaml standard library *) 190 + execute : bool (** Whether this session should support execution or not. *) 191 + } [@@deriving rpcty] 187 192 type err = InternalError of string [@@deriving rpcty] 188 193 189 194 type opt_id = string option [@@deriving rpcty] ··· 241 246 Param.mk ~name:"init_libs" 242 247 ~description: 243 248 [ 244 - "Libraries to load during the initialisation of the toplevel. "; 245 - "If the stdlib cmis have not been compiled into the worker this "; 246 - "MUST include the urls from which they may be fetched"; 249 + "Configuration for the toplevel."; 247 250 ] 248 - init_libs 251 + init_config 249 252 250 253 let init = 251 254 declare "init"
+66 -102
idl/toplevel_api_gen.ml
··· 1969 1969 and _ = typ_of_cma 1970 1970 and _ = cma 1971 1971 end[@@ocaml.doc "@inline"][@@merlin.hide ] 1972 - type init_libs = 1972 + type init_config = 1973 1973 { 1974 - path: string ; 1975 - cmis: cmis ; 1976 - cmas: cma list ; 1977 - findlib_index: string ; 1978 - findlib_requires: string list ; 1979 - stdlib_dcs: string }[@@deriving rpcty] 1974 + findlib_index: string [@ocaml.doc " URL to the findlib index file "]; 1975 + findlib_requires: string list [@ocaml.doc " Findlib packages to require "]; 1976 + stdlib_dcs: string 1977 + [@ocaml.doc " URL to the dynamic cmis for the OCaml standard library "]; 1978 + execute: bool 1979 + [@ocaml.doc " Whether this session should support execution or not. "]} 1980 + [@@deriving rpcty] 1980 1981 include 1981 1982 struct 1982 - let _ = fun (_ : init_libs) -> () 1983 - let rec init_libs_path : (_, init_libs) Rpc.Types.field = 1984 - { 1985 - Rpc.Types.fname = "path"; 1986 - Rpc.Types.field = (let open Rpc.Types in Basic String); 1987 - Rpc.Types.fdefault = None; 1988 - Rpc.Types.fdescription = []; 1989 - Rpc.Types.fversion = None; 1990 - Rpc.Types.fget = (fun _r -> _r.path); 1991 - Rpc.Types.fset = (fun v _s -> { _s with path = v }) 1992 - } 1993 - and init_libs_cmis : (_, init_libs) Rpc.Types.field = 1994 - { 1995 - Rpc.Types.fname = "cmis"; 1996 - Rpc.Types.field = typ_of_cmis; 1997 - Rpc.Types.fdefault = None; 1998 - Rpc.Types.fdescription = []; 1999 - Rpc.Types.fversion = None; 2000 - Rpc.Types.fget = (fun _r -> _r.cmis); 2001 - Rpc.Types.fset = (fun v _s -> { _s with cmis = v }) 2002 - } 2003 - and init_libs_cmas : (_, init_libs) Rpc.Types.field = 2004 - { 2005 - Rpc.Types.fname = "cmas"; 2006 - Rpc.Types.field = (Rpc.Types.List typ_of_cma); 2007 - Rpc.Types.fdefault = None; 2008 - Rpc.Types.fdescription = []; 2009 - Rpc.Types.fversion = None; 2010 - Rpc.Types.fget = (fun _r -> _r.cmas); 2011 - Rpc.Types.fset = (fun v _s -> { _s with cmas = v }) 2012 - } 2013 - and init_libs_findlib_index : (_, init_libs) Rpc.Types.field = 1983 + let _ = fun (_ : init_config) -> () 1984 + let rec init_config_findlib_index : (_, init_config) Rpc.Types.field = 2014 1985 { 2015 1986 Rpc.Types.fname = "findlib_index"; 2016 1987 Rpc.Types.field = (let open Rpc.Types in Basic String); 2017 1988 Rpc.Types.fdefault = None; 2018 - Rpc.Types.fdescription = []; 1989 + Rpc.Types.fdescription = ["URL to the findlib index file"]; 2019 1990 Rpc.Types.fversion = None; 2020 1991 Rpc.Types.fget = (fun _r -> _r.findlib_index); 2021 1992 Rpc.Types.fset = (fun v _s -> { _s with findlib_index = v }) 2022 1993 } 2023 - and init_libs_findlib_requires : (_, init_libs) Rpc.Types.field = 1994 + and init_config_findlib_requires : (_, init_config) Rpc.Types.field = 2024 1995 { 2025 1996 Rpc.Types.fname = "findlib_requires"; 2026 1997 Rpc.Types.field = 2027 1998 (Rpc.Types.List (let open Rpc.Types in Basic String)); 2028 1999 Rpc.Types.fdefault = None; 2029 - Rpc.Types.fdescription = []; 2000 + Rpc.Types.fdescription = ["Findlib packages to require"]; 2030 2001 Rpc.Types.fversion = None; 2031 2002 Rpc.Types.fget = (fun _r -> _r.findlib_requires); 2032 2003 Rpc.Types.fset = (fun v _s -> { _s with findlib_requires = v }) 2033 2004 } 2034 - and init_libs_stdlib_dcs : (_, init_libs) Rpc.Types.field = 2005 + and init_config_stdlib_dcs : (_, init_config) Rpc.Types.field = 2035 2006 { 2036 2007 Rpc.Types.fname = "stdlib_dcs"; 2037 2008 Rpc.Types.field = (let open Rpc.Types in Basic String); 2038 2009 Rpc.Types.fdefault = None; 2039 - Rpc.Types.fdescription = []; 2010 + Rpc.Types.fdescription = 2011 + ["URL to the dynamic cmis for the OCaml standard library"]; 2040 2012 Rpc.Types.fversion = None; 2041 2013 Rpc.Types.fget = (fun _r -> _r.stdlib_dcs); 2042 2014 Rpc.Types.fset = (fun v _s -> { _s with stdlib_dcs = v }) 2043 2015 } 2044 - and typ_of_init_libs = 2016 + and init_config_execute : (_, init_config) Rpc.Types.field = 2017 + { 2018 + Rpc.Types.fname = "execute"; 2019 + Rpc.Types.field = (let open Rpc.Types in Basic Bool); 2020 + Rpc.Types.fdefault = None; 2021 + Rpc.Types.fdescription = 2022 + ["Whether this session should support execution or not."]; 2023 + Rpc.Types.fversion = None; 2024 + Rpc.Types.fget = (fun _r -> _r.execute); 2025 + Rpc.Types.fset = (fun v _s -> { _s with execute = v }) 2026 + } 2027 + and typ_of_init_config = 2045 2028 Rpc.Types.Struct 2046 2029 ({ 2047 2030 Rpc.Types.fields = 2048 - [Rpc.Types.BoxedField init_libs_path; 2049 - Rpc.Types.BoxedField init_libs_cmis; 2050 - Rpc.Types.BoxedField init_libs_cmas; 2051 - Rpc.Types.BoxedField init_libs_findlib_index; 2052 - Rpc.Types.BoxedField init_libs_findlib_requires; 2053 - Rpc.Types.BoxedField init_libs_stdlib_dcs]; 2054 - Rpc.Types.sname = "init_libs"; 2031 + [Rpc.Types.BoxedField init_config_findlib_index; 2032 + Rpc.Types.BoxedField init_config_findlib_requires; 2033 + Rpc.Types.BoxedField init_config_stdlib_dcs; 2034 + Rpc.Types.BoxedField init_config_execute]; 2035 + Rpc.Types.sname = "init_config"; 2055 2036 Rpc.Types.version = None; 2056 2037 Rpc.Types.constructor = 2057 2038 (fun getter -> 2058 2039 let open Rresult.R in 2059 - (getter.Rpc.Types.field_get "stdlib_dcs" 2060 - (let open Rpc.Types in Basic String)) 2040 + (getter.Rpc.Types.field_get "execute" 2041 + (let open Rpc.Types in Basic Bool)) 2061 2042 >>= 2062 - (fun init_libs_stdlib_dcs -> 2063 - (getter.Rpc.Types.field_get "findlib_requires" 2064 - (Rpc.Types.List 2065 - (let open Rpc.Types in Basic String))) 2043 + (fun init_config_execute -> 2044 + (getter.Rpc.Types.field_get "stdlib_dcs" 2045 + (let open Rpc.Types in Basic String)) 2066 2046 >>= 2067 - (fun init_libs_findlib_requires -> 2068 - (getter.Rpc.Types.field_get "findlib_index" 2069 - (let open Rpc.Types in Basic String)) 2047 + (fun init_config_stdlib_dcs -> 2048 + (getter.Rpc.Types.field_get "findlib_requires" 2049 + (Rpc.Types.List 2050 + (let open Rpc.Types in Basic String))) 2070 2051 >>= 2071 - (fun init_libs_findlib_index -> 2072 - (getter.Rpc.Types.field_get "cmas" 2073 - (Rpc.Types.List typ_of_cma)) 2052 + (fun init_config_findlib_requires -> 2053 + (getter.Rpc.Types.field_get "findlib_index" 2054 + (let open Rpc.Types in Basic String)) 2074 2055 >>= 2075 - (fun init_libs_cmas -> 2076 - (getter.Rpc.Types.field_get "cmis" 2077 - typ_of_cmis) 2078 - >>= 2079 - (fun init_libs_cmis -> 2080 - (getter.Rpc.Types.field_get "path" 2081 - (let open Rpc.Types in 2082 - Basic String)) 2083 - >>= 2084 - (fun init_libs_path -> 2085 - return 2086 - { 2087 - path = init_libs_path; 2088 - cmis = init_libs_cmis; 2089 - cmas = init_libs_cmas; 2090 - findlib_index = 2091 - init_libs_findlib_index; 2092 - findlib_requires = 2093 - init_libs_findlib_requires; 2094 - stdlib_dcs = 2095 - init_libs_stdlib_dcs 2096 - }))))))) 2097 - } : init_libs Rpc.Types.structure) 2098 - and init_libs = 2056 + (fun init_config_findlib_index -> 2057 + return 2058 + { 2059 + findlib_index = 2060 + init_config_findlib_index; 2061 + findlib_requires = 2062 + init_config_findlib_requires; 2063 + stdlib_dcs = init_config_stdlib_dcs; 2064 + execute = init_config_execute 2065 + }))))) 2066 + } : init_config Rpc.Types.structure) 2067 + and init_config = 2099 2068 { 2100 - Rpc.Types.name = "init_libs"; 2069 + Rpc.Types.name = "init_config"; 2101 2070 Rpc.Types.description = []; 2102 - Rpc.Types.ty = typ_of_init_libs 2071 + Rpc.Types.ty = typ_of_init_config 2103 2072 } 2104 - let _ = init_libs_path 2105 - and _ = init_libs_cmis 2106 - and _ = init_libs_cmas 2107 - and _ = init_libs_findlib_index 2108 - and _ = init_libs_findlib_requires 2109 - and _ = init_libs_stdlib_dcs 2110 - and _ = typ_of_init_libs 2111 - and _ = init_libs 2073 + let _ = init_config_findlib_index 2074 + and _ = init_config_findlib_requires 2075 + and _ = init_config_stdlib_dcs 2076 + and _ = init_config_execute 2077 + and _ = typ_of_init_config 2078 + and _ = init_config 2112 2079 end[@@ocaml.doc "@inline"][@@merlin.hide ] 2113 2080 type err = 2114 2081 | InternalError of string [@@deriving rpcty] ··· 2227 2194 let exec_toplevel_result_p = Param.mk exec_toplevel_result 2228 2195 let init_libs = 2229 2196 Param.mk ~name:"init_libs" 2230 - ~description:["Libraries to load during the initialisation of the toplevel. "; 2231 - "If the stdlib cmis have not been compiled into the worker this "; 2232 - "MUST include the urls from which they may be fetched"] 2233 - init_libs 2197 + ~description:["Configuration for the toplevel."] init_config 2234 2198 let init = 2235 2199 declare "init" 2236 2200 ["Initialise the toplevel. This must be called before any other API."]
+2 -2
lib/findlibish.ml
··· 150 150 None) 151 151 metas |> flatten_libs 152 152 153 - let require v packages = 153 + let require cmi_only v packages = 154 154 let rec require dcss package : 155 155 Js_top_worker_rpc.Toplevel_api_gen.dynamic_cmis list = 156 156 match List.find (fun lib -> lib.name = package) v with ··· 179 179 let archive_js = 180 180 Fpath.(dir / (archive ^ ".cma.js") |> to_string) 181 181 in 182 - if List.mem lib.name preloaded then () 182 + if List.mem lib.name preloaded || cmi_only then () 183 183 else 184 184 Js_of_ocaml.Worker.import_scripts 185 185 [ Uri.with_path uri archive_js |> Uri.to_string ];
+5 -24
lib/impl.ml
··· 96 96 val init_function : string -> unit -> unit 97 97 val get_stdlib_dcs : string -> Toplevel_api_gen.dynamic_cmis list 98 98 val findlib_init : string -> findlib_t 99 - val require : findlib_t -> string list -> Toplevel_api_gen.dynamic_cmis list 99 + val require : bool -> findlib_t -> string list -> Toplevel_api_gen.dynamic_cmis list 100 100 end 101 101 102 102 module Make (S : S) = struct ··· 104 104 let requires : string list ref = ref [] 105 105 let path : string option ref = ref None 106 106 let findlib_v : S.findlib_t option ref = ref None 107 + let execution_allowed = ref true 107 108 108 109 let refill_lexbuf s p ppf buffer len = 109 110 if !p = String.length s then 0 ··· 338 339 let old_loader = !load in 339 340 load := new_load ~s:"merl" ~old_loader 340 341 341 - let init (init_libs : Toplevel_api_gen.init_libs) = 342 + let init (init_libs : Toplevel_api_gen.init_config) = 342 343 try 343 344 Logs.info (fun m -> m "init()"); 344 - path := Some init_libs.path; 345 + path := Some "/static/cmis"; 345 346 346 347 findlib_v := Some (S.findlib_init init_libs.findlib_index); 347 348 ··· 349 350 | [ dcs ] -> add_dynamic_cmis dcs 350 351 | _ -> ()); 351 352 Clflags.no_check_prims := true; 352 - List.iter 353 - (fun { Toplevel_api_gen.sc_name; sc_content } -> 354 - let filename = 355 - Printf.sprintf "%s.cmi" (String.uncapitalize_ascii sc_name) 356 - in 357 - let name = Filename.(concat init_libs.path filename) in 358 - S.create_file ~name ~content:sc_content) 359 - init_libs.cmis.static_cmis; 360 - List.iter add_dynamic_cmis init_libs.cmis.dynamic_cmis; 361 - 362 - S.import_scripts 363 - (List.map (fun cma -> cma.Toplevel_api_gen.url) init_libs.cmas); 364 353 365 354 requires := init_libs.findlib_requires; 366 - functions := 367 - Some 368 - (List.map 369 - (fun func_name -> 370 - Logs.info (fun m -> m "Function: %s" func_name); 371 - S.init_function func_name) 372 - (List.map (fun cma -> cma.Toplevel_api_gen.fn) init_libs.cmas)); 373 - (* *) 374 355 functions := Some []; 375 356 Logs.info (fun m -> m "init() finished"); 376 357 ··· 400 381 in 401 382 402 383 let dcs = 403 - match !findlib_v with Some v -> S.require v !requires | None -> [] 384 + match !findlib_v with Some v -> S.require (not !execution_allowed) v !requires | None -> [] 404 385 in 405 386 List.iter add_dynamic_cmis dcs; 406 387
+2 -2
lib/worker.ml
··· 57 57 let import_scripts = Js_of_ocaml.Worker.import_scripts 58 58 let findlib_init = Findlibish.init 59 59 60 - let require v = function 60 + let require b v = function 61 61 | [] -> [] 62 - | packages -> Findlibish.require v packages 62 + | packages -> Findlibish.require b v packages 63 63 64 64 let init_function func_name = 65 65 let open Js_of_ocaml in
+2 -21
test/node/node_test.ml
··· 44 44 let findlib_init _ = () 45 45 let get_stdlib_dcs _uri = [] 46 46 47 - let require () packages = 47 + let require _ () packages = 48 48 try 49 49 let eff_packages = 50 50 Findlib.package_deep_ancestors !Topfind.predicates packages ··· 96 96 let rpc = start_server () in 97 97 Printf.printf "Starting worker...\n%!"; 98 98 let ( let* ) = IdlM.ErrM.bind in 99 - let dcs = 100 - Js_top_worker_rpc.Toplevel_api_gen. 101 - { 102 - dcs_url = "cmis/"; 103 - dcs_toplevel_modules = 104 - [ 105 - "CamlinternalOO"; 106 - "Stdlib"; 107 - "CamlinternalFormat"; 108 - "Std_exit"; 109 - "CamlinternalMod"; 110 - "CamlinternalFormatBasics"; 111 - "CamlinternalLazy"; 112 - ]; 113 - dcs_file_prefixes = [ "stdlib__" ]; 114 - } 115 - in 116 99 let init = 117 100 Js_top_worker_rpc.Toplevel_api_gen. 118 101 { 119 - path = "/tmp/static/cmis"; 120 - cmas = []; 121 - cmis = { dynamic_cmis = [ dcs ]; static_cmis = [] }; 122 102 stdlib_dcs = "/lib/ocaml/dynamic_cmis.json"; 123 103 findlib_index = "/lib/findlib_index"; 124 104 findlib_requires = []; 105 + execute = true; 125 106 } 126 107 in 127 108 let x =
+2 -21
test/unix/unix_test.ml
··· 75 75 let findlib_init _ = () 76 76 let get_stdlib_dcs _uri = [] 77 77 78 - let require () packages = 78 + let require _ () packages = 79 79 try 80 80 let eff_packages = 81 81 Findlib.package_deep_ancestors !Topfind.predicates packages ··· 127 127 let rpc = start_server () in 128 128 Printf.printf "Starting worker...\n%!"; 129 129 let ( let* ) = IdlM.ErrM.bind in 130 - let dcs = 131 - Js_top_worker_rpc.Toplevel_api_gen. 132 - { 133 - dcs_url = "cmis/"; 134 - dcs_toplevel_modules = 135 - [ 136 - "CamlinternalOO"; 137 - "Stdlib"; 138 - "CamlinternalFormat"; 139 - "Std_exit"; 140 - "CamlinternalMod"; 141 - "CamlinternalFormatBasics"; 142 - "CamlinternalLazy"; 143 - ]; 144 - dcs_file_prefixes = [ "stdlib__" ]; 145 - } 146 - in 147 130 let init = 148 131 Js_top_worker_rpc.Toplevel_api_gen. 149 132 { 150 - path = "/tmp/static/cmis"; 151 - cmas = []; 152 - cmis = { dynamic_cmis = [ dcs ]; static_cmis = [] }; 153 133 stdlib_dcs = "/lib/ocaml/dynamic_cmis.json"; 154 134 findlib_index = "/lib/findlib_index"; 155 135 findlib_requires = []; 136 + execute = true; 156 137 } 157 138 in 158 139 let x =