From aea0131b112c8c9e880024dcc2a9991e04f47902 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Sat, 24 Mar 2018 00:34:13 +0800 Subject: [PATCH 1/4] Don't pass library include flags to odoc We should pass directories where we store .odoc files instead --- src/odoc.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/odoc.ml b/src/odoc.ml index 9878b3b9..13c06088 100644 --- a/src/odoc.ml +++ b/src/odoc.ml @@ -203,7 +203,7 @@ module Gen (S : sig val sctx : SC.t end) = struct Build.memoize "includes" (requires >>> Dep.deps - >>^ Lib.L.include_flags ~stdlib_dir:context.stdlib_dir) + >>^ odoc_include_flags) in let modules_and_odoc_files = List.map (Module.Name.Map.values modules) ~f:( From 8fd04e5a9f231fe79f2099082e4f2119341f7297 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Sat, 24 Mar 2018 00:54:33 +0800 Subject: [PATCH 2/4] Use doc_dir rather than dir dir is the source directory which is useless to us --- src/gen_rules.ml | 2 +- src/odoc.boot.ml | 2 +- src/odoc.ml | 8 ++++---- src/odoc.mli | 1 - 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/gen_rules.ml b/src/gen_rules.ml index 201c684e..d17da280 100644 --- a/src/gen_rules.ml +++ b/src/gen_rules.ml @@ -763,7 +763,7 @@ module Gen(P : Install_rules.Params) = struct SC.add_rule sctx build ); - Odoc.setup_library_odoc_rules lib ~dir ~requires ~modules ~dep_graphs ~scope + Odoc.setup_library_odoc_rules lib ~requires ~modules ~dep_graphs ~scope ; let flags = diff --git a/src/odoc.boot.ml b/src/odoc.boot.ml index fe731c5b..89cb7696 100644 --- a/src/odoc.boot.ml +++ b/src/odoc.boot.ml @@ -1,7 +1,7 @@ module Gen (S : sig val sctx : Super_context.t end) = struct - let setup_library_odoc_rules _ ~dir:_ ~scope:_ ~modules:_ ~requires:_ + let setup_library_odoc_rules _ ~scope:_ ~modules:_ ~requires:_ ~dep_graphs:_ = () let init ~modules_by_lib:_ ~mlds_of_dir:_ = () diff --git a/src/odoc.ml b/src/odoc.ml index 13c06088..9ad33ca7 100644 --- a/src/odoc.ml +++ b/src/odoc.ml @@ -107,7 +107,7 @@ module Gen (S : sig val sctx : SC.t end) = struct Ocamldep.Dep_graph.deps_of dep_graphs.impl m) >>^ List.map ~f:(Module.odoc_file ~doc_dir)) - let compile_module (m : Module.t) ~dir ~obj_dir ~includes ~dep_graphs + let compile_module (m : Module.t) ~obj_dir ~includes ~dep_graphs ~doc_dir ~pkg_or_lnu = let odoc_file = Module.odoc_file m ~doc_dir in SC.add_rule sctx @@ -117,7 +117,7 @@ module Gen (S : sig val sctx : SC.t end) = struct >>> Build.run ~context ~dir:doc_dir odoc [ A "compile" - ; A "-I"; Path dir + ; A "-I"; Path doc_dir ; Dyn (fun x -> x) ; As ["--pkg"; pkg_or_lnu] ; A "-o"; Target odoc_file @@ -189,7 +189,7 @@ module Gen (S : sig val sctx : SC.t end) = struct let toplevel_index = Paths.html_root ++ "index.html" - let setup_library_odoc_rules (library : Library.t) ~dir ~scope ~modules + let setup_library_odoc_rules (library : Library.t) ~scope ~modules ~requires ~(dep_graphs:Ocamldep.Dep_graph.t Ml_kind.Dict.t) = let lib = Option.value_exn (Lib.DB.find_even_when_hidden (Scope.libs scope) @@ -207,7 +207,7 @@ module Gen (S : sig val sctx : SC.t end) = struct in let modules_and_odoc_files = List.map (Module.Name.Map.values modules) ~f:( - compile_module ~dir ~obj_dir ~includes ~dep_graphs + compile_module ~obj_dir ~includes ~dep_graphs ~doc_dir ~pkg_or_lnu) in Dep.setup_deps (Lib lib) (List.map modules_and_odoc_files ~f:snd diff --git a/src/odoc.mli b/src/odoc.mli index b8e78192..cd77e1fb 100644 --- a/src/odoc.mli +++ b/src/odoc.mli @@ -6,7 +6,6 @@ module Gen (S : sig val sctx : Super_context.t end) : sig val setup_library_odoc_rules : Library.t - -> dir:Path.t -> scope:Scope.t -> modules:Module.t Module.Name.Map.t -> requires:(unit, Lib.t list) Build.t From 3b694b0abe7b837a01f3a1d37c630dbff99a4da5 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Sat, 24 Mar 2018 01:00:57 +0800 Subject: [PATCH 3/4] Update CHANGELOG for odoc include dir fix --- CHANGES.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 00ec60d0..7378f565 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -28,6 +28,10 @@ next - Use the host's PATH variable when running actions during cross compilation (#649, fixes #625 @rgrinberg) +- Fix incorrect include (`-I`) flags being passed to odoc. These flags should be + directories that include .odoc files, rather than the include flags of the + libraries. (#652 fixes #651 @rgrinberg) + 1.0+beta19.1 (21/03/2018) ------------------------- From 1c4efab0600c177f4526b7dae4cb7e85ee52182e Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Sat, 24 Mar 2018 01:01:08 +0800 Subject: [PATCH 4/4] Update changelog for rc1 --- CHANGES.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 7378f565..b2cd6efd 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,5 @@ -next ----- +1.0+beta20-rc1 (24/03/2018) +--------------------------- - Add a `documentation` stanza. This stanza allows one to attach .mld files to opam packages. (#570 @rgrinberg)