From 58445e199e5c319873ef89e2f2d1d0227669c9b6 Mon Sep 17 00:00:00 2001 From: HasanA Date: Wed, 15 May 2024 14:40:00 +0200 Subject: [PATCH] Change the type of state.result to include a bool indicating if the dependency is direct or not. add -H feature to dune. _ _ merged the requires_link and requires_compile lists into one list, and removed the forced laziness. In the process of changing the return type of result from (lib) to (lib * bool). This affects the Vlib module, and edits should be done. injected the bool inside the lib module and its submodules. Progress: there is still a problem with the type Lib itself; should the bool be inserted there also? _ Changes concerning the propagation of the new bool in different files finished refactoring the code. The choice of dropping or maintaining the bool is not final. _ modified lib_flags.ml to test for hidden deps and adapt the -H flag accordingly. _ _ _ _ Changed the type of paths container into a map (path * bool) removed uncessary diff _ Maintained requires_compile and requires_link in compilation_context.ml. Reduced diff. _ Added tests for failing when accessing a hidden dep, and for correct use of -H flag. More tests regarding compiler version and legacy mode behaviour to be added. _ _ _ _ _ _ _ Reduced diff. _ Edited the hidden-deps test + removed uncessary diffs from lib_flags.mli Removed unnecessary deps from test dune files. --- bin/main.ml | 1 - otherlibs/chrome-trace/test/dune | 6 +- otherlibs/dune-glob/test/dune | 6 +- otherlibs/dune-rpc-lwt/test/dune | 6 +- otherlibs/dune-site/src/dune | 2 +- otherlibs/stdune/src/stdune.ml | 2 - otherlibs/stdune/test/dune | 6 +- src/dune_rules/compilation_context.ml | 57 +++++++++----- src/dune_rules/compilation_context.mli | 2 +- src/dune_rules/exe_rules.ml | 4 +- src/dune_rules/lib.ml | 48 +++++------- src/dune_rules/lib.mli | 2 + src/dune_rules/lib_flags.ml | 76 ++++++++++++++++++- src/dune_rules/lib_flags.mli | 4 +- src/dune_rules/lib_rules.ml | 4 +- src/dune_rules/melange/melange_rules.ml | 1 + src/dune_rules/module_compilation.ml | 8 +- src/dune_rules/odoc.ml | 1 + src/dune_rules/toplevel.ml | 1 + src/ocaml/version.ml | 1 + src/ocaml/version.mli | 3 + .../test-cases/hidden-deps.t/bar.ml | 3 + .../test-cases/hidden-deps.t/bash.sh | 76 +++++++++++++++++++ .../test-cases/hidden-deps.t/dune | 18 +++++ .../test-cases/hidden-deps.t/foo.ml | 3 + .../test-cases/hidden-deps.t/run.ml | 1 + .../test-cases/hidden-deps.t/run.t | 72 ++++++++++++++++++ .../test-cases/hidden-deps.t/runf.ml | 1 + test/expect-tests/csexp_rpc/dune | 6 +- test/expect-tests/dag/dune | 6 +- test/expect-tests/digest/dune | 6 +- test/expect-tests/dune | 18 +---- test/expect-tests/dune_async_io/dune | 6 +- test/expect-tests/dune_config_file/dune | 6 +- test/expect-tests/dune_console/dune | 6 +- test/expect-tests/dune_engine/dune | 6 +- test/expect-tests/dune_file_watcher/dune | 15 +--- test/expect-tests/dune_lang/dune | 6 +- test/expect-tests/dune_patch/dune | 6 +- test/expect-tests/dune_pkg/dune | 5 +- test/expect-tests/dune_pkg_outdated/dune | 6 +- test/expect-tests/dune_rpc/dune | 6 +- test/expect-tests/dune_rpc_e2e/dune | 24 +----- test/expect-tests/dune_rpc_impl/dune | 6 +- test/expect-tests/dune_sexp/dune | 6 +- test/expect-tests/dune_stats/dune | 6 +- test/expect-tests/dune_util/dune | 6 +- test/expect-tests/fiber_event_bus/dune | 6 +- test/expect-tests/fsevents/dune | 7 +- test/expect-tests/memo/dune | 6 +- test/expect-tests/memo/graph_dump/dune | 5 +- test/expect-tests/scheme/dune | 6 +- test/expect-tests/vcs/dune | 6 +- vendor/fiber/test/dune | 6 +- vendor/lwd/nottui/dune | 2 +- vendor/opam-0install/lib/dune | 2 +- vendor/opam/src/format/dune | 2 +- vendor/opam/src/repository/dune | 2 +- vendor/opam/src/state/dune | 2 +- 59 files changed, 365 insertions(+), 254 deletions(-) create mode 100644 test/blackbox-tests/test-cases/hidden-deps.t/bar.ml create mode 100755 test/blackbox-tests/test-cases/hidden-deps.t/bash.sh create mode 100644 test/blackbox-tests/test-cases/hidden-deps.t/dune create mode 100644 test/blackbox-tests/test-cases/hidden-deps.t/foo.ml create mode 100644 test/blackbox-tests/test-cases/hidden-deps.t/run.ml create mode 100644 test/blackbox-tests/test-cases/hidden-deps.t/run.t create mode 100644 test/blackbox-tests/test-cases/hidden-deps.t/runf.ml diff --git a/bin/main.ml b/bin/main.ml index 3ff5b497f514..ba47da9fe45e 100644 --- a/bin/main.ml +++ b/bin/main.ml @@ -26,7 +26,6 @@ let all : _ Cmdliner.Cmd.t list = ; Shutdown.command ; Diagnostics.command ; Monitor.command - ; Greet.command ] in let groups = diff --git a/otherlibs/chrome-trace/test/dune b/otherlibs/chrome-trace/test/dune index a45a58e134e0..10683cc202c7 100644 --- a/otherlibs/chrome-trace/test/dune +++ b/otherlibs/chrome-trace/test/dune @@ -8,11 +8,7 @@ chrome_trace ;; This is because of the (implicit_transitive_deps false) ;; in dune-project - ppx_expect.config - ppx_expect.config_types - ppx_expect.common - base - ppx_inline_test.config) + ppx_expect.common) (preprocess (pps ppx_expect)) (instrumentation diff --git a/otherlibs/dune-glob/test/dune b/otherlibs/dune-glob/test/dune index 901abe15afc5..cab5fe349f1e 100644 --- a/otherlibs/dune-glob/test/dune +++ b/otherlibs/dune-glob/test/dune @@ -6,11 +6,7 @@ dune_glob ;; This is because of the (implicit_transitive_deps false) ;; in dune-project - ppx_expect.config - ppx_expect.config_types - ppx_expect.common - base - ppx_inline_test.config) + ppx_expect.common) (preprocess (pps ppx_expect)) (instrumentation diff --git a/otherlibs/dune-rpc-lwt/test/dune b/otherlibs/dune-rpc-lwt/test/dune index 244addb1a6a8..0012bdbbc137 100644 --- a/otherlibs/dune-rpc-lwt/test/dune +++ b/otherlibs/dune-rpc-lwt/test/dune @@ -17,10 +17,6 @@ dune_rpc_lwt ;; This is because of the (implicit_transitive_deps false) ;; in dune-project - ppx_expect.config - ppx_expect.config_types - ppx_expect.common - base - ppx_inline_test.config) + ppx_expect.common) (preprocess (pps ppx_expect))) diff --git a/otherlibs/dune-site/src/dune b/otherlibs/dune-site/src/dune index 087ad1023d6d..2ec9cce86e5f 100644 --- a/otherlibs/dune-site/src/dune +++ b/otherlibs/dune-site/src/dune @@ -6,6 +6,6 @@ (special_builtin_support (dune_site (data_module dune_site_data))) - (libraries dune-private-libs.dune-section dune-site.private) + (libraries (re_export dune-private-libs.dune-section) dune-site.private) (instrumentation (backend bisect_ppx))) diff --git a/otherlibs/stdune/src/stdune.ml b/otherlibs/stdune/src/stdune.ml index d281bc9785a9..977b8ebc07dd 100644 --- a/otherlibs/stdune/src/stdune.ml +++ b/otherlibs/stdune/src/stdune.ml @@ -1,5 +1,3 @@ - - module Appendable_list = Appendable_list module Nonempty_list = Nonempty_list module Ansi_color = Ansi_color diff --git a/otherlibs/stdune/test/dune b/otherlibs/stdune/test/dune index 786b7ad9561a..aed306512d1c 100644 --- a/otherlibs/stdune/test/dune +++ b/otherlibs/stdune/test/dune @@ -10,10 +10,6 @@ unix ;; This is because of the (implicit_transitive_deps false) ;; in dune-project - ppx_expect.config - ppx_expect.config_types - ppx_expect.common - base - ppx_inline_test.config) + ppx_expect.common) (preprocess (pps ppx_expect))) diff --git a/src/dune_rules/compilation_context.ml b/src/dune_rules/compilation_context.ml index 9b7f22abe872..3d31c48a43c4 100644 --- a/src/dune_rules/compilation_context.ml +++ b/src/dune_rules/compilation_context.ml @@ -7,25 +7,26 @@ module Includes = struct (* TODO : some of the requires can filtered out using [ocamldep] info *) let open Resolve.Memo.O in let iflags libs mode = Lib_flags.L.include_flags ~project libs mode in - let make_includes_args ~mode groups = Command.Args.memo (Resolve.Memo.args (let+ libs = requires in Command.Args.S - [ iflags libs mode; Hidden_deps (Lib_file_deps.deps libs ~groups) ])) + [ iflags libs mode + ; Hidden_deps (Lib_file_deps.deps (List.map ~f:fst libs) ~groups) + ])) in let cmi_includes = make_includes_args ~mode:(Ocaml Byte) [ Ocaml Cmi ] in let cmx_includes = Command.Args.memo (Resolve.Memo.args - (let+ libs = requires in (* requires here represents the list of deps of the target library; it is equal to requires_compile 1.1*) + (let+ libs = requires in Command.Args.S [ iflags libs (Ocaml Native) ; Hidden_deps (if opaque then - List.map libs ~f:(fun lib -> + List.map libs ~f:(fun (lib, _) -> ( lib , if Lib.is_local lib then [ Lib_file_deps.Group.Ocaml Cmi ] @@ -33,7 +34,7 @@ module Includes = struct |> Lib_file_deps.deps_with_exts else Lib_file_deps.deps - libs + (List.map ~f:fst libs) ~groups:[ Lib_file_deps.Group.Ocaml Cmi; Ocaml Cmx ]) ])) in @@ -44,7 +45,6 @@ module Includes = struct { ocaml = { cmi = cmi_includes; cmo = cmi_includes; cmx = cmx_includes } ; melange = { cmi = melange_cmi_includes; cmj = melange_cmj_includes } } - ;; let empty = Lib_mode.Cm_kind.Map.make_all Command.Args.empty @@ -75,8 +75,9 @@ type t = ; obj_dir : Path.Build.t Obj_dir.t ; modules : modules ; flags : Ocaml_flags.t - ; requires_compile : Lib.t list Resolve.Memo.t - ; requires_link : Lib.t list Resolve.t Memo.Lazy.t (*list of libraries: the type here consists of a path and a library name*) + ; requires_compile : (Lib.t * bool) list Resolve.Memo.t + (*list of libraries: the type here consists of a path and a library name*) + ; requires_link : Lib.t list Resolve.t Memo.Lazy.t ; includes : Includes.t ; preprocessing : Pp_spec.t ; opaque : bool @@ -141,12 +142,6 @@ let create = let open Memo.O in let project = Scope.project scope in - let requires_compile = - if Dune_project.implicit_transitive_deps project - then Memo.Lazy.force requires_link - else requires_compile (*here, we test for ITD: if it is true, then the all deps required for linking are added; if false only those specified in the library stanza 1.2*) - in - let sandbox = (* With sandboxing, there are a few build errors in ocaml platform 1162238ae like: File "ocaml_modules/ocamlgraph/src/pack.ml", line 1: Error: The @@ -155,6 +150,25 @@ let create ocaml_modules/ocamlgraph/src/.graph.objs/byte/graph__Pack.cmi: *) Sandbox_config.no_sandboxing in + let context = Super_context.context super_context in + let* ocaml = Context.ocaml context in + let _dune_version = Dune_project.dune_version project in + let requires_compile = + let requires_link = Memo.Lazy.force requires_link in + if Dune_project.implicit_transitive_deps project + then Resolve.Memo.map ~f:(List.map ~f:(fun lib -> lib, true)) requires_link + else if Version.supports_hidden_includes ocaml.version + then + let open Resolve.Memo.O in + let* requires_compile = requires_compile in + let requires_compile = + Lib.Tbl.of_list_exn (List.map ~f:(fun lib -> lib, ()) requires_compile) + in + Resolve.Memo.map + ~f:(List.map ~f:(fun lib -> lib, Lib.Tbl.mem requires_compile lib)) + requires_link + else Resolve.Memo.map ~f:(List.map ~f:(fun lib -> lib, true)) requires_compile + in let modes = let default = { Lib_mode.Map.ocaml = Mode.Dict.make_both (Some Mode_conf.Kind.Inherited) @@ -163,8 +177,6 @@ let create in Option.value ~default modes |> Lib_mode.Map.map ~f:Option.is_some in - let context = Super_context.context super_context in - let* ocaml = Context.ocaml context in let opaque = let profile = Context.profile context in eval_opaque ocaml profile opaque @@ -192,7 +204,7 @@ let create ; flags ; requires_compile ; requires_link - ; includes = Includes.make ~project ~opaque ~requires:requires_compile (*it is finally added in making the includes in the compilation context 1.3*) + ; includes = Includes.make ~project ~opaque ~requires:requires_compile ; preprocessing ; opaque ; stdlib @@ -273,13 +285,18 @@ let for_module_generated_at_link_time cctx ~requires ~module_ = their implementation must also be compiled with -opaque *) Ocaml.Version.supports_opaque_for_mli cctx.ocaml.version in + let requires_compile = + Resolve.Memo.map ~f:(List.map ~f:(fun lib -> lib, true)) requires + in let modules = singleton_modules module_ in - let includes = Includes.make ~project:(Scope.project cctx.scope) ~opaque ~requires in + let includes = + Includes.make ~project:(Scope.project cctx.scope) ~opaque ~requires:requires_compile + in { cctx with opaque ; flags = Ocaml_flags.empty ; requires_link = Memo.lazy_ (fun () -> requires) - ; requires_compile = requires + ; requires_compile ; includes ; modules } @@ -312,7 +329,7 @@ let root_module_entries t = let open Action_builder.O in let* requires = Resolve.Memo.read t.requires_compile in let* l = - Action_builder.List.map requires ~f:(fun lib -> + Action_builder.List.map requires ~f:(fun (lib, _) -> Action_builder.of_memo (entry_module_names t.super_context lib) >>= Resolve.read) in Action_builder.return (List.concat l) diff --git a/src/dune_rules/compilation_context.mli b/src/dune_rules/compilation_context.mli index 643466e623a5..a46af97cc923 100644 --- a/src/dune_rules/compilation_context.mli +++ b/src/dune_rules/compilation_context.mli @@ -55,7 +55,7 @@ val obj_dir : t -> Path.Build.t Obj_dir.t val modules : t -> Modules.With_vlib.t val flags : t -> Ocaml_flags.t val requires_link : t -> Lib.t list Resolve.Memo.t -val requires_compile : t -> Lib.t list Resolve.Memo.t +val requires_compile : t -> (Lib.t * bool) list Resolve.Memo.t val includes : t -> Command.Args.without_targets Command.Args.t Lib_mode.Cm_kind.Map.t val preprocessing : t -> Pp_spec.t val opaque : t -> bool diff --git a/src/dune_rules/exe_rules.ml b/src/dune_rules/exe_rules.ml index 536ee728ab99..c883a75486a7 100644 --- a/src/dune_rules/exe_rules.ml +++ b/src/dune_rules/exe_rules.ml @@ -182,6 +182,8 @@ let executables_rules let lib_config = ocaml.lib_config in let stdlib_dir = lib_config.stdlib_dir in let* requires_compile = Compilation_context.requires_compile cctx in + let requires_compile = Resolve.map ~f:(List.map ~f:fst) requires_compile in + let* requires_link = Compilation_context.requires_link cctx in let* dep_graphs = (* Building an archive for foreign stubs, we link the corresponding object files directly to improve perf. *) @@ -265,7 +267,7 @@ let executables_rules in ( cctx , Merlin.make - ~requires:requires_compile + ~requires:requires_link ~stdlib_dir ~flags ~modules diff --git a/src/dune_rules/lib.ml b/src/dune_rules/lib.ml index 67aa1acd0f14..194881386fbf 100644 --- a/src/dune_rules/lib.ml +++ b/src/dune_rules/lib.ml @@ -350,6 +350,10 @@ module T = struct Dyn.record [ "name", Lib_name.to_dyn t.name; "loc", Loc.to_dyn_hum (Lib_info.loc t.info) ] ;; + + (* We can't write a structural equality because of all the lazy fields *) + let equal : t -> t -> bool = phys_equal + let hash = Poly.hash end include T @@ -469,11 +473,8 @@ let wrapped t = | Some (This x) -> Some x) ;; -(* We can't write a structural equality because of all the lazy fields *) -let equal : t -> t -> bool = phys_equal -let hash = Poly.hash - include Comparable.Make (T) +module Tbl = Hashtbl.Make (T) module L = struct let top_closure l ~key ~deps = @@ -665,7 +666,7 @@ module Vlib : sig Additionally, if linking is [true], ensures that every virtual library as an implementation and re-arrange the list so that implementations replaces virtual libraries. *) - val associate : (t * bool * Dep_stack.t) list -> linking:bool -> t list Resolve.Memo.t + val associate : (t * Dep_stack.t) list -> linking:bool -> t list Resolve.Memo.t module Unimplemented : sig (** set of unimplemented libraries*) @@ -713,7 +714,7 @@ end = struct module Partial = struct type vlib_status = | No_impl of Dep_stack.t - | Impl of lib * bool * Dep_stack.t + | Impl of lib * Dep_stack.t type t = vlib_status Map.t @@ -722,7 +723,7 @@ end = struct let make closure : t Resolve.Memo.t = let rec loop acc = function | [] -> Resolve.Memo.return acc - | (lib, _direct, stack) :: libs -> + | (lib, stack) :: libs -> let virtual_ = Lib_info.virtual_ lib.info in (match lib.implements, virtual_ with | None, None -> loop acc libs @@ -735,8 +736,8 @@ end = struct (* we've already traversed the virtual library because it must have occurred earlier in the closure *) assert false - | Some (No_impl _) -> loop (Map.set acc vlib (Impl (lib, _direct, stack))) libs - | Some (Impl (lib', _direct, stack')) -> + | Some (No_impl _) -> loop (Map.set acc vlib (Impl (lib, stack))) libs + | Some (Impl (lib', stack')) -> let req_by' = Dep_stack.to_required_by stack' in let req_by = Dep_stack.to_required_by stack in Error.double_implementation @@ -756,7 +757,7 @@ end = struct | (vlib, Partial.No_impl stack) :: _ -> let rb = Dep_stack.to_required_by stack in Error.no_implementation (vlib.info, rb) - | (vlib, Impl (impl, _direct, _stack)) :: libs -> loop (Map.set acc vlib impl) libs + | (vlib, Impl (impl, _stack)) :: libs -> loop (Map.set acc vlib impl) libs in loop Map.empty (Map.to_list impls) ;; @@ -795,7 +796,7 @@ end = struct let associate closure ~linking = let* impls = Table.Partial.make closure in - let closure = List.map closure ~f:(fun (lib, _direct, _stack) -> lib) in + let closure = List.map closure ~f:fst in if linking && not (Table.Partial.is_empty impls) then let* impls = Table.make impls in @@ -1641,7 +1642,7 @@ end = struct module R = struct type state = - { result : (lib * bool * Dep_stack.t) list + { result : (lib * Dep_stack.t) list ; visited : Set.t ; unimplemented : Vlib.Unimplemented.t } @@ -1663,18 +1664,12 @@ end = struct let result computation ~linking = let* state, () = R.run computation R.empty_state in - (*print_endline "-------------------"; - List.iter ~f:(fun (lib, _deps) -> - print_endline (Lib_name.to_string lib.name) - ) state.result;*) (*R.run? 1.2*) Vlib.associate (List.rev state.result) ~linking ;; let rec visit (t : t) ~stack (implements_via, lib) = let open R.O in let* state = R.get in - let () = print_endline "visit" - in if Set.mem state.visited lib then R.return () else ( @@ -1720,27 +1715,19 @@ end = struct R.modify (fun state -> { state with unimplemented = unimplemented' }) in let* () = R.List.iter deps ~f:(fun l -> visit t (None, l) ~stack:new_stack) in - R.modify (fun state -> { state with result = (lib, true, stack) :: state.result })) + R.modify (fun state -> { state with result = (lib, stack) :: state.result })) ;; end let step1_closure db ts ~forbidden_libraries = let closure = Closure.make ~db ~forbidden_libraries in - ( closure , Closure.R.List.iter ts ~f:(fun lib -> - Closure.visit closure ~stack:Dep_stack.empty (None, lib) - )) + Closure.visit closure ~stack:Dep_stack.empty (None, lib)) ) ;; - (*function to a state with the booleans set right*) - let set_direct_deps ~result ts = - List.map result ~f:(fun (lib, _direct, stack) -> - (lib, (List.mem ts lib ~equal:(fun lib t -> lib = t)), stack)) - let compile_closure_with_overlap_checks db ts ~forbidden_libraries = let _closure, state = step1_closure db ts ~forbidden_libraries in - let* state = Closure.R.modify (fun state -> {state with result = set_direct_deps ~result:state.result ts}) in Closure.result state ~linking:false ;; @@ -1773,7 +1760,6 @@ end let closure l ~linking = let forbidden_libraries = Map.empty in - if linking then Resolve_names.linking_closure_with_overlap_checks None l ~forbidden_libraries else Resolve_names.compile_closure_with_overlap_checks None l ~forbidden_libraries @@ -1844,7 +1830,7 @@ module Compile = struct let db = Option.some_if (not allow_overlaps) db in Memo.lazy_ (fun () -> requires - >>= Resolve_names.compile_closure_with_overlap_checks (*1.5*) + >>= Resolve_names.compile_closure_with_overlap_checks db ~forbidden_libraries:Map.empty) in @@ -2059,7 +2045,7 @@ module DB = struct ~private_deps:Allow_all ~dune_version:(Some dune_version)) in - let requires_link = (*here is the definition of requires_link 1.1*) + let requires_link = Memo.Lazy.create (fun () -> let* forbidden_libraries = Resolve.Memo.List.map forbidden_libraries ~f:(fun (loc, name) -> diff --git a/src/dune_rules/lib.mli b/src/dune_rules/lib.mli index 4952c57067ed..9793f5654ec5 100644 --- a/src/dune_rules/lib.mli +++ b/src/dune_rules/lib.mli @@ -235,3 +235,5 @@ module Local : sig include Comparable_intf.S with type key := t end + +module Tbl : Hashtbl.S with type key := t diff --git a/src/dune_rules/lib_flags.ml b/src/dune_rules/lib_flags.ml index 3eab4dd2fe81..2750f6c662fd 100644 --- a/src/dune_rules/lib_flags.ml +++ b/src/dune_rules/lib_flags.ml @@ -92,18 +92,84 @@ module L = struct |> List.rev) ;; + let to_flags dirs = + Command.Args.S + (Path.Map.foldi dirs ~init:[] ~f:(fun dir direct acc -> + Command.Args.Path dir :: A (if direct then "-I" else "-H") :: acc) + |> List.rev) + ;; + let remove_stdlib dirs libs = match libs with | [] -> dirs | lib :: _ -> Path.Set.remove dirs (Lib.lib_config lib).stdlib_dir ;; + let remove_stdlib_map dirs libs = + match libs with + | [] -> dirs + | (lib, _) :: _ -> Path.Map.remove dirs (Lib.lib_config lib).stdlib_dir + ;; + type mode = { lib_mode : Lib_mode.t ; melange_emit : bool } - let include_paths = + let include_paths_map = + let add_public_dir ~visible_cmi obj_dir acc mode (direct : bool) = + match visible_cmi with + | false -> acc + | true -> + let public_cmi_dirs = + List.map + ~f:(fun f -> f obj_dir) + (match mode with + | { lib_mode = Ocaml _; _ } -> [ Obj_dir.public_cmi_ocaml_dir ] + | { lib_mode = Melange; melange_emit = false } -> + [ Obj_dir.public_cmi_melange_dir ] + | { lib_mode = Melange; melange_emit = true } -> + (* Add the dir where `.cmj` files exist, even for installed + private libraries. Melange needs to query `.cmj` files for + `import` information *) + [ Obj_dir.melange_dir; Obj_dir.public_cmi_melange_dir ]) + in + List.fold_left public_cmi_dirs ~init:acc ~f:(fun acc path -> + Path.Map.set acc path direct) + in + fun ?project ts mode -> + let visible_cmi = + match project with + | None -> fun _ -> true + | Some project -> + let check_project lib = + match Lib.project lib with + | None -> false + | Some project' -> Dune_project.equal project project' + in + fun lib -> + (match Lib_info.status (Lib.info lib) with + | Private (_, Some _) | Installed_private -> check_project lib + | _ -> true) + in + let dirs = + List.fold_left ts ~init:Path.Map.empty ~f:(fun acc (t, direct) -> + let obj_dir = Lib_info.obj_dir (Lib.info t) in + let visible_cmi = visible_cmi t in + match mode.lib_mode with + | Melange -> add_public_dir ~visible_cmi obj_dir acc mode direct + | Ocaml ocaml_mode -> + let acc = add_public_dir ~visible_cmi obj_dir acc mode direct in + (match ocaml_mode with + | Byte -> acc + | Native -> + let native_dir = Obj_dir.native_dir obj_dir in + Path.Map.set acc native_dir direct)) + in + remove_stdlib_map dirs ts + ;; + + (*let include_paths = let add_public_dir ~visible_cmi obj_dir acc mode = match visible_cmi with | false -> acc @@ -153,10 +219,16 @@ module L = struct Path.Set.add acc native_dir)) in remove_stdlib dirs ts + ;;*) + + let include_paths ?project ts mode = + let ts = List.map ~f:(fun lib -> lib, true) ts in + let paths = include_paths_map ?project ts mode in + Path.Map.foldi ~init:Path.Set.empty ~f:(fun path _ acc -> Path.Set.add acc path) paths ;; let include_flags ?project ts mode = - to_iflags (include_paths ?project ts { lib_mode = mode; melange_emit = false }) + to_flags (include_paths_map ?project ts { lib_mode = mode; melange_emit = false }) ;; let melange_emission_include_flags ?project ts = diff --git a/src/dune_rules/lib_flags.mli b/src/dune_rules/lib_flags.mli index 1faa6dee7b7d..afb35bddea8c 100644 --- a/src/dune_rules/lib_flags.mli +++ b/src/dune_rules/lib_flags.mli @@ -23,8 +23,8 @@ 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_flags : ?project:Dune_project.t -> t -> Lib_mode.t -> _ Command.Args.t + val include_paths : ?project:Dune_project.t -> Lib.t list -> Lib_mode.t -> Path.Set.t + val include_flags : ?project:Dune_project.t -> (Lib.t * bool) list -> Lib_mode.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 diff --git a/src/dune_rules/lib_rules.ml b/src/dune_rules/lib_rules.ml index 82f729dd807b..16794eafb52b 100644 --- a/src/dune_rules/lib_rules.ml +++ b/src/dune_rules/lib_rules.ml @@ -578,7 +578,9 @@ let library_rules let dir = Compilation_context.dir cctx in let scope = Compilation_context.scope cctx in let* requires_compile = Compilation_context.requires_compile cctx in + let requires_compile = Resolve.map ~f:(List.map ~f:fst) requires_compile in let ocaml = Compilation_context.ocaml cctx in + let* requires_link = Compilation_context.requires_link cctx in let stdlib_dir = ocaml.lib_config.stdlib_dir in let top_sorted_modules = let impl_only = Modules.With_vlib.impl_only modules in @@ -631,7 +633,7 @@ let library_rules in ( cctx , Merlin.make - ~requires:requires_compile + ~requires:requires_link ~stdlib_dir ~flags ~modules diff --git a/src/dune_rules/melange/melange_rules.ml b/src/dune_rules/melange/melange_rules.ml index 8756671ed3f7..4a75c84402e3 100644 --- a/src/dune_rules/melange/melange_rules.ml +++ b/src/dune_rules/melange/melange_rules.ml @@ -327,6 +327,7 @@ let setup_emit_cmj_rules in let* () = Module_compilation.build_all cctx in let* requires_compile = Compilation_context.requires_compile cctx in + let requires_compile = Resolve.map ~f:(List.map ~f:fst) requires_compile in let stdlib_dir = (Compilation_context.ocaml cctx).lib_config.stdlib_dir in let+ () = let emit_and_libs_deps = diff --git a/src/dune_rules/module_compilation.ml b/src/dune_rules/module_compilation.ml index f60e894f24cf..6b5f82150c63 100644 --- a/src/dune_rules/module_compilation.ml +++ b/src/dune_rules/module_compilation.ml @@ -128,9 +128,8 @@ let build_cm let+ src = Module.file m ~ml_kind in let dst = Obj_dir.Module.cm_file_exn obj_dir m ~kind:cm_kind in let obj = - Obj_dir.Module.obj_file obj_dir m ~kind:(Ocaml Cmx) ~ext:ocaml.lib_config.ext_obj (*here*) + Obj_dir.Module.obj_file obj_dir m ~kind:(Ocaml Cmx) ~ext:ocaml.lib_config.ext_obj in - let open Memo.O in let* extra_args, extra_deps, other_targets = if precompiled_cmi @@ -231,7 +230,7 @@ let build_cm in let obj_dirs = Obj_dir.all_obj_dirs obj_dir ~mode - |> List.concat_map ~f:(fun p -> [ Command.Args.A "-I"; Path (Path.build p) ]) (*function to construct the set of -I statements on the commandline, given the set of includes 1.1*) + |> List.concat_map ~f:(fun p -> [ Command.Args.A "-I"; Path (Path.build p) ]) in Super_context.add_rule sctx @@ -290,7 +289,6 @@ let build_module ?(force_write_cmi = false) ?(precompiled_cmi = false) cctx m = Ocaml.Version.supports_split_at_emit ocaml.version || Ocaml_config.is_dev_version ocaml.ocaml_config in - match Context.fdo_target_exe ctx, can_split with | None, _ -> build_cm ~cm_kind:(Ocaml Cmx) ~phase:None | Some _, false -> build_cm ~cm_kind:(Ocaml Cmx) ~phase:(Some All) @@ -481,8 +479,6 @@ let build_root_module cctx root_module = let sctx = Compilation_context.super_context cctx in let file = Option.value_exn (Module.file root_module ~ml_kind:Impl) in let dir = Compilation_context.dir cctx in - - let open Memo.O in let* () = Super_context.add_rule diff --git a/src/dune_rules/odoc.ml b/src/dune_rules/odoc.ml index 9a8304c8d0b1..9911328fad7b 100644 --- a/src/dune_rules/odoc.ml +++ b/src/dune_rules/odoc.ml @@ -407,6 +407,7 @@ let setup_library_odoc_rules cctx (local_lib : Lib.Local.t) = let modules = Compilation_context.modules cctx in let* includes = let+ requires = Compilation_context.requires_compile cctx in + let requires = Resolve.map ~f:(List.map ~f:fst) requires in let package = Lib_info.package info in let odoc_include_flags = Command.Args.memo (odoc_include_flags ctx package requires) diff --git a/src/dune_rules/toplevel.ml b/src/dune_rules/toplevel.ml index a657f7bf3b47..de6938662984 100644 --- a/src/dune_rules/toplevel.ml +++ b/src/dune_rules/toplevel.ml @@ -113,6 +113,7 @@ let setup_module_rules t = let sctx = Compilation_context.super_context t.cctx in let path = Source.source_path t.source in let requires_compile = Compilation_context.requires_compile t.cctx in + let requires_compile = Resolve.Memo.map ~f:(List.map ~f:fst) requires_compile in let main_ml = let open Action_builder.O in Action_builder.write_file_dyn diff --git a/src/ocaml/version.ml b/src/ocaml/version.ml index 09c06cdb765a..b1ef500dc3b3 100644 --- a/src/ocaml/version.ml +++ b/src/ocaml/version.ml @@ -28,3 +28,4 @@ let has_bigarray_library version = version < (5, 0, 0) let supports_alerts version = version >= (4, 8, 0) let has_sandboxed_otherlibs version = version >= (5, 0, 0) let has_META_files version = version >= (5, 0, 0) +let supports_hidden_includes version = version >= (5, 2, 0) diff --git a/src/ocaml/version.mli b/src/ocaml/version.mli index 8291d77deb20..01d59da1ca58 100644 --- a/src/ocaml/version.mli +++ b/src/ocaml/version.mli @@ -73,3 +73,6 @@ val has_sandboxed_otherlibs : t -> bool (** Whether the compiler distributes META files independently of ocamlfind *) val has_META_files : t -> bool + +(**Whether the compiler supports -H flag for including libs*) +val supports_hidden_includes : t -> bool diff --git a/test/blackbox-tests/test-cases/hidden-deps.t/bar.ml b/test/blackbox-tests/test-cases/hidden-deps.t/bar.ml new file mode 100644 index 000000000000..e1ca0d9c772b --- /dev/null +++ b/test/blackbox-tests/test-cases/hidden-deps.t/bar.ml @@ -0,0 +1,3 @@ +let x = 5 + +let y = Foo.v \ No newline at end of file diff --git a/test/blackbox-tests/test-cases/hidden-deps.t/bash.sh b/test/blackbox-tests/test-cases/hidden-deps.t/bash.sh new file mode 100755 index 000000000000..f992ee3cd119 --- /dev/null +++ b/test/blackbox-tests/test-cases/hidden-deps.t/bash.sh @@ -0,0 +1,76 @@ +#! /bin/bash +ver=`ocamlc -H x` +case "$ver" in +"No input files") + # here, we have a compiler that supports -H flag + # case for ITD set to false + + cat > dune-project << EOF + (lang dune 3.15) + (implicit_transitive_deps false) + EOF + includes=`dune build --verbose ./run.exe 2>&1 | grep -E -o "\-H\s\S*" | sed s/\-H//g` + includes="$(echo "${includes}" | tr -d '[:space:]')" + if [ "$includes" = '.foo.objs/byte.foo.objs/byte.foo.objs/native.foo.objs/byte.foo.objs/native' ]; then + echo "OKAY" + else + echo "ERROR" + fi + # case for ITD set to true + cat > dune-project << EOF + (lang dune 3.15) + (implicit_transitive_deps true) + EOF + includes=`dune build --verbose ./run.exe 2>&1 | grep -E -o "\-I\s\S*" | sed s/\-I//g` + includes="$(echo "${includes}" | tr -d '[:space:]')" + if [ "$includes" = '.foo.objs/byte.foo.objs/byte.foo.objs/native.foo.objs/byte.foo.objs/native' ]; then + echo "OKAY" + else + echo "ERROR" + fi + ;; +*) + # here, we have a compiler that does not support -H flag + # case for ITD set to false + cat > dune-project << EOF + (lang dune 3.15) + (implicit_transitive_deps false) + EOF + includes=`dune build --verbose ./run.exe 2>&1 | grep -E -o "\-I\s(.foo)\S*" | sed s/\-I//g` + includes="$(echo "${includes}" | tr -d '[:space:]')" + if [ "$includes" = '' ]; then + echo "OKAY" + else + echo "ERROR" + fi + # case for ITD set to true + cat > dune-project << EOF + (lang dune 3.15) + (implicit_transitive_deps true) + EOF + includes=`dune build --verbose ./run.exe 2>&1 | grep -E -o "\-I\s(.foo)\S*" | sed s/\-I//g` + includes="$(echo "${includes}" | tr -d '[:space:]')" + if [ "$includes" = '.foo.objs/byte.foo.objs/byte.foo.objs/native.foo.objs/byte.foo.objs/native' ]; then + echo "OKAY" + else + echo "ERROR" + fi + ;; +ac + + + + + + + + + +#if [ $ver == 5.2.0~beta2 ] || [ $ver == 5.2.0 ] || [ $ver == 5.2.0+options ] || [ $ver == 5.2.0+options ] || [ $ver == 5.2.0+statmemprof ] || [ $ver == 5.3.0+trunk ]; then + # Run the command +# FLAG=\-H +# dune build --verbose ./run.exe 2>&1 | sed s/$FLAG/\-X/g | grep -E -o "\-X\s\S*" +#else +# FLAG=\-I +# dune build --verbose ./run.exe 2>&1 | sed s/$FLAG/\-X/g | grep -E -o "\-X\s(.foo)\S*" | sed -e '3d' +#fi \ No newline at end of file diff --git a/test/blackbox-tests/test-cases/hidden-deps.t/dune b/test/blackbox-tests/test-cases/hidden-deps.t/dune new file mode 100644 index 000000000000..1807d44bebac --- /dev/null +++ b/test/blackbox-tests/test-cases/hidden-deps.t/dune @@ -0,0 +1,18 @@ +(library + (name foo) + (modules foo)) + +(library + (name bar) + (modules bar) + (libraries foo)) + +(executable + (name run) + (modules run) + (libraries bar)) + + (executable + (name runf) + (modules runf) + (libraries bar)) diff --git a/test/blackbox-tests/test-cases/hidden-deps.t/foo.ml b/test/blackbox-tests/test-cases/hidden-deps.t/foo.ml new file mode 100644 index 000000000000..233654b2d90c --- /dev/null +++ b/test/blackbox-tests/test-cases/hidden-deps.t/foo.ml @@ -0,0 +1,3 @@ +let v = 9 + +let w = 4 \ No newline at end of file diff --git a/test/blackbox-tests/test-cases/hidden-deps.t/run.ml b/test/blackbox-tests/test-cases/hidden-deps.t/run.ml new file mode 100644 index 000000000000..397fe01f44e4 --- /dev/null +++ b/test/blackbox-tests/test-cases/hidden-deps.t/run.ml @@ -0,0 +1 @@ +let a = Bar.y \ No newline at end of file diff --git a/test/blackbox-tests/test-cases/hidden-deps.t/run.t b/test/blackbox-tests/test-cases/hidden-deps.t/run.t new file mode 100644 index 000000000000..1db0582b8300 --- /dev/null +++ b/test/blackbox-tests/test-cases/hidden-deps.t/run.t @@ -0,0 +1,72 @@ +Should include Foo with -H: + $ ver=`ocamlc -H x` + > case "$ver" in + > "No input files") + > # here, we have a compiler that supports -H flag + > # case for ITD set to false + > cat > dune-project << EOF + > (lang dune 3.15) + > (implicit_transitive_deps false) + > EOF + > includes=`dune build --verbose ./run.exe 2>&1 | grep -E -o "\-H\s\S*" | sed s/\-H//g` + > includes="$(echo "${includes}" | tr -d '[:space:]')" + > if [ "$includes" = '.foo.objs/byte.foo.objs/byte.foo.objs/native.foo.objs/byte.foo.objs/native' ]; then + > echo "OKAY" + > else + > echo "ERROR" + > fi + > # case for ITD set to true + > cat > dune-project << EOF + > (lang dune 3.15) + > (implicit_transitive_deps true) + > EOF + > includes=`dune build --verbose ./run.exe 2>&1 | grep -E -o "\-I\s\S*" | sed s/\-I//g` + > includes="$(echo "${includes}" | tr -d '[:space:]')" + > if [ "$includes" = '.foo.objs/byte.foo.objs/byte.foo.objs/native.foo.objs/byte.foo.objs/native' ]; then + > echo "OKAY" + > else + > echo "ERROR" + > fi + > ;; + > *) + > # here, we have a compiler that does not support -H flag + > # case for ITD set to false + > cat > dune-project << EOF + > (lang dune 3.15) + > (implicit_transitive_deps false) + > EOF + > includes=`dune build --verbose ./run.exe 2>&1 | grep -E -o "\-I\s(.foo)\S*" | sed s/\-I//g` + > includes="$(echo "${includes}" | tr -d '[:space:]')" + > if [ "$includes" = '' ]; then + > echo "OKAY" + > else + > echo "ERROR" + > fi + > # case for ITD set to true + > cat > dune-project << EOF + > (lang dune 3.15) + > (implicit_transitive_deps true) + > EOF + > includes=`dune build --verbose ./run.exe 2>&1 | grep -E -o "\-I\s(.foo)\S*" | sed s/\-I//g` + > includes="$(echo "${includes}" | tr -d '[:space:]')" + > if [ "$includes" = '.foo.objs/byte.foo.objs/byte.foo.objs/native.foo.objs/byte.foo.objs/native' ]; then + > echo "OKAY" + > else + > echo "ERROR" + > fi + > ;; + > esac + OKAY + OKAY + + +Test transitive deps can not be directly accessed, both for compiler versions supporting -H or not: + $ dune build ./runf.exe 2>&1 | grep -v ocamlc + File "runf.ml", line 1, characters 16-21: + 1 | let a = Bar.y + Foo.v + ^^^^^ + Error: Unbound module Foo + +Test that with ITD, transitive deps are directly accessible + $ dune exec with_ITD/runf.exe 2>&1 | grep -v ocamlc + 18 \ No newline at end of file diff --git a/test/blackbox-tests/test-cases/hidden-deps.t/runf.ml b/test/blackbox-tests/test-cases/hidden-deps.t/runf.ml new file mode 100644 index 000000000000..3e7e6b04ba1d --- /dev/null +++ b/test/blackbox-tests/test-cases/hidden-deps.t/runf.ml @@ -0,0 +1 @@ +let a = Bar.y + Foo.v \ No newline at end of file diff --git a/test/expect-tests/csexp_rpc/dune b/test/expect-tests/csexp_rpc/dune index 9ce62964f44b..182870a281fc 100644 --- a/test/expect-tests/csexp_rpc/dune +++ b/test/expect-tests/csexp_rpc/dune @@ -14,8 +14,4 @@ dune_tests_common ;; This is because of the (implicit_transitive_deps false) ;; in dune-project - ppx_expect.config - ppx_expect.config_types - ppx_expect.common - base - ppx_inline_test.config)) + ppx_expect.common)) diff --git a/test/expect-tests/dag/dune b/test/expect-tests/dag/dune index df41a34bebc4..f9b91bdbdee1 100644 --- a/test/expect-tests/dag/dune +++ b/test/expect-tests/dag/dune @@ -7,10 +7,6 @@ dag ;; This is because of the (implicit_transitive_deps false) ;; in dune-project - ppx_expect.config - ppx_expect.config_types - ppx_expect.common - base - ppx_inline_test.config) + ppx_expect.common) (preprocess (pps ppx_expect))) diff --git a/test/expect-tests/digest/dune b/test/expect-tests/digest/dune index 7c8ab26fa140..2ac50ae24135 100644 --- a/test/expect-tests/digest/dune +++ b/test/expect-tests/digest/dune @@ -7,10 +7,6 @@ unix ;; This is because of the (implicit_transitive_deps false) ;; in dune-project - ppx_expect.config - ppx_expect.config_types - ppx_expect.common - base - ppx_inline_test.config) + ppx_expect.common) (preprocess (pps ppx_expect))) diff --git a/test/expect-tests/dune b/test/expect-tests/dune index 93ba0bfb40b4..65f57bfc6b33 100644 --- a/test/expect-tests/dune +++ b/test/expect-tests/dune @@ -15,11 +15,7 @@ test_scheduler ;; This is because of the (implicit_transitive_deps false) ;; in dune-project - ppx_expect.config - ppx_expect.config_types - ppx_expect.common - base - ppx_inline_test.config) + ppx_expect.common) (inline_tests) (preprocess (pps ppx_expect))) @@ -44,11 +40,7 @@ test_scheduler ;; This is because of the (implicit_transitive_deps false) ;; in dune-project - ppx_expect.config - ppx_expect.config_types - ppx_expect.common - base - ppx_inline_test.config) + ppx_expect.common) (preprocess (pps ppx_expect))) @@ -67,8 +59,4 @@ dune_digest ;; This is because of the (implicit_transitive_deps false) ;; in dune-project - ppx_expect.config - ppx_expect.config_types - ppx_expect.common - base - ppx_inline_test.config)) + ppx_expect.common)) diff --git a/test/expect-tests/dune_async_io/dune b/test/expect-tests/dune_async_io/dune index b51f5aad039c..d2f638e49832 100644 --- a/test/expect-tests/dune_async_io/dune +++ b/test/expect-tests/dune_async_io/dune @@ -13,8 +13,4 @@ dune_tests_common ;; This is because of the (implicit_transitive_deps false) ;; in dune-project - ppx_expect.config - ppx_expect.config_types - ppx_expect.common - base - ppx_inline_test.config)) + ppx_expect.common)) diff --git a/test/expect-tests/dune_config_file/dune b/test/expect-tests/dune_config_file/dune index 6df0da6dac98..b6ede89d7886 100644 --- a/test/expect-tests/dune_config_file/dune +++ b/test/expect-tests/dune_config_file/dune @@ -8,10 +8,6 @@ stdune ;; This is because of the (implicit_transitive_deps false) ;; in dune-project - ppx_expect.config - ppx_expect.config_types - ppx_expect.common - base - ppx_inline_test.config) + ppx_expect.common) (preprocess (pps ppx_expect))) diff --git a/test/expect-tests/dune_console/dune b/test/expect-tests/dune_console/dune index 2c61a2b00f91..df7036f80c60 100644 --- a/test/expect-tests/dune_console/dune +++ b/test/expect-tests/dune_console/dune @@ -9,8 +9,4 @@ dune_tests_common ;; This is because of the (implicit_transitive_deps false) ;; in dune-project - ppx_expect.config - ppx_expect.config_types - ppx_expect.common - base - ppx_inline_test.config)) + ppx_expect.common)) diff --git a/test/expect-tests/dune_engine/dune b/test/expect-tests/dune_engine/dune index 0373ae9c8490..21af8c1c4133 100644 --- a/test/expect-tests/dune_engine/dune +++ b/test/expect-tests/dune_engine/dune @@ -9,10 +9,6 @@ dune_engine ;; This is because of the (implicit_transitive_deps false) ;; in dune-project - ppx_expect.config - ppx_expect.config_types - ppx_expect.common - base - ppx_inline_test.config) + ppx_expect.common) (preprocess (pps ppx_expect))) diff --git a/test/expect-tests/dune_file_watcher/dune b/test/expect-tests/dune_file_watcher/dune index 0a22c9e37d3f..c6041cb17242 100644 --- a/test/expect-tests/dune_file_watcher/dune +++ b/test/expect-tests/dune_file_watcher/dune @@ -14,14 +14,11 @@ (deps (sandbox always))) (libraries + unix dune_file_watcher dune_file_watcher_tests_lib - ppx_expect.config - ppx_expect.config_types ppx_expect.common - base stdune - ppx_inline_test.config threads.posix stdio spawn) @@ -39,12 +36,8 @@ (libraries dune_file_watcher dune_file_watcher_tests_lib - ppx_expect.config - ppx_expect.config_types ppx_expect.common - base stdune - ppx_inline_test.config threads.posix stdio spawn @@ -59,12 +52,8 @@ (deps (sandbox always))) (libraries - base dune_config_file dune_file_watcher - ppx_expect.config - ppx_expect.config_types - ppx_expect.common - ppx_inline_test.config) + ppx_expect.common) (preprocess (pps ppx_expect))) diff --git a/test/expect-tests/dune_lang/dune b/test/expect-tests/dune_lang/dune index 124bd5622cc6..060e84a18563 100644 --- a/test/expect-tests/dune_lang/dune +++ b/test/expect-tests/dune_lang/dune @@ -7,10 +7,6 @@ dune_lang ;; This is because of the (implicit_transitive_deps false) ;; in dune-project - ppx_expect.config - ppx_expect.config_types - ppx_expect.common - base - ppx_inline_test.config) + ppx_expect.common) (preprocess (pps ppx_expect))) diff --git a/test/expect-tests/dune_patch/dune b/test/expect-tests/dune_patch/dune index f2ca9bb63c26..c127b2f8b821 100644 --- a/test/expect-tests/dune_patch/dune +++ b/test/expect-tests/dune_patch/dune @@ -12,10 +12,6 @@ test_scheduler ;; This is because of the (implicit_transitive_deps false) ;; in dune-project - base - ppx_expect.config - ppx_expect.config_types - ppx_expect.common - ppx_inline_test.config) + ppx_expect.common) (preprocess (pps ppx_expect))) diff --git a/test/expect-tests/dune_pkg/dune b/test/expect-tests/dune_pkg/dune index 4155ed7e2b78..e4b9e6373bfd 100644 --- a/test/expect-tests/dune_pkg/dune +++ b/test/expect-tests/dune_pkg/dune @@ -18,10 +18,7 @@ base ;; This is because of the (implicit_transitive_deps false) ;; in dune-project - ppx_expect.config - ppx_expect.config_types - ppx_expect.common - ppx_inline_test.config) + ppx_expect.common) (preprocess (pps ppx_expect))) diff --git a/test/expect-tests/dune_pkg_outdated/dune b/test/expect-tests/dune_pkg_outdated/dune index 0efb7c5859aa..562d9443f34a 100644 --- a/test/expect-tests/dune_pkg_outdated/dune +++ b/test/expect-tests/dune_pkg_outdated/dune @@ -9,10 +9,6 @@ dune_console ;; This is because of the (implicit_transitive_deps false) ;; in dune-project - base - ppx_expect.config - ppx_expect.config_types - ppx_expect.common - ppx_inline_test.config) + ppx_expect.common) (preprocess (pps ppx_expect))) diff --git a/test/expect-tests/dune_rpc/dune b/test/expect-tests/dune_rpc/dune index 0638db55ef2a..a8f852b3bdea 100644 --- a/test/expect-tests/dune_rpc/dune +++ b/test/expect-tests/dune_rpc/dune @@ -14,10 +14,6 @@ fiber ;; This is because of the (implicit_transitive_deps false) ;; in dune-project - ppx_expect.config - ppx_expect.config_types - ppx_expect.common - base - ppx_inline_test.config) + ppx_expect.common) (preprocess (pps ppx_expect))) diff --git a/test/expect-tests/dune_rpc_e2e/dune b/test/expect-tests/dune_rpc_e2e/dune index 5e0a604b408b..16c41e052c3c 100644 --- a/test/expect-tests/dune_rpc_e2e/dune +++ b/test/expect-tests/dune_rpc_e2e/dune @@ -14,11 +14,7 @@ csexp_rpc ;; This is because of the (implicit_transitive_deps false) ;; in dune-project - ppx_expect.config - ppx_expect.config_types - ppx_expect.common - base - ppx_inline_test.config) + ppx_expect.common) (preprocess (pps ppx_expect))) @@ -37,11 +33,7 @@ dune_rpc_impl ;; This is because of the (implicit_transitive_deps false) ;; in dune-project - ppx_expect.config - ppx_expect.config_types - ppx_expect.common - base - ppx_inline_test.config) + ppx_expect.common) (preprocess (pps ppx_expect))) @@ -64,11 +56,7 @@ unix ;; This is because of the (implicit_transitive_deps false) ;; in dune-project - ppx_expect.config - ppx_expect.config_types - ppx_expect.common - base - ppx_inline_test.config) + ppx_expect.common) (preprocess (pps ppx_expect))) @@ -88,10 +76,6 @@ unix ;; This is because of the (implicit_transitive_deps false) ;; in dune-project - ppx_expect.config - ppx_expect.config_types - ppx_expect.common - base - ppx_inline_test.config) + ppx_expect.common) (preprocess (pps ppx_expect))) diff --git a/test/expect-tests/dune_rpc_impl/dune b/test/expect-tests/dune_rpc_impl/dune index e6c9bc91c36a..eaaec404ae53 100644 --- a/test/expect-tests/dune_rpc_impl/dune +++ b/test/expect-tests/dune_rpc_impl/dune @@ -13,10 +13,6 @@ stdune ;; This is because of the (implicit_transitive_deps false) ;; in dune-project - ppx_expect.config - ppx_expect.config_types - ppx_expect.common - base - ppx_inline_test.config) + ppx_expect.common) (preprocess (pps ppx_expect))) diff --git a/test/expect-tests/dune_sexp/dune b/test/expect-tests/dune_sexp/dune index 06e3a34d0ffe..e4e968eaac87 100644 --- a/test/expect-tests/dune_sexp/dune +++ b/test/expect-tests/dune_sexp/dune @@ -7,10 +7,6 @@ dune_sexp ;; This is because of the (implicit_transitive_deps false) ;; in dune-project - ppx_expect.config - ppx_expect.config_types - ppx_expect.common - base - ppx_inline_test.config) + ppx_expect.common) (preprocess (pps ppx_expect))) diff --git a/test/expect-tests/dune_stats/dune b/test/expect-tests/dune_stats/dune index 562aa4a69c40..5ad4db442275 100644 --- a/test/expect-tests/dune_stats/dune +++ b/test/expect-tests/dune_stats/dune @@ -9,10 +9,6 @@ unix ;; This is because of the (implicit_transitive_deps false) ;; in dune-project - ppx_expect.config - ppx_expect.config_types - ppx_expect.common - base - ppx_inline_test.config) + ppx_expect.common) (preprocess (pps ppx_expect))) diff --git a/test/expect-tests/dune_util/dune b/test/expect-tests/dune_util/dune index 2a30b8bf1b5d..e49b207a554f 100644 --- a/test/expect-tests/dune_util/dune +++ b/test/expect-tests/dune_util/dune @@ -11,10 +11,6 @@ stdune ;; This is because of the (implicit_transitive_deps false) ;; in dune-project - ppx_expect.config - ppx_expect.config_types - ppx_expect.common - base - ppx_inline_test.config) + ppx_expect.common) (preprocess (pps ppx_expect))) diff --git a/test/expect-tests/fiber_event_bus/dune b/test/expect-tests/fiber_event_bus/dune index 70f542cf9a41..063f7f6ee466 100644 --- a/test/expect-tests/fiber_event_bus/dune +++ b/test/expect-tests/fiber_event_bus/dune @@ -10,10 +10,6 @@ dune_tests_common ;; This is because of the (implicit_transitive_deps false) ;; in dune-project - ppx_expect.config - ppx_expect.config_types - ppx_expect.common - base - ppx_inline_test.config) + ppx_expect.common) (preprocess (pps ppx_expect))) diff --git a/test/expect-tests/fsevents/dune b/test/expect-tests/fsevents/dune index 0d79b74fa8fe..d4548d92e868 100644 --- a/test/expect-tests/fsevents/dune +++ b/test/expect-tests/fsevents/dune @@ -11,12 +11,9 @@ fsevents stdune threads.posix + unix ;; This is because of the (implicit_transitive_deps false) ;; in dune-project - ppx_expect.config - ppx_expect.config_types - ppx_expect.common - base - ppx_inline_test.config) + ppx_expect.common) (preprocess (pps ppx_expect))) diff --git a/test/expect-tests/memo/dune b/test/expect-tests/memo/dune index c3662b85d84d..c6de31aa4631 100644 --- a/test/expect-tests/memo/dune +++ b/test/expect-tests/memo/dune @@ -10,10 +10,6 @@ test_scheduler ;; This is because of the (implicit_transitive_deps false) ;; in dune-project - ppx_expect.config - ppx_expect.config_types - ppx_expect.common - base - ppx_inline_test.config) + ppx_expect.common) (preprocess (pps ppx_expect))) diff --git a/test/expect-tests/memo/graph_dump/dune b/test/expect-tests/memo/graph_dump/dune index 18534e3288b3..f28b56d0bfd7 100644 --- a/test/expect-tests/memo/graph_dump/dune +++ b/test/expect-tests/memo/graph_dump/dune @@ -8,9 +8,6 @@ test_scheduler ;; This is because of the (implicit_transitive_deps false) ;; in dune-project - ppx_expect.config_types - ppx_expect.common - base - ppx_inline_test.config) + ppx_expect.common) (preprocess (pps ppx_expect))) diff --git a/test/expect-tests/scheme/dune b/test/expect-tests/scheme/dune index 8f2012536be2..6ef6b3266ce9 100644 --- a/test/expect-tests/scheme/dune +++ b/test/expect-tests/scheme/dune @@ -8,11 +8,7 @@ memo ;; This is because of the (implicit_transitive_deps false) ;; in dune-project - ppx_expect.config - ppx_expect.config_types - ppx_expect.common - base - ppx_inline_test.config) + ppx_expect.common) (inline_tests) (preprocess (pps ppx_expect))) diff --git a/test/expect-tests/vcs/dune b/test/expect-tests/vcs/dune index 452fce384ba7..5ba68682b655 100644 --- a/test/expect-tests/vcs/dune +++ b/test/expect-tests/vcs/dune @@ -17,10 +17,6 @@ memo ;; This is because of the (implicit_transitive_deps false) ;; in dune-project - ppx_expect.config - ppx_expect.config_types - ppx_expect.common - base - ppx_inline_test.config) + ppx_expect.common) (preprocess (pps ppx_expect))) diff --git a/vendor/fiber/test/dune b/vendor/fiber/test/dune index 91a294599831..04af78203570 100644 --- a/vendor/fiber/test/dune +++ b/vendor/fiber/test/dune @@ -9,10 +9,6 @@ test_scheduler ;; This is because of the (implicit_transitive_deps false) ;; in dune-project - ppx_expect.config - ppx_expect.config_types - ppx_expect.common - base - ppx_inline_test.config) + ppx_expect.common) (preprocess (pps ppx_expect))) diff --git a/vendor/lwd/nottui/dune b/vendor/lwd/nottui/dune index e8e4162fa5a3..dec75aba80ca 100644 --- a/vendor/lwd/nottui/dune +++ b/vendor/lwd/nottui/dune @@ -1,4 +1,4 @@ (library (name dune_nottui) (wrapped false) - (libraries dune_lwd dune_notty dune_notty_unix)) + (libraries unix dune_lwd dune_notty dune_notty_unix)) diff --git a/vendor/opam-0install/lib/dune b/vendor/opam-0install/lib/dune index 03d02dbdab43..34f276608e98 100644 --- a/vendor/opam-0install/lib/dune +++ b/vendor/opam-0install/lib/dune @@ -1,3 +1,3 @@ (library (name opam_0install) - (libraries opam_state opam_format zeroinstall_solver fmt)) + (libraries unix opam_state opam_format zeroinstall_solver fmt)) diff --git a/vendor/opam/src/format/dune b/vendor/opam/src/format/dune index 8749dbf47691..adae0fca1d44 100644 --- a/vendor/opam/src/format/dune +++ b/vendor/opam/src/format/dune @@ -2,7 +2,7 @@ (name opam_format) (synopsis "OCaml Package Manager file format handling library") ; TODO: Remove (re_export ...) when CI uses the OCaml version that includes https://github.com/ocaml/ocaml/pull/11989 - (libraries (re_export opam_core) (re_export opam_file_format) dune_re) + (libraries unix (re_export opam_core) (re_export opam_file_format) dune_re) (modules_without_implementation OpamTypes) (wrapped false)) diff --git a/vendor/opam/src/repository/dune b/vendor/opam/src/repository/dune index 38800db0fc8b..9b9f1af92b0f 100644 --- a/vendor/opam/src/repository/dune +++ b/vendor/opam/src/repository/dune @@ -1,5 +1,5 @@ (library (name opam_repository) ; TODO: Remove (re_export ...) when CI uses the OCaml version that includes https://github.com/ocaml/ocaml/pull/11989 - (libraries (re_export opam_format)) + (libraries unix (re_export opam_format)) (wrapped false)) diff --git a/vendor/opam/src/state/dune b/vendor/opam/src/state/dune index d1ffd0b789fa..cce0fcc49719 100644 --- a/vendor/opam/src/state/dune +++ b/vendor/opam/src/state/dune @@ -1,5 +1,5 @@ (library (name opam_state) - (libraries opam_repository dune_re) + (libraries unix opam_repository dune_re) (modules_without_implementation OpamStateTypes OpamScript) (wrapped false))