From f7af2d0078f25a54db19709e25ac73ca80c48183 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Thu, 7 Nov 2024 18:11:23 +0000 Subject: [PATCH] refactor: remove [Lib_config] from [Lib] (#11105) Signed-off-by: Rudi Grinberg --- bin/ocaml/top.ml | 22 ++++++++-- bin/ocaml/utop.ml | 9 ++-- src/dune_rules/compilation_context.ml | 10 +++-- src/dune_rules/ctypes/ctypes_rules.ml | 3 +- src/dune_rules/jsoo/jsoo_rules.ml | 10 +++-- src/dune_rules/lib.ml | 11 +---- src/dune_rules/lib.mli | 2 - src/dune_rules/lib_flags.ml | 56 +++++++++++++++---------- src/dune_rules/lib_flags.mli | 27 +++++++++--- src/dune_rules/mdx.ml | 7 +++- src/dune_rules/melange/melange_rules.ml | 20 ++++++--- src/dune_rules/merlin/ocaml_index.ml | 1 + src/dune_rules/scope.ml | 6 +-- src/dune_rules/toplevel.ml | 3 +- 14 files changed, 125 insertions(+), 62 deletions(-) diff --git a/bin/ocaml/top.ml b/bin/ocaml/top.ml index b5e6c5ad740..679f3e4a3ae 100644 --- a/bin/ocaml/top.ml +++ b/bin/ocaml/top.ml @@ -19,8 +19,12 @@ let info = Cmd.info "top" ~doc ~man let link_deps sctx link = let open Memo.O in + let* lib_config = + let+ ocaml = Super_context.context sctx |> Context.ocaml in + ocaml.lib_config + in Memo.parallel_map link ~f:(fun t -> - Dune_rules.Lib_flags.link_deps sctx t Dune_rules.Link_mode.Byte) + Dune_rules.Lib_flags.link_deps sctx t Dune_rules.Link_mode.Byte lib_config) >>| List.concat ;; @@ -47,9 +51,10 @@ let term = let sctx = Dune_engine.Context_name.Map.find setup.scontexts ctx_name |> Option.value_exn in + let context = Super_context.context sctx in let* libs = let dir = - let build_dir = Super_context.context sctx |> Context.build_dir in + let build_dir = Context.build_dir context in Path.Build.relative build_dir (Common.prefix_target common dir) in let* db = @@ -62,7 +67,13 @@ let term = let* requires = Dune_rules.Resolve.Memo.read_memo (Dune_rules.Lib.closure ~linking:true libs) in - let include_paths = Dune_rules.Lib_flags.L.toplevel_include_paths requires in + let* lib_config = + let+ ocaml = Context.ocaml context in + ocaml.lib_config + in + let include_paths = + Dune_rules.Lib_flags.L.toplevel_include_paths requires lib_config + in let+ files_to_load = files_to_load_of_requires sctx requires in Dune_rules.Toplevel.print_toplevel_init_file { include_paths; files_to_load; uses = []; pp = None; ppx = None; code = [] })) @@ -116,7 +127,10 @@ module Module = struct in let private_obj_dir = Top_module.private_obj_dir ctx mod_ in let include_paths = - let libs = Dune_rules.Lib_flags.L.toplevel_include_paths requires in + let libs = + let lib_config = (Compilation_context.ocaml cctx).lib_config in + Dune_rules.Lib_flags.L.toplevel_include_paths requires lib_config + in Path.Set.add libs (Path.build (Obj_dir.byte_dir private_obj_dir)) in let files_to_load () = diff --git a/bin/ocaml/utop.ml b/bin/ocaml/utop.ml index 17f09222aab..c812830414c 100644 --- a/bin/ocaml/utop.ml +++ b/bin/ocaml/utop.ml @@ -21,7 +21,7 @@ let term = let dir = Common.prefix_target common dir in if not (Path.is_directory (Path.of_string dir)) then User_error.raise [ Pp.textf "cannot find directory: %s" (String.maybe_quoted dir) ]; - let env, utop_path, requires = + let env, lib_config, utop_path, requires = Scheduler.go ~common ~config (fun () -> let open Fiber.O in let* setup = Import.Main.setup () in @@ -46,12 +46,15 @@ let term = Utop.requires_under_dir sctx ~dir in let+ requires = Resolve.read_memo requires + and+ lib_config = + let+ ocaml = Context.ocaml context in + ocaml.lib_config and+ env = Super_context.context_env sctx in - env, Path.to_string utop_target, requires)) + env, lib_config, Path.to_string utop_target, requires)) in Hooks.End_of_build.run (); let env = - Dune_rules.Lib_flags.L.toplevel_ld_paths requires + Dune_rules.Lib_flags.L.toplevel_ld_paths requires lib_config |> Path.Set.fold ~f:(fun dir env -> Env_path.cons ~var:Ocaml.Env.caml_ld_library_path env ~dir) ~init:env diff --git a/src/dune_rules/compilation_context.ml b/src/dune_rules/compilation_context.ml index 4b3c64fde40..e75d2649bb6 100644 --- a/src/dune_rules/compilation_context.ml +++ b/src/dune_rules/compilation_context.ml @@ -4,11 +4,13 @@ open Memo.O module Includes = struct type t = Command.Args.without_targets Command.Args.t Lib_mode.Cm_kind.Map.t - let make ~project ~opaque ~direct_requires ~hidden_requires : _ Lib_mode.Cm_kind.Map.t = + let make ~project ~opaque ~direct_requires ~hidden_requires lib_config + : _ Lib_mode.Cm_kind.Map.t + = (* TODO : some of the requires can filtered out using [ocamldep] info *) let open Resolve.Memo.O in let iflags direct_libs hidden_libs mode = - Lib_flags.L.include_flags ~project ~direct_libs ~hidden_libs mode + Lib_flags.L.include_flags ~project ~direct_libs ~hidden_libs mode lib_config in let make_includes_args ~mode groups = Command.Args.memo @@ -203,7 +205,8 @@ let create ; requires_compile = direct_requires ; requires_hidden = hidden_requires ; requires_link - ; includes = Includes.make ~project ~opaque ~direct_requires ~hidden_requires + ; includes = + Includes.make ~project ~opaque ~direct_requires ~hidden_requires ocaml.lib_config ; preprocessing ; opaque ; stdlib @@ -293,6 +296,7 @@ let for_module_generated_at_link_time cctx ~requires ~module_ = ~opaque ~direct_requires ~hidden_requires + cctx.ocaml.lib_config in { cctx with opaque diff --git a/src/dune_rules/ctypes/ctypes_rules.ml b/src/dune_rules/ctypes/ctypes_rules.ml index 98cb17ca914..a5114d94d7c 100644 --- a/src/dune_rules/ctypes/ctypes_rules.ml +++ b/src/dune_rules/ctypes/ctypes_rules.ml @@ -225,7 +225,8 @@ let build_c_program Lib.DB.resolve (Scope.libs scope) (Loc.none, ctypes) |> Resolve.Memo.read in let ctypes_include_dirs = - Lib_flags.L.include_paths [ lib ] (Ocaml Native) |> Path.Set.to_list + Lib_flags.L.include_paths [ lib ] (Ocaml Native) ocaml.lib_config + |> Path.Set.to_list in let include_dirs = ocaml_where :: ctypes_include_dirs in Command.Args.S diff --git a/src/dune_rules/jsoo/jsoo_rules.ml b/src/dune_rules/jsoo/jsoo_rules.ml index 7ad41a6dddb..f4a8fb173e1 100644 --- a/src/dune_rules/jsoo/jsoo_rules.ml +++ b/src/dune_rules/jsoo/jsoo_rules.ml @@ -521,18 +521,22 @@ let setup_separate_compilation_rules sctx components = | Some pkg -> let info = Lib.info pkg in let lib_name = Lib_name.to_string (Lib.name pkg) in - let archives = + let* archives = let archives = (Lib_info.archives info).byte in (* Special case for the stdlib because it is not referenced in the META *) match lib_name with | "stdlib" -> + let+ lib_config = + let+ ocaml = Context.ocaml ctx in + ocaml.lib_config + in let archive = - let stdlib_dir = (Lib.lib_config pkg).stdlib_dir in + let stdlib_dir = lib_config.stdlib_dir in Path.relative stdlib_dir in archive "stdlib.cma" :: archive "std_exit.cmo" :: archives - | _ -> archives + | _ -> Memo.return archives in Memo.parallel_iter Js_of_ocaml.Mode.all ~f:(fun mode -> Memo.parallel_iter archives ~f:(fun fn -> diff --git a/src/dune_rules/lib.ml b/src/dune_rules/lib.ml index fd18edab75e..041522a9b5c 100644 --- a/src/dune_rules/lib.ml +++ b/src/dune_rules/lib.ml @@ -337,7 +337,6 @@ module T = struct ; pps : t list Resolve.t ; resolved_selects : Resolved_select.t list Resolve.t ; implements : t Resolve.t option - ; lib_config : Lib_config.t ; project : Dune_project.t option ; (* these fields cannot be forced until the library is instantiated *) default_implementation : t Resolve.t Memo.Lazy.t option @@ -413,7 +412,6 @@ type db = ; instantiate : (Lib_name.t -> Path.t Lib_info.t -> hidden:string option -> Status.t Memo.t) Lazy.t ; all : Lib_name.t list Memo.Lazy.t - ; lib_config : Lib_config.t ; instrument_with : Lib_name.t list } @@ -427,7 +425,6 @@ and resolve_result = | Redirect_by_name of db * (Loc.t * Lib_name.t) | Redirect_by_id of db * Lib_id.t -let lib_config (t : lib) = t.lib_config let name t = t.name let info t = t.info let project t = t.project @@ -1070,7 +1067,6 @@ end = struct ; re_exports ; implements ; default_implementation - ; lib_config = db.lib_config ; project ; sub_systems = Sub_system_name.Map.mapi (Lib_info.sub_systems info) ~f:(fun name info -> @@ -1909,14 +1905,13 @@ module DB = struct type t = db - let create ~parent ~resolve ~resolve_lib_id ~all ~lib_config ~instrument_with () = + let create ~parent ~resolve ~resolve_lib_id ~all ~instrument_with () = let rec t = lazy { parent ; resolve ; resolve_lib_id ; all = Memo.lazy_ all - ; lib_config ; instrument_with ; instantiate } @@ -1926,7 +1921,7 @@ module DB = struct let create_from_findlib = let bigarray = Lib_name.of_string "bigarray" in - fun findlib ~has_bigarray_library ~lib_config -> + fun findlib ~has_bigarray_library -> let resolve name = let open Memo.O in Findlib.find findlib name @@ -1951,7 +1946,6 @@ module DB = struct create () ~parent:None - ~lib_config ~resolve ~resolve_lib_id:(fun lib_id -> let open Memo.O in @@ -1969,7 +1963,6 @@ module DB = struct findlib ~has_bigarray_library:(Ocaml.Version.has_bigarray_library ocaml.version) ~instrument_with:(Context.instrument_with context) - ~lib_config:ocaml.lib_config ;; let find t name = diff --git a/src/dune_rules/lib.mli b/src/dune_rules/lib.mli index 282e3091a06..4969e352d95 100644 --- a/src/dune_rules/lib.mli +++ b/src/dune_rules/lib.mli @@ -11,7 +11,6 @@ val to_dyn : t -> Dyn.t or the [name] if not. *) val name : t -> Lib_name.t -val lib_config : t -> Lib_config.t val implements : t -> t Resolve.Memo.t option (** [is_local t] returns [true] whenever [t] is defined in the local workspace *) @@ -116,7 +115,6 @@ module DB : sig -> resolve:(Lib_name.t -> Resolve_result.t list Memo.t) -> resolve_lib_id:(Lib_id.t -> Resolve_result.t Memo.t) -> all:(unit -> Lib_name.t list Memo.t) - -> lib_config:Lib_config.t -> instrument_with:Lib_name.t list -> unit -> t diff --git a/src/dune_rules/lib_flags.ml b/src/dune_rules/lib_flags.ml index 4f97f2946c7..c6e32600d5f 100644 --- a/src/dune_rules/lib_flags.ml +++ b/src/dune_rules/lib_flags.ml @@ -12,7 +12,7 @@ module Link_params = struct not appear on the command line *) } - let get sctx (t : Lib.t) (mode : Link_mode.t) = + let get sctx (t : Lib.t) (mode : Link_mode.t) (lib_config : Lib_config.t) = let info = Lib.info t in let lib_files = Lib_info.foreign_archives info and dll_files = Lib_info.foreign_dll_files info in @@ -69,15 +69,15 @@ module Link_params = struct Path.extend_basename obj_name ~suffix:(Cm_kind.ext Cmo) :: hidden_deps | Native -> Path.extend_basename obj_name ~suffix:(Cm_kind.ext Cmx) - :: Path.extend_basename obj_name ~suffix:(Lib.lib_config t).ext_obj + :: Path.extend_basename obj_name ~suffix:lib_config.ext_obj :: hidden_deps) in { deps; hidden_deps; include_dirs } ;; end -let link_deps sctx t mode = - let+ x = Link_params.get sctx t mode in +let link_deps sctx t mode lib_config = + let+ x = Link_params.get sctx t mode lib_config in List.rev_append x.hidden_deps x.deps ;; @@ -94,10 +94,8 @@ module L = struct let to_iflags dir = to_flags "-I" dir let to_hflags dir = to_flags "-H" dir - let remove_stdlib dirs libs = - match libs with - | [] -> dirs - | lib :: _ -> Path.Set.remove dirs (Lib.lib_config lib).stdlib_dir + let remove_stdlib dirs (lib_config : Lib_config.t) = + Path.Set.remove dirs lib_config.stdlib_dir ;; type mode = @@ -125,7 +123,7 @@ module L = struct in List.fold_left public_cmi_dirs ~init:acc ~f:Path.Set.add in - fun ?project ts mode -> + fun ?project ts mode lib_config -> let visible_cmi = match project with | None -> fun _ -> true @@ -154,33 +152,35 @@ module L = struct let native_dir = Obj_dir.native_dir obj_dir in Path.Set.add acc native_dir)) in - remove_stdlib dirs ts + remove_stdlib dirs lib_config ;; - let include_flags ?project ~direct_libs ~hidden_libs mode = + let include_flags ?project ~direct_libs ~hidden_libs mode lib_config = let include_paths ts = include_paths ?project ts { lib_mode = mode; melange_emit = false } in - let hidden_includes = to_hflags (include_paths hidden_libs) in - let direct_includes = to_iflags (include_paths direct_libs) in + let hidden_includes = to_hflags (include_paths hidden_libs lib_config) in + let direct_includes = to_iflags (include_paths direct_libs lib_config) in Command.Args.S [ direct_includes; hidden_includes ] ;; - let melange_emission_include_flags ?project ts = - to_iflags (include_paths ?project ts { lib_mode = Melange; melange_emit = true }) + let melange_emission_include_flags ?project ts lib_config = + to_iflags + (include_paths ?project ts { lib_mode = Melange; melange_emit = true } lib_config) ;; let include_paths ?project ts mode = include_paths ?project ts { lib_mode = mode; melange_emit = false } ;; - let c_include_paths ts = + let c_include_paths ts lib_config = let dirs = List.fold_left ts ~init:Path.Set.empty ~f:(fun acc t -> let src_dir = Lib_info.src_dir (Lib.info t) in Path.Set.add acc src_dir) in - remove_stdlib dirs ts + (* I don't remember why this is being done anymore. Anyone else has a clue? *) + remove_stdlib dirs lib_config ;; let c_include_flags ts sctx = @@ -205,7 +205,17 @@ module L = struct let+ () = Action_builder.all_unit bindings in Command.Args.empty in - Command.Args.S [ Dyn local; Hidden_deps external_; to_iflags (c_include_paths ts) ] + let include_flags = + let open Action_builder.O in + let+ lib_config = + Action_builder.of_memo + Memo.O.( + let+ ocaml = Super_context.context sctx |> Context.ocaml in + ocaml.lib_config) + in + to_iflags (c_include_paths ts lib_config) + in + Command.Args.S [ Dyn local; Hidden_deps external_; Dyn include_flags ] ;; let toplevel_ld_paths ts = @@ -218,8 +228,10 @@ module L = struct c_include_paths with_dlls ;; - let toplevel_include_paths ts = - Path.Set.union (include_paths ts (Lib_mode.Ocaml Byte)) (toplevel_ld_paths ts) + let toplevel_include_paths ts lib_config = + Path.Set.union + (include_paths ts (Lib_mode.Ocaml Byte) lib_config) + (toplevel_ld_paths ts lib_config) ;; end @@ -238,7 +250,9 @@ module Lib_and_module = struct Action_builder.all (List.map ts ~f:(function | Lib t -> - let+ p = Action_builder.of_memo (Link_params.get sctx t mode) in + let+ p = + Action_builder.of_memo (Link_params.get sctx t mode lib_config) + in Command.Args.S (Deps p.deps :: Hidden_deps (Dep.Set.of_files p.hidden_deps) diff --git a/src/dune_rules/lib_flags.mli b/src/dune_rules/lib_flags.mli index 8a65f55a084..03c52d2ff31 100644 --- a/src/dune_rules/lib_flags.mli +++ b/src/dune_rules/lib_flags.mli @@ -23,21 +23,38 @@ module L : sig type nonrec t = Lib.t list val to_iflags : Path.Set.t -> _ Command.Args.t - val include_paths : ?project:Dune_project.t -> t -> Lib_mode.t -> Path.Set.t + + val include_paths + : ?project:Dune_project.t + -> t + -> Lib_mode.t + -> Lib_config.t + -> Path.Set.t val include_flags : ?project:Dune_project.t -> direct_libs:t -> hidden_libs:t -> Lib_mode.t + -> Lib_config.t + -> _ Command.Args.t + + val melange_emission_include_flags + : ?project:Dune_project.t + -> t + -> Lib_config.t -> _ Command.Args.t - val melange_emission_include_flags : ?project:Dune_project.t -> t -> _ Command.Args.t val c_include_flags : t -> Super_context.t -> _ Command.Args.t - val toplevel_ld_paths : t -> Path.Set.t - val toplevel_include_paths : t -> Path.Set.t + val toplevel_ld_paths : t -> Lib_config.t -> Path.Set.t + val toplevel_include_paths : t -> Lib_config.t -> Path.Set.t end (** The list of files that will be read by the compiler when linking an executable against this library *) -val link_deps : Super_context.t -> Lib.t -> Link_mode.t -> Path.t list Memo.t +val link_deps + : Super_context.t + -> Lib.t + -> Link_mode.t + -> Lib_config.t + -> Path.t list Memo.t diff --git a/src/dune_rules/mdx.ml b/src/dune_rules/mdx.ml index 03df5c205aa..cf36a411945 100644 --- a/src/dune_rules/mdx.ml +++ b/src/dune_rules/mdx.ml @@ -421,11 +421,16 @@ let mdx_prog_gen t ~sctx ~dir ~scope ~mdx_prog = let+ lib = Lib.DB.resolve (Scope.libs scope) lib in Some lib | _ -> Resolve.Memo.return None) + and+ lib_config = + Resolve.Memo.lift_memo + @@ Memo.O.( + let+ ocaml = Super_context.context sctx |> Context.ocaml in + ocaml.lib_config) in let mode = ocaml_toolchain |> Ocaml_toolchain.best_mode in let open Command.Args in S - (Lib_flags.L.include_paths libs_to_include (Ocaml mode) + (Lib_flags.L.include_paths libs_to_include (Ocaml mode) lib_config |> Path.Set.to_list_map ~f:(fun p -> S [ A "--directory"; Path p ])) in let open Command.Args in diff --git a/src/dune_rules/melange/melange_rules.ml b/src/dune_rules/melange/melange_rules.ml index 6bf099324c1..dff2d385c02 100644 --- a/src/dune_rules/melange/melange_rules.ml +++ b/src/dune_rules/melange/melange_rules.ml @@ -107,7 +107,7 @@ let impl_only_modules_defined_in_this_lib ~sctx ~scope lib = let cmj_glob = Glob.of_string_exn Loc.none "*.cmj" -let cmj_includes ~(requires_link : Lib.t list Resolve.t) ~scope = +let cmj_includes ~(requires_link : Lib.t list Resolve.t) ~scope lib_config = let project = Scope.project scope in let deps_of_lib lib = let info = Lib.info lib in @@ -122,7 +122,7 @@ let cmj_includes ~(requires_link : Lib.t list Resolve.t) ~scope = let+ requires_link = requires_link in let deps = List.map requires_link ~f:deps_of_lib |> Dep.Set.of_list in Command.Args.S - [ Lib_flags.L.melange_emission_include_flags ~project requires_link + [ Lib_flags.L.melange_emission_include_flags ~project requires_link lib_config ; Hidden_deps deps ] ;; @@ -468,7 +468,13 @@ let setup_entries_js let loc = mel.loc in let module_systems = mel.module_systems in let* requires_link = Memo.Lazy.force requires_link in - let includes = cmj_includes ~requires_link ~scope in + let* includes = + let+ lib_config = + let+ ocaml = Super_context.context sctx |> Context.ocaml in + ocaml.lib_config + in + cmj_includes ~requires_link ~scope lib_config + in let output = `Private_library_or_emit target_dir in let obj_dir = Obj_dir.of_local local_obj_dir in let* () = @@ -526,6 +532,10 @@ let setup_js_rules_libraries = | None -> acc | Some sub -> if Lib.equal sub lib then acc else sub :: acc) in + let* lib_config = + let+ ocaml = Super_context.context sctx |> Context.ocaml in + ocaml.lib_config + in Memo.parallel_iter requires_link ~f:(fun lib -> let lib_compile_info = Lib.Compile.for_lib @@ -546,7 +556,7 @@ let setup_js_rules_libraries = Memo.Lazy.force (Lib.Compile.requires_link lib_compile_info) |> Resolve.Memo.map ~f:(with_vlib_implementations lib) in - cmj_includes ~requires_link ~scope + cmj_includes ~requires_link ~scope lib_config in let+ () = setup_runtime_assets_rules @@ -586,7 +596,7 @@ let setup_js_rules_libraries = path in `import` / `require`. *) lib :: requires_link in - cmj_includes ~requires_link ~scope + cmj_includes ~requires_link ~scope lib_config in parallel_build_source_modules ~sctx diff --git a/src/dune_rules/merlin/ocaml_index.ml b/src/dune_rules/merlin/ocaml_index.ml index be00a359539..cbe1773a98e 100644 --- a/src/dune_rules/merlin/ocaml_index.ml +++ b/src/dune_rules/merlin/ocaml_index.ml @@ -39,6 +39,7 @@ let cctx_rules cctx = ~direct_libs:non_compile_libs ~hidden_libs:[] (Lib_mode.Ocaml Byte) + (Compilation_context.ocaml cctx).lib_config in (* Indexing depends (recursively) on [required_compile] libs: - These libs's cmt files should be built before indexing starts diff --git a/src/dune_rules/scope.ml b/src/dune_rules/scope.ml index ef91cb5feb1..e31dd6c3dd9 100644 --- a/src/dune_rules/scope.ml +++ b/src/dune_rules/scope.ml @@ -198,7 +198,6 @@ module DB = struct ~resolve ~resolve_lib_id ~all:(fun () -> Lib_name.Map.keys by_name |> Memo.return) - ~lib_config ~instrument_with ;; @@ -232,7 +231,7 @@ module DB = struct | None -> Memo.return Lib.DB.Resolve_result.not_found | Some rt -> resolve_redirect_to t rt in - fun t ~installed_libs ~lib_config stanzas -> + fun t ~installed_libs stanzas -> let by_name, by_id = List.fold_left stanzas @@ -292,7 +291,6 @@ module DB = struct ~resolve ~resolve_lib_id ~all:(fun () -> Lib_name.Map.keys by_name |> Memo.return) - ~lib_config () ;; @@ -353,7 +351,7 @@ module DB = struct let instrument_with = Context.instrument_with context in let+ public_libs = let+ installed_libs = Lib.DB.installed context in - public_libs t ~instrument_with ~lib_config ~installed_libs stanzas + public_libs t ~instrument_with ~installed_libs stanzas in let by_dir = scopes_by_dir diff --git a/src/dune_rules/toplevel.ml b/src/dune_rules/toplevel.ml index dd131b4e12c..fda7f598c94 100644 --- a/src/dune_rules/toplevel.ml +++ b/src/dune_rules/toplevel.ml @@ -118,8 +118,9 @@ let setup_module_rules t = Action_builder.write_file_dyn path (let* libs = Resolve.Memo.read requires_compile in + let lib_config = (Compilation_context.ocaml t.cctx).lib_config in let include_dirs = - Path.Set.to_list (Lib_flags.L.include_paths libs (Ocaml Byte)) + Path.Set.to_list (Lib_flags.L.include_paths libs (Ocaml Byte) lib_config) in let* pp_ppx = pp_flags t in let pp_dirs = Source.pp_ml t.source ~include_dirs in