Description: fix compilation with dune 3.24 Author: upstream Forwarded: yes --- coq.orig/boot/dune +++ coq/boot/dune @@ -7,7 +7,3 @@ ; until ocaml/dune#4892 fixed ; (private_modules util) (libraries rocq-runtime.config rocq-runtime.clib)) - -(deprecated_library_name - (old_public_name coq-core.boot) - (new_public_name rocq-runtime.boot)) --- coq.orig/boot/env.ml +++ coq/boot/env.ml @@ -64,9 +64,36 @@ | Some p -> p | None -> canonical_path_name (Filename.dirname Sys.executable_name) +(** Locate the dune workspace root containing the given path, if any. *) +let dune_workspace_root : string -> string option = fun path -> + let rec workspace_root path = + let parent = Filename.dirname path in + if parent = path then + None + else if Filename.basename path = "_build" then + Some parent + else + workspace_root parent + in + match workspace_root path with + | None -> None + | Some root -> + (* Check that this indeed looks like a dune workspace. *) + let ok = + let has file = Sys.file_exists (Filename.concat root file) in + List.exists has ["dune-project"; "dune-workspace"] + in + if ok then Some root else None + (** The following only makes sense when executables are running from source tree (e.g. during build or in local mode). *) let rocqroot = + match dune_workspace_root rocqbin with + | Some dir -> + let dir = Filename.concat dir "_build" in + let dir = Filename.concat dir "install" in + Filename.concat dir "default" + | None -> let rec search = function | [] -> (* couldn't recognize the layout, guess the executable is 1 dir below the root --- coq.orig/checker/dune +++ coq/checker/dune @@ -10,10 +10,6 @@ (wrapped true) (libraries rocq-runtime.boot rocq-runtime.kernel)) -(deprecated_library_name - (old_public_name coq-core.checklib) - (new_public_name rocq-runtime.checklib)) - (executable (name rocqchk) (public_name rocqchk) --- coq.orig/clib/dune +++ coq/clib/dune @@ -11,10 +11,6 @@ (memprof-limits -> memprof_coq.memprof.ml)) str unix threads)) -(deprecated_library_name - (old_public_name coq-core.clib) - (new_public_name rocq-runtime.clib)) - (executable (name unicodetable_gen) (modules unicodetable_gen)) --- coq.orig/config/dune +++ coq/config/dune @@ -5,10 +5,6 @@ (modules coq_config) (wrapped false)) -(deprecated_library_name - (old_public_name coq-core.config) - (new_public_name rocq-runtime.config)) - (library (name byte_config) (synopsis "Rocq Configuration Variables (for bytecode only)") @@ -18,10 +14,6 @@ (libraries compiler-libs.toplevel) (modes byte)) -(deprecated_library_name - (old_public_name coq-core.config.byte) - (new_public_name rocq-runtime.config.byte)) - (executable (name list_plugins) (modules list_plugins)) (rule (targets plugin_list) (deps (source_tree %{project_root}/plugins)) --- coq.orig/dev/dune +++ coq/dev/dune @@ -58,11 +58,4 @@ (install (section lib) (package rocq-runtime) - (files - (ml_toplevel/include as dev/ml_toplevel/include) - (ml_toplevel/include_directories as dev/ml_toplevel/include_directories) - (ml_toplevel/include_printers as dev/ml_toplevel/include_printers) - (ml_toplevel/include_utilities as dev/ml_toplevel/include_utilities))) -; TODO: the above can be written as follow: -; (files (glob_files (ml_toplevel/** with_prefix dev))) -; , but this is only possible with dune language 3.11 or later + (files (glob_files (ml_toplevel/** with_prefix dev/ml_toplevel)))) --- coq.orig/dune +++ coq/dune @@ -1,7 +1,8 @@ ; Default flags for all Rocq libraries. (env - (dev (flags :standard -w -9-27@60-69@70 \ -short-paths) - (coq (flags :standard -w +default))) + ; cf explanation for warning settings in configure.ml + (dev (flags :standard -w +a-4-9-27-40..42-44-45-48-58-67-68-70 -warn-error +a \ -short-paths) + (rocq (flags :standard -w +default))) (release (flags :standard) (ocamlopt_flags :standard -O3 -unbox-closures)) (ireport (flags :standard -w -9-27+60-70) --- coq.orig/dune-project +++ coq/dune-project @@ -1,11 +1,11 @@ -(lang dune 3.8) +(lang dune 3.21) (name rocq-prover) ; We use directory targets in documentation (using directory-targets 0.1) ; We need this for when we use the dune.disabled files instead of our rule_gen -(using coq 0.8) +(using rocq 0.11) (formatting (enabled_for ocaml)) @@ -20,6 +20,7 @@ (homepage https://rocq-prover.org/) (documentation "https://rocq-prover.org/docs/") (version dev) +(maintenance_intent "(any)") ; Note that we use rocq-runtime.opam.template to have dune add the correct opam ; prefix for configure @@ -33,7 +34,7 @@ (conflicts (coq (< 8.17)) (coq-core (< 8.21))) - (depopts rocq-native memprof-limits memtrace) + (depopts rocq-native (memprof-limits (>= 0.3.0)) memtrace) (synopsis "The Rocq Prover -- Core Binaries and Tools") (description "The Rocq Prover is an interactive theorem prover, or proof assistant. It provides a formal language to write mathematical definitions, executable @@ -148,6 +149,7 @@ (package (name rocq-test-suite) + (allow_empty) (depends (rocq-core (= :version)) coqide-server --- coq.orig/engine/dune +++ coq/engine/dune @@ -6,7 +6,3 @@ ; until ocaml/dune#4892 fixed ; (private_modules univSubst) (libraries library)) - -(deprecated_library_name - (old_public_name coq-core.engine) - (new_public_name rocq-runtime.engine)) --- coq.orig/gramlib/dune +++ coq/gramlib/dune @@ -3,7 +3,3 @@ (public_name rocq-runtime.gramlib) (modules_without_implementation plexing) (libraries rocq-runtime.lib)) - -(deprecated_library_name - (old_public_name coq-core.gramlib) - (new_public_name rocq-runtime.gramlib)) --- coq.orig/interp/dune +++ coq/interp/dune @@ -5,7 +5,3 @@ (wrapped false) (modules_without_implementation constrexpr notation_term) (libraries zarith pretyping gramlib)) - -(deprecated_library_name - (old_public_name coq-core.interp) - (new_public_name rocq-runtime.interp)) --- coq.orig/kernel/byterun/dune +++ coq/kernel/byterun/dune @@ -7,10 +7,6 @@ (names rocq_fix_code rocq_float64 rocq_memory rocq_values rocq_interp) (flags :standard (:include %{project_root}/config/dune.c_flags)))) -(deprecated_library_name - (old_public_name coq-core.vm) - (new_public_name rocq-runtime.vm)) - (rule (targets rocq_instruct.h) (action (with-stdout-to %{targets} (run ../genOpcodeFiles.exe enum)))) --- coq.orig/kernel/dune +++ coq/kernel/dune @@ -7,6 +7,7 @@ (modules (:standard \ genOpcodeFiles uint63_31 uint63_63 float64_31 float64_63)) (libraries boot lib coqrun dynlink)) +; used by dune coq mode (deprecated_library_name (old_public_name coq-core.kernel) (new_public_name rocq-runtime.kernel)) --- coq.orig/lib/dune +++ coq/lib/dune @@ -5,11 +5,7 @@ (wrapped false) (modules_without_implementation xml_datatype) (libraries - rocq-runtime.boot rocq-runtime.clib rocq-runtime.config + rocq-runtime.boot rocq-runtime.clib rocq-runtime.config findlib (select instr.ml from (!coqperf -> instr.noperf.ml) (coqperf -> instr.perf.ml)))) - -(deprecated_library_name - (old_public_name coq-core.lib) - (new_public_name rocq-runtime.lib)) --- coq.orig/library/dune +++ coq/library/dune @@ -4,7 +4,3 @@ (public_name rocq-runtime.library) (wrapped false) (libraries kernel)) - -(deprecated_library_name - (old_public_name coq-core.library) - (new_public_name rocq-runtime.library)) --- coq.orig/parsing/dune +++ coq/parsing/dune @@ -5,10 +5,6 @@ (modules_without_implementation notation_gram) (libraries rocq-runtime.gramlib interp)) -(deprecated_library_name - (old_public_name coq-core.parsing) - (new_public_name rocq-runtime.parsing)) - (rule (targets g_prim.ml) (deps (:mlg g_prim.mlg)) --- coq.orig/perf/dune +++ coq/perf/dune @@ -12,7 +12,3 @@ (= %{system} "linux_eabihf") (= %{system} "linux_elf") (= %{system} "elf")))) - -(deprecated_library_name - (old_public_name coq-core.perf) - (new_public_name rocq-runtime.perf)) --- coq.orig/plugins/btauto/dune +++ coq/plugins/btauto/dune @@ -4,10 +4,6 @@ (synopsis "Rocq's btauto plugin") (libraries rocq-runtime.plugins.ltac)) -(deprecated_library_name - (old_public_name coq-core.plugins.btauto) - (new_public_name rocq-runtime.plugins.btauto)) - (rule (targets g_btauto.ml) (deps (:mlg g_btauto.mlg)) --- coq.orig/plugins/cc/dune +++ coq/plugins/cc/dune @@ -5,10 +5,6 @@ (modules (:standard \ g_congruence)) (libraries rocq-runtime.tactics)) -(deprecated_library_name - (old_public_name coq-core.plugins.cc_core) - (new_public_name rocq-runtime.plugins.cc_core)) - (library (name cc_plugin) (public_name rocq-runtime.plugins.cc) @@ -17,10 +13,6 @@ (flags :standard -open Cc_core_plugin) (libraries rocq-runtime.plugins.ltac rocq-runtime.plugins.cc_core)) -(deprecated_library_name - (old_public_name coq-core.plugins.cc) - (new_public_name rocq-runtime.plugins.cc)) - (rule (targets g_congruence.ml) (deps (:mlg g_congruence.mlg)) --- coq.orig/plugins/derive/dune +++ coq/plugins/derive/dune @@ -4,10 +4,6 @@ (synopsis "Rocq's derive plugin") (libraries rocq-runtime.vernac)) -(deprecated_library_name - (old_public_name coq-core.plugins.derive) - (new_public_name rocq-runtime.plugins.derive)) - (rule (targets g_derive.ml) (deps (:mlg g_derive.mlg)) --- coq.orig/plugins/extraction/dune +++ coq/plugins/extraction/dune @@ -4,10 +4,6 @@ (synopsis "Rocq's extraction plugin") (libraries rocq-runtime.vernac)) -(deprecated_library_name - (old_public_name coq-core.plugins.extraction) - (new_public_name rocq-runtime.plugins.extraction)) - (rule (targets g_extraction.ml) (deps (:mlg g_extraction.mlg)) --- coq.orig/plugins/firstorder/dune +++ coq/plugins/firstorder/dune @@ -5,10 +5,6 @@ (modules (:standard \ g_ground)) (libraries rocq-runtime.tactics)) -(deprecated_library_name - (old_public_name coq-core.plugins.firstorder_core) - (new_public_name rocq-runtime.plugins.firstorder_core)) - (library (name firstorder_plugin) (public_name rocq-runtime.plugins.firstorder) @@ -17,10 +13,6 @@ (modules g_ground) (libraries rocq-runtime.plugins.firstorder_core rocq-runtime.plugins.ltac)) -(deprecated_library_name - (old_public_name coq-core.plugins.firstorder) - (new_public_name rocq-runtime.plugins.firstorder)) - (rule (targets g_ground.ml) (deps (:mlg g_ground.mlg)) --- coq.orig/plugins/funind/dune +++ coq/plugins/funind/dune @@ -4,10 +4,6 @@ (synopsis "Rocq's functional induction plugin") (libraries rocq-runtime.plugins.ltac rocq-runtime.plugins.extraction)) -(deprecated_library_name - (old_public_name coq-core.plugins.funind) - (new_public_name rocq-runtime.plugins.funind)) - (rule (targets g_indfun.ml) (deps (:mlg g_indfun.mlg)) --- coq.orig/plugins/ltac/dune +++ coq/plugins/ltac/dune @@ -6,10 +6,6 @@ (modules_without_implementation tacexpr) (libraries rocq-runtime.vernac)) -(deprecated_library_name - (old_public_name coq-core.plugins.ltac) - (new_public_name rocq-runtime.plugins.ltac)) - (library (name tauto_plugin) (public_name rocq-runtime.plugins.tauto) @@ -17,10 +13,6 @@ (modules tauto) (libraries rocq-runtime.plugins.ltac)) -(deprecated_library_name - (old_public_name coq-core.plugins.tauto) - (new_public_name rocq-runtime.plugins.tauto)) - (rule (targets extratactics.ml) (deps (:mlg extratactics.mlg)) --- coq.orig/plugins/ltac2/dune +++ coq/plugins/ltac2/dune @@ -5,10 +5,6 @@ (modules_without_implementation tac2expr tac2qexpr tac2types) (libraries vernac rocq-runtime.plugins.cc_core)) -(deprecated_library_name - (old_public_name coq-core.plugins.ltac2) - (new_public_name rocq-runtime.plugins.ltac2)) - (rule (targets g_ltac2.ml) (deps (:mlg g_ltac2.mlg)) --- coq.orig/plugins/ltac2_ltac1/dune +++ coq/plugins/ltac2_ltac1/dune @@ -4,10 +4,6 @@ (synopsis "Ltac2 and Ltac1 interoperability plugin") (libraries ltac_plugin ltac2_plugin)) -(deprecated_library_name - (old_public_name coq-core.plugins.ltac2_ltac1) - (new_public_name rocq-runtime.plugins.ltac2_ltac1)) - (rule (targets g_ltac2_ltac1.ml) (deps (:mlg g_ltac2_ltac1.mlg)) --- coq.orig/plugins/micromega/dune +++ coq/plugins/micromega/dune @@ -5,10 +5,6 @@ (synopsis "Rocq's micromega core plugin") (libraries zarith rocq-runtime.clib)) -(deprecated_library_name - (old_public_name coq-core.plugins.micromega_core) - (new_public_name rocq-runtime.plugins.micromega_core)) - (library (name micromega_plugin) (public_name rocq-runtime.plugins.micromega) @@ -18,10 +14,6 @@ (synopsis "Rocq's micromega plugin") (libraries rocq-runtime.plugins.ltac rocq-runtime.plugins.micromega_core)) -(deprecated_library_name - (old_public_name coq-core.plugins.micromega) - (new_public_name rocq-runtime.plugins.micromega)) - (executable (name csdpcert) (public_name csdpcert) @@ -37,10 +29,6 @@ (synopsis "Rocq's zify plugin") (libraries rocq-runtime.plugins.ltac)) -(deprecated_library_name - (old_public_name coq-core.plugins.zify) - (new_public_name rocq-runtime.plugins.zify)) - (rule (targets g_micromega.ml) (deps (:mlg g_micromega.mlg)) --- coq.orig/plugins/nsatz/dune +++ coq/plugins/nsatz/dune @@ -5,10 +5,6 @@ (modules (:standard \ g_nsatz)) (libraries rocq-runtime.tactics)) -(deprecated_library_name - (old_public_name coq-core.plugins.nsatz_core) - (new_public_name rocq-runtime.plugins.nsatz_core)) - (library (name nsatz_plugin) (public_name rocq-runtime.plugins.nsatz) @@ -17,10 +13,6 @@ (flags :standard -open Nsatz_core_plugin) (libraries rocq-runtime.plugins.nsatz_core rocq-runtime.plugins.ltac)) -(deprecated_library_name - (old_public_name coq-core.plugins.nsatz) - (new_public_name rocq-runtime.plugins.nsatz)) - (rule (targets g_nsatz.ml) (deps (:mlg g_nsatz.mlg)) --- coq.orig/plugins/ring/dune +++ coq/plugins/ring/dune @@ -4,10 +4,6 @@ (synopsis "Rocq's ring plugin") (libraries rocq-runtime.plugins.ltac)) -(deprecated_library_name - (old_public_name coq-core.plugins.ring) - (new_public_name rocq-runtime.plugins.ring)) - (rule (targets g_ring.ml) (deps (:mlg g_ring.mlg)) --- coq.orig/plugins/rtauto/dune +++ coq/plugins/rtauto/dune @@ -4,10 +4,6 @@ (synopsis "Rocq's rtauto plugin") (libraries rocq-runtime.plugins.ltac)) -(deprecated_library_name - (old_public_name coq-core.plugins.rtauto) - (new_public_name rocq-runtime.plugins.rtauto)) - (rule (targets g_rtauto.ml) (deps (:mlg g_rtauto.mlg)) --- coq.orig/plugins/ssr/dune +++ coq/plugins/ssr/dune @@ -6,10 +6,6 @@ (flags :standard -open Gramlib) (libraries rocq-runtime.plugins.ssrmatching)) -(deprecated_library_name - (old_public_name coq-core.plugins.ssreflect) - (new_public_name rocq-runtime.plugins.ssreflect)) - (rule (targets ssrvernac.ml) (deps (:mlg ssrvernac.mlg)) --- coq.orig/plugins/ssrmatching/dune +++ coq/plugins/ssrmatching/dune @@ -4,10 +4,6 @@ (synopsis "Rocq ssrmatching plugin") (libraries rocq-runtime.plugins.ltac)) -(deprecated_library_name - (old_public_name coq-core.plugins.ssrmatching) - (new_public_name rocq-runtime.plugins.ssrmatching)) - (rule (targets g_ssrmatching.ml) (deps (:mlg g_ssrmatching.mlg)) --- coq.orig/plugins/syntax/dune +++ coq/plugins/syntax/dune @@ -5,10 +5,6 @@ (modules g_number_string number_string) (libraries rocq-runtime.vernac)) -(deprecated_library_name - (old_public_name coq-core.plugins.number_string_notation) - (new_public_name rocq-runtime.plugins.number_string_notation)) - (rule (targets g_number_string.ml) (deps (:mlg g_number_string.mlg)) --- coq.orig/pretyping/dune +++ coq/pretyping/dune @@ -5,7 +5,3 @@ (wrapped false) (modules_without_implementation locus pattern glob_term ltac_pretype) (libraries engine)) - -(deprecated_library_name - (old_public_name coq-core.pretyping) - (new_public_name rocq-runtime.pretyping)) --- coq.orig/printing/dune +++ coq/printing/dune @@ -4,7 +4,3 @@ (public_name rocq-runtime.printing) (wrapped false) (libraries parsing proofs)) - -(deprecated_library_name - (old_public_name coq-core.printing) - (new_public_name rocq-runtime.printing)) --- coq.orig/proofs/dune +++ coq/proofs/dune @@ -5,7 +5,3 @@ (wrapped false) (modules_without_implementation tactypes) (libraries pretyping)) - -(deprecated_library_name - (old_public_name coq-core.proofs) - (new_public_name rocq-runtime.proofs)) --- coq.orig/stm/dune +++ coq/stm/dune @@ -6,7 +6,3 @@ ; until ocaml/dune#4892 fixed ; (private_modules dag proofBlockDelimiter tQueue vcs workerPool) (libraries sysinit coqworkmgrApi)) - -(deprecated_library_name - (old_public_name coq-core.stm) - (new_public_name rocq-runtime.stm)) --- coq.orig/sysinit/dune +++ coq/sysinit/dune @@ -5,11 +5,7 @@ (modules coqargs) (wrapped false) ; don't depend on rocq-runtime.lib -> impossible to imperatively set random flags - (libraries rocq-runtime.config rocq-runtime.boot rocq-runtime.clib)) - -(deprecated_library_name - (old_public_name coq-core.coqargs) - (new_public_name rocq-runtime.coqargs)) + (libraries rocq-runtime.config rocq-runtime.boot rocq-runtime.clib rocq-runtime.lib)) (library (name sysinit) @@ -18,7 +14,3 @@ (wrapped false) (modules :standard \ coqargs) (libraries rocq-runtime.boot rocq-runtime.vernac coqargs findlib)) - -(deprecated_library_name - (old_public_name coq-core.sysinit) - (new_public_name rocq-runtime.sysinit)) --- coq.orig/tactics/dune +++ coq/tactics/dune @@ -7,7 +7,3 @@ ; until ocaml/dune#4892 fixed ; (private_modules btermdn dn) (libraries printing)) - -(deprecated_library_name - (old_public_name coq-core.tactics) - (new_public_name rocq-runtime.tactics)) --- coq.orig/test-suite/dune +++ coq/test-suite/dune @@ -9,7 +9,9 @@ (rule (targets test_suite_config.inc) - (action (with-stdout-to %{targets} (run tools/coq_config_to_make.exe %{bin:coqc})))) + (mode (promote (until-clean))) + (deps (package rocq-runtime)) + (action (with-stdout-to %{targets} (run tools/coq_config_to_make.exe rocq)))) (rule (targets summary.log) --- coq.orig/tools/coqdep/lib/dune +++ coq/tools/coqdep/lib/dune @@ -3,4 +3,8 @@ (public_name rocq-runtime.coqdeplib) (libraries rocq-runtime.boot rocq-runtime.lib findlib.internal)) -(ocamllex lexer) +(rule + (target lexer.ml) + (deps lexer.mll) + (action (chdir %{workspace_root} + (run %{bin:ocamllex} -ml -q -o %{target} %{deps})))) --- coq.orig/tools/coqdep/lib/file_util.ml +++ coq/tools/coqdep/lib/file_util.ml @@ -37,3 +37,14 @@ match normalize [] path with | [] -> "." | path -> String.concat "/" path + +let is_prefix a b = + let a = Str.split_delim re_delim a in + let b = Str.split_delim re_delim b in + let rec aux a b = + match a, b with + | [], _ -> true + | x :: a, y :: b -> String.equal x y && aux a b + | _ :: _, [] -> false + in + aux a b --- coq.orig/tools/coqdep/lib/file_util.mli +++ coq/tools/coqdep/lib/file_util.mli @@ -24,3 +24,5 @@ ["../../dir/file.v"] are possible return values, but ["./file.v"] and ["dir1/../dir2"] are not. *) val normalize_path : string -> string + +val is_prefix : string -> string -> bool --- coq.orig/tools/coqdep/lib/fl.ml +++ coq/tools/coqdep/lib/fl.ml @@ -61,7 +61,7 @@ (* relativize the path if inside the current dune workspace if we relativize paths outside the dune workspace it fails so make sure to avoid it *) match Sys.getenv_opt "DUNE_SOURCEROOT" with - | Some dune when CString.is_prefix (Filename.concat dune "_build") path -> + | Some dune when File_util.is_prefix (Filename.concat dune "_build") path -> normalize_path (to_relative_path path) | _ -> normalize_path path --- coq.orig/tools/coqdoc/dune +++ coq/tools/coqdoc/dune @@ -15,7 +15,7 @@ (library (name coqdoclib) (modules :standard \ coqdoc) - (libraries str rocq-runtime.boot rocq-runtime.config rocq-runtime.clib)) + (libraries str rocq-runtime.boot rocq-runtime.config rocq-runtime.clib rocq-runtime.lib)) (executable (name coqdoc) --- coq.orig/tools/coqworkmgr/dune +++ coq/tools/coqworkmgr/dune @@ -5,10 +5,6 @@ (wrapped false) (libraries str unix)) -(deprecated_library_name - (old_public_name coq-core.coqworkmgrapi) - (new_public_name rocq-runtime.coqworkmgrapi)) - (library (name rocqworkmgr) (modules rocqworkmgr) --- coq.orig/toplevel/dune +++ coq/toplevel/dune @@ -10,10 +10,6 @@ (memtrace -> memtrace_init.memtrace.ml) (!memtrace -> memtrace_init.default.ml)))) -(deprecated_library_name - (old_public_name coq-core.toplevel) - (new_public_name rocq-runtime.toplevel)) - ; Interp provides the `zarith` library to plugins, we could also use ; -linkall in the plugins file, to be discussed. --- coq.orig/vernac/dune +++ coq/vernac/dune @@ -8,10 +8,6 @@ ; (private_modules comProgramFixpoint egramcoq) (libraries tactics parsing findlib.dynload)) -(deprecated_library_name - (old_public_name coq-core.vernac) - (new_public_name rocq-runtime.vernac)) - (rule (targets g_proofs.ml) (deps (:mlg g_proofs.mlg)) --- coq.orig/clib/cList.ml +++ coq/clib/cList.ml @@ -19,7 +19,7 @@ type 'a cell = { head : 'a; mutable tail : 'a list; -} +} [@@warning "-unused-field"] external cast : 'a cell -> 'a list = "%identity" --- coq.orig/lib/spawn.ml +++ coq/lib/spawn.ml @@ -157,7 +157,6 @@ cout : out_channel; oob_resp : in_channel option; oob_req : out_channel option; - gchan : ML.async_chan; pid : int; mutable watch : ML.watch_id option; mutable alive : bool; @@ -192,7 +191,7 @@ Unix.set_nonblock (fst main); let gchan = ML.async_chan_of_file_or_socket (fst main) in let alive, watch = true, None in - let p = { cin; cout; gchan; pid; oob_resp; oob_req; alive; watch } in + let p = { cin; cout; pid; oob_resp; oob_req; alive; watch } in p.watch <- Some ( ML.add_watch ~callback:(fun cl -> try