From 2c424063abd89dffeb13f7f6ee5fa64258baa1f1 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Thu, 7 Jun 2018 11:52:14 +0700 Subject: [PATCH 01/13] Remove polymorphic variant that is of questionable use Signed-off-by: Rudi Grinberg --- src/odoc.ml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/odoc.ml b/src/odoc.ml index d4e7bfc6..9b8bbae8 100644 --- a/src/odoc.ml +++ b/src/odoc.ml @@ -138,12 +138,14 @@ module Gen (S : sig val sctx : SC.t end) = struct ]); odoc_file + type typ = Module | Mld + type odoc = { odoc_input: Path.t ; html_dir: Path.t ; html_file: Path.t ; html_alias: Build_system.Alias.t - ; typ: [`Module | `Mld] + ; typ: typ } let odoc_include_flags requires = @@ -162,8 +164,8 @@ module Gen (S : sig val sctx : SC.t end) = struct let to_html (odoc_file : odoc) ~deps ~requires = let to_remove, jbuilder_keep = match odoc_file.typ with - | `Mld -> odoc_file.html_file, [] - | `Module -> + | Mld -> odoc_file.html_file, [] + | Module -> let jbuilder_keep = Build.create_file (odoc_file.html_dir ++ Config.jbuilder_keep_fname) in odoc_file.html_dir, [jbuilder_keep] @@ -291,7 +293,7 @@ module Gen (S : sig val sctx : SC.t end) = struct { odoc_input ; html_dir ; html_file = html_dir ++ "index.html" - ; typ = `Module + ; typ = Module ; html_alias } | Pkg _ -> @@ -303,7 +305,7 @@ module Gen (S : sig val sctx : SC.t end) = struct |> String.drop_prefix ~prefix:"page-" |> Option.value_exn ) - ; typ = `Mld + ; typ = Mld ; html_alias } From a70ccb6d8b3c0aa7308abb8d2ad21eb009c52de3 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Thu, 7 Jun 2018 11:53:20 +0700 Subject: [PATCH 02/13] Move types outside of gen functor Signed-off-by: Rudi Grinberg --- src/odoc.ml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/odoc.ml b/src/odoc.ml index 9b8bbae8..b7ccdddc 100644 --- a/src/odoc.ml +++ b/src/odoc.ml @@ -22,6 +22,16 @@ type target = | Lib of Lib.t | Pkg of Package.Name.t +type typ = Module | Mld + +type odoc = + { odoc_input: Path.t + ; html_dir: Path.t + ; html_file: Path.t + ; html_alias: Build_system.Alias.t + ; typ: typ + } + module Gen (S : sig val sctx : SC.t end) = struct open S @@ -138,16 +148,6 @@ module Gen (S : sig val sctx : SC.t end) = struct ]); odoc_file - type typ = Module | Mld - - type odoc = - { odoc_input: Path.t - ; html_dir: Path.t - ; html_file: Path.t - ; html_alias: Build_system.Alias.t - ; typ: typ - } - let odoc_include_flags requires = Arg_spec.of_result_map requires ~f:(fun libs -> let paths = From acac3e29b306a95ed622cffa037fb091c0e1316e Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Thu, 7 Jun 2018 12:20:48 +0700 Subject: [PATCH 03/13] Do not silently ignore closure errors cc @diml Signed-off-by: Rudi Grinberg --- src/odoc.ml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/odoc.ml b/src/odoc.ml index b7ccdddc..89c9b236 100644 --- a/src/odoc.ml +++ b/src/odoc.ml @@ -327,17 +327,9 @@ module Gen (S : sig val sctx : SC.t end) = struct :: (List.map libs ~f:(fun lib -> odocs (Lib lib))) ) in let html_files = - let closure = - match Lib.closure libs with - | Ok closure -> closure - | Error _ -> - (* CR diml for rgrinberg: this branch needs a comment, I - don't understand why we fallback to not taking the - transitive closure in case of error. *) - libs - in - let deps = Dep.deps (Ok closure) in - List.map odocs ~f:(to_html ~deps ~requires:(Ok closure)) in + let closure = Lib.closure libs in + let deps = Dep.deps closure in + List.map odocs ~f:(to_html ~deps ~requires:closure) in List.iter ( Dep.html_alias (Pkg pkg) :: List.map ~f:(fun lib -> Dep.html_alias (Lib lib)) libs From 8740554ebf988f0dcdf440d2bbe6089810a9eabf Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Thu, 7 Jun 2018 12:47:50 +0700 Subject: [PATCH 04/13] Rename to_html to setup_html Signed-off-by: Rudi Grinberg --- src/odoc.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/odoc.ml b/src/odoc.ml index 89c9b236..1702f3bc 100644 --- a/src/odoc.ml +++ b/src/odoc.ml @@ -161,7 +161,7 @@ module Gen (S : sig val sctx : SC.t end) = struct Arg_spec.S (List.concat_map (Path.Set.to_list paths) ~f:(fun dir -> [Arg_spec.A "-I"; Path dir]))) - let to_html (odoc_file : odoc) ~deps ~requires = + let setup_html (odoc_file : odoc) ~deps ~requires = let to_remove, jbuilder_keep = match odoc_file.typ with | Mld -> odoc_file.html_file, [] @@ -329,7 +329,7 @@ module Gen (S : sig val sctx : SC.t end) = struct let html_files = let closure = Lib.closure libs in let deps = Dep.deps closure in - List.map odocs ~f:(to_html ~deps ~requires:closure) in + List.map odocs ~f:(setup_html ~deps ~requires:closure) in List.iter ( Dep.html_alias (Pkg pkg) :: List.map ~f:(fun lib -> Dep.html_alias (Lib lib)) libs From c28bc3d75a7bc6b841dbb102ab0a89ea5817b0ed Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Thu, 7 Jun 2018 13:42:14 +0700 Subject: [PATCH 05/13] Simplify odoc generation Separate package from html docs Signed-off-by: Rudi Grinberg --- src/odoc.ml | 74 ++++++++++++++++++++++++++--------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/src/odoc.ml b/src/odoc.ml index 1702f3bc..a8fb3631 100644 --- a/src/odoc.ml +++ b/src/odoc.ml @@ -161,7 +161,8 @@ module Gen (S : sig val sctx : SC.t end) = struct Arg_spec.S (List.concat_map (Path.Set.to_list paths) ~f:(fun dir -> [Arg_spec.A "-I"; Path dir]))) - let setup_html (odoc_file : odoc) ~deps ~requires = + let setup_html (odoc_file : odoc) ~requires = + let deps = Dep.deps requires in let to_remove, jbuilder_keep = match odoc_file.typ with | Mld -> odoc_file.html_file, [] @@ -184,10 +185,7 @@ module Gen (S : sig val sctx : SC.t end) = struct ; Dep odoc_file.odoc_input ; Hidden_targets [odoc_file.html_file] ] - :: jbuilder_keep - ) - ); - odoc_file.html_file + :: jbuilder_keep)) let css_file = Paths.html_root ++ "odoc.css" @@ -261,12 +259,6 @@ module Gen (S : sig val sctx : SC.t end) = struct in SC.add_rule sctx @@ Build.write_file toplevel_index html - - let html_alias pkg = - Build_system.Alias.doc ~dir:( - Path.append context.build_dir pkg.Package.path - ) - let libs_of_pkg ~pkg = match Package.Name.Map.find (SC.libs_by_package sctx) pkg with | None -> Lib.Set.empty @@ -309,40 +301,45 @@ module Gen (S : sig val sctx : SC.t end) = struct ; html_alias } - let setup_pkg_html_rules = - let loaded = Package.Name.Table.create ~default_value:false in + let static_html = [ css_file; toplevel_index ] + + let odocs = let odoc_glob = Re.compile (Re.seq [Re.(rep1 any) ; Re.str ".odoc" ; Re.eos]) in + fun target -> + let dir = Paths.odocs target in + SC.eval_glob sctx ~dir odoc_glob + |> List.map ~f:(fun d -> create_odoc (Path.relative dir d) ~target) + + let setup_lib_html_rules = + let loaded = ref Lib.Set.empty in + fun lib ~requires -> + if not (Lib.Set.mem !loaded lib) then begin + loaded := Lib.Set.add !loaded lib; + let odocs = odocs (Lib lib) in + List.iter odocs ~f:(setup_html ~requires); + let html_files = List.map ~f:(fun o -> o.html_file) odocs in + SC.add_alias_deps sctx (Dep.html_alias (Lib lib)) + (Path.Set.of_list (List.rev_append static_html html_files)); + end + + let setup_pkg_html_rules = + let loaded = Package.Name.Table.create ~default_value:false in fun ~pkg ~libs -> if not (Package.Name.Table.get loaded pkg) then begin Package.Name.Table.set loaded ~key:pkg ~data:true; + let requires = Lib.closure libs in + List.iter libs ~f:(setup_lib_html_rules ~requires); + let pkg_odocs = odocs (Pkg pkg) in + List.iter pkg_odocs ~f:(setup_html ~requires); let odocs = - let odocs target = - let dir = Paths.odocs target in - SC.eval_glob sctx ~dir odoc_glob - |> List.map ~f:(fun d -> create_odoc (Path.relative dir d) ~target) - in List.concat ( - odocs (Pkg pkg) + pkg_odocs :: (List.map libs ~f:(fun lib -> odocs (Lib lib))) ) in - let html_files = - let closure = Lib.closure libs in - let deps = Dep.deps closure in - List.map odocs ~f:(setup_html ~deps ~requires:closure) in - List.iter ( - Dep.html_alias (Pkg pkg) - :: List.map ~f:(fun lib -> Dep.html_alias (Lib lib)) libs - ) ~f:(fun alias -> - SC.add_alias_deps sctx alias - (Path.Set.of_list [ css_file - ; toplevel_index - ]) - ); - List.combine odocs html_files - |> List.iter ~f:(fun (odoc, html) -> - SC.add_alias_deps sctx odoc.html_alias (Path.Set.singleton html) - ); + let html_files = List.map ~f:(fun o -> o.html_file) odocs in + SC.add_alias_deps sctx (Dep.html_alias (Pkg pkg)) + (Path.Set.of_list (List.rev_append static_html html_files)) end let gen_rules ~dir:_ rest = @@ -378,7 +375,10 @@ module Gen (S : sig val sctx : SC.t end) = struct | _ -> () let setup_package_aliases (pkg : Package.t) = - let alias = html_alias pkg in + let alias = + Build_system.Alias.doc ~dir:( + Path.append context.build_dir pkg.Package.path + ) in SC.add_alias_deps sctx alias ( Dep.html_alias (Pkg pkg.name) :: (libs_of_pkg ~pkg:pkg.name From 20d9b509a1f65eab979be5488078902a8bf58ab5 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Thu, 7 Jun 2018 13:45:55 +0700 Subject: [PATCH 06/13] Setup html rules for libraries and not just their parent pacakge Signed-off-by: Rudi Grinberg --- src/odoc.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/odoc.ml b/src/odoc.ml index a8fb3631..ee218b60 100644 --- a/src/odoc.ml +++ b/src/odoc.ml @@ -366,7 +366,7 @@ module Gen (S : sig val sctx : SC.t end) = struct let lib, lib_db = SC.Scope_key.of_string sctx lib_unique_name_or_pkg in begin match Lib.DB.find lib_db lib with | Error _ -> () - | Ok lib -> Option.iter (Lib.package lib) ~f:setup_html_rules + | Ok lib -> setup_lib_html_rules lib ~requires:(Lib.closure [lib]) end; Option.iter (Package.Name.Map.find (SC.packages sctx) From 794b2c696b7116c1f352f000b33e0fbe6acf77f4 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Thu, 7 Jun 2018 13:46:50 +0700 Subject: [PATCH 07/13] Remove unused html_alias field Signed-off-by: Rudi Grinberg --- src/odoc.ml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/odoc.ml b/src/odoc.ml index ee218b60..20065b37 100644 --- a/src/odoc.ml +++ b/src/odoc.ml @@ -28,7 +28,6 @@ type odoc = { odoc_input: Path.t ; html_dir: Path.t ; html_file: Path.t - ; html_alias: Build_system.Alias.t ; typ: typ } @@ -272,7 +271,6 @@ module Gen (S : sig val sctx : SC.t end) = struct pkg_libs let create_odoc ~target odoc_input = - let html_alias = Dep.html_alias target in let html_base = Paths.html target in match target with | Lib _ -> @@ -286,7 +284,6 @@ module Gen (S : sig val sctx : SC.t end) = struct ; html_dir ; html_file = html_dir ++ "index.html" ; typ = Module - ; html_alias } | Pkg _ -> { odoc_input @@ -298,7 +295,6 @@ module Gen (S : sig val sctx : SC.t end) = struct |> Option.value_exn ) ; typ = Mld - ; html_alias } let static_html = [ css_file; toplevel_index ] From da43480dfcc70741055ed72107e452538e612524 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Thu, 7 Jun 2018 14:24:01 +0700 Subject: [PATCH 08/13] Fix html generation for private libs private-doc should collect html rather than odoc aliases Signed-off-by: Rudi Grinberg --- src/odoc.ml | 2 +- test/blackbox-tests/test-cases/multiple-private-libs/run.t | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/odoc.ml b/src/odoc.ml index 20065b37..a7737cc7 100644 --- a/src/odoc.ml +++ b/src/odoc.ml @@ -534,7 +534,7 @@ module Gen (S : sig val sctx : SC.t end) = struct | _ -> None )) |> List.map ~f:(fun (lib : Lib.t) -> - Build_system.Alias.stamp_file (Dep.alias (Lib lib))) + Build_system.Alias.stamp_file (Dep.html_alias (Lib lib))) |> Path.Set.of_list ) diff --git a/test/blackbox-tests/test-cases/multiple-private-libs/run.t b/test/blackbox-tests/test-cases/multiple-private-libs/run.t index d4ca8166..95d7a978 100644 --- a/test/blackbox-tests/test-cases/multiple-private-libs/run.t +++ b/test/blackbox-tests/test-cases/multiple-private-libs/run.t @@ -1,9 +1,12 @@ This test checks that there is no clash when two private libraries have the same name $ dune build --display short @doc-private + odoc _doc/_html/odoc.css ocamldep a/test.ml.d ocamlc a/.test.objs/test.{cmi,cmo,cmt} odoc _doc/_odoc/lib/test@a/test.odoc + odoc _doc/_html/test@a/Test/.jbuilder-keep,_doc/_html/test@a/Test/index.html ocamldep b/test.ml.d ocamlc b/.test.objs/test.{cmi,cmo,cmt} odoc _doc/_odoc/lib/test@b/test.odoc + odoc _doc/_html/test@b/Test/.jbuilder-keep,_doc/_html/test@b/Test/index.html From 51ec4a0dc6aed0a0453bba8c57787e183bd72e2f Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Thu, 7 Jun 2018 14:26:00 +0700 Subject: [PATCH 09/13] Update tests Signed-off-by: Rudi Grinberg --- test/blackbox-tests/test-cases/odoc/run.t | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/blackbox-tests/test-cases/odoc/run.t b/test/blackbox-tests/test-cases/odoc/run.t index bd9eb6be..203240d0 100644 --- a/test/blackbox-tests/test-cases/odoc/run.t +++ b/test/blackbox-tests/test-cases/odoc/run.t @@ -6,9 +6,6 @@ odoc _doc/_odoc/pkg/bar/page-index.odoc odoc _doc/_html/bar/index.html odoc _doc/_html/odoc.css - ocamldep foo_byte.ml.d - ocamlc .foo_byte.objs/foo_byte.{cmi,cmo,cmt} - odoc _doc/_odoc/lib/foo.byte/foo_byte.odoc ocamldep foo.ml.d ocamlc .foo.objs/foo.{cmi,cmo,cmt} odoc _doc/_odoc/lib/foo/foo.odoc @@ -16,9 +13,12 @@ ocamlc .foo.objs/foo2.{cmi,cmo,cmt} odoc _doc/_odoc/lib/foo/foo2.odoc odoc _doc/_html/foo/Foo/.jbuilder-keep,_doc/_html/foo/Foo/index.html + ocamldep foo_byte.ml.d + ocamlc .foo_byte.objs/foo_byte.{cmi,cmo,cmt} + odoc _doc/_odoc/lib/foo.byte/foo_byte.odoc + odoc _doc/_html/foo/Foo_byte/.jbuilder-keep,_doc/_html/foo/Foo_byte/index.html odoc _doc/_odoc/pkg/foo/page-index.odoc odoc _doc/_html/foo/index.html - odoc _doc/_html/foo/Foo_byte/.jbuilder-keep,_doc/_html/foo/Foo_byte/index.html odoc _doc/_html/foo/Foo2/.jbuilder-keep,_doc/_html/foo/Foo2/index.html $ dune runtest --display short From c842c76036577ec32d9824fada1ecda1db53664f Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Thu, 7 Jun 2018 14:28:25 +0700 Subject: [PATCH 10/13] Rename typ to source Signed-off-by: Rudi Grinberg --- src/odoc.ml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/odoc.ml b/src/odoc.ml index a7737cc7..e4990dd5 100644 --- a/src/odoc.ml +++ b/src/odoc.ml @@ -22,13 +22,13 @@ type target = | Lib of Lib.t | Pkg of Package.Name.t -type typ = Module | Mld +type source = Module | Mld type odoc = { odoc_input: Path.t ; html_dir: Path.t ; html_file: Path.t - ; typ: typ + ; source: source } module Gen (S : sig val sctx : SC.t end) = struct @@ -163,7 +163,7 @@ module Gen (S : sig val sctx : SC.t end) = struct let setup_html (odoc_file : odoc) ~requires = let deps = Dep.deps requires in let to_remove, jbuilder_keep = - match odoc_file.typ with + match odoc_file.source with | Mld -> odoc_file.html_file, [] | Module -> let jbuilder_keep = @@ -283,7 +283,7 @@ module Gen (S : sig val sctx : SC.t end) = struct { odoc_input ; html_dir ; html_file = html_dir ++ "index.html" - ; typ = Module + ; source = Module } | Pkg _ -> { odoc_input @@ -294,7 +294,7 @@ module Gen (S : sig val sctx : SC.t end) = struct |> String.drop_prefix ~prefix:"page-" |> Option.value_exn ) - ; typ = Mld + ; source = Mld } let static_html = [ css_file; toplevel_index ] From 724acc8c7c4c789d9bdcc283c7847957536bc2fb Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Thu, 7 Jun 2018 14:35:53 +0700 Subject: [PATCH 11/13] Allow libraries in a package to reference each other in odocs This allows for circular dependencies for libraries in the same package Signed-off-by: Rudi Grinberg --- src/odoc.ml | 15 +++++++++------ test/blackbox-tests/test-cases/odoc/run.t | 8 ++++---- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/odoc.ml b/src/odoc.ml index e4990dd5..a79c0bf1 100644 --- a/src/odoc.ml +++ b/src/odoc.ml @@ -353,21 +353,24 @@ module Gen (S : sig val sctx : SC.t end) = struct | Ok lib -> SC.load_dir sctx ~dir:(Lib.src_dir lib) end | "_html" :: lib_unique_name_or_pkg :: _ -> - let setup_html_rules pkg = - setup_pkg_html_rules ~pkg ~libs:( - Lib.Set.to_list (load_all_odoc_rules_pkg ~pkg) - ) in (* TODO we can be a better with the error handling in the case where lib_unique_name_or_pkg is neither a valid pkg or lnu *) let lib, lib_db = SC.Scope_key.of_string sctx lib_unique_name_or_pkg in + let setup_pkg_html_rules pkg = + setup_pkg_html_rules ~pkg ~libs:( + Lib.Set.to_list (load_all_odoc_rules_pkg ~pkg)) in begin match Lib.DB.find lib_db lib with | Error _ -> () - | Ok lib -> setup_lib_html_rules lib ~requires:(Lib.closure [lib]) + | Ok lib -> + begin match Lib.package lib with + | None -> setup_lib_html_rules lib ~requires:(Lib.closure [lib]) + | Some pkg -> setup_pkg_html_rules pkg + end end; Option.iter (Package.Name.Map.find (SC.packages sctx) (Package.Name.of_string lib_unique_name_or_pkg)) - ~f:(fun pkg -> setup_html_rules pkg.name) + ~f:(fun pkg -> setup_pkg_html_rules pkg.name) | _ -> () let setup_package_aliases (pkg : Package.t) = diff --git a/test/blackbox-tests/test-cases/odoc/run.t b/test/blackbox-tests/test-cases/odoc/run.t index 203240d0..bd9eb6be 100644 --- a/test/blackbox-tests/test-cases/odoc/run.t +++ b/test/blackbox-tests/test-cases/odoc/run.t @@ -6,6 +6,9 @@ odoc _doc/_odoc/pkg/bar/page-index.odoc odoc _doc/_html/bar/index.html odoc _doc/_html/odoc.css + ocamldep foo_byte.ml.d + ocamlc .foo_byte.objs/foo_byte.{cmi,cmo,cmt} + odoc _doc/_odoc/lib/foo.byte/foo_byte.odoc ocamldep foo.ml.d ocamlc .foo.objs/foo.{cmi,cmo,cmt} odoc _doc/_odoc/lib/foo/foo.odoc @@ -13,12 +16,9 @@ ocamlc .foo.objs/foo2.{cmi,cmo,cmt} odoc _doc/_odoc/lib/foo/foo2.odoc odoc _doc/_html/foo/Foo/.jbuilder-keep,_doc/_html/foo/Foo/index.html - ocamldep foo_byte.ml.d - ocamlc .foo_byte.objs/foo_byte.{cmi,cmo,cmt} - odoc _doc/_odoc/lib/foo.byte/foo_byte.odoc - odoc _doc/_html/foo/Foo_byte/.jbuilder-keep,_doc/_html/foo/Foo_byte/index.html odoc _doc/_odoc/pkg/foo/page-index.odoc odoc _doc/_html/foo/index.html + odoc _doc/_html/foo/Foo_byte/.jbuilder-keep,_doc/_html/foo/Foo_byte/index.html odoc _doc/_html/foo/Foo2/.jbuilder-keep,_doc/_html/foo/Foo2/index.html $ dune runtest --display short From eda3088a49b3ec104e991b64c9ca76b024ca25a7 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Thu, 7 Jun 2018 17:47:18 +0700 Subject: [PATCH 12/13] Move stanzas to toplevel value Signed-off-by: Rudi Grinberg --- src/odoc.ml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/odoc.ml b/src/odoc.ml index a79c0bf1..58a32a19 100644 --- a/src/odoc.ml +++ b/src/odoc.ml @@ -35,6 +35,7 @@ module Gen (S : sig val sctx : SC.t end) = struct open S let context = SC.context sctx + let stanzas = SC.stanzas sctx module Paths = struct let root = context.Context.build_dir ++ "_doc" @@ -461,7 +462,7 @@ module Gen (S : sig val sctx : SC.t end) = struct let init ~modules_by_lib ~mlds_of_dir = let docs_by_package = let map = lazy ( - SC.stanzas sctx + stanzas |> List.concat_map ~f:(fun (w : SC.Dir_with_jbuild.t) -> List.filter_map w.stanzas ~f:(function | Documentation (d : Jbuild.Documentation.t) -> @@ -484,7 +485,7 @@ module Gen (S : sig val sctx : SC.t end) = struct | o -> o end) in let lib_to_library = lazy ( - SC.stanzas sctx + stanzas |> List.concat_map ~f:(fun (w : SC.Dir_with_jbuild.t) -> List.filter_map w.stanzas ~f:(function | Jbuild.Library (l : Library.t) -> @@ -522,7 +523,7 @@ module Gen (S : sig val sctx : SC.t end) = struct Super_context.add_alias_deps sctx (Build_system.Alias.private_doc ~dir:context.build_dir) - (SC.stanzas sctx + (stanzas |> List.concat_map ~f:(fun (w : SC.Dir_with_jbuild.t) -> List.filter_map w.stanzas ~f:(function | Jbuild.Library (l : Jbuild.Library.t) -> From 4b0559a9266737507d12f69a52b5f5f172419b13 Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Thu, 7 Jun 2018 17:49:51 +0700 Subject: [PATCH 13/13] Update CHANGES Signed-off-by: Rudi Grinberg --- CHANGES.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 7d9f0d96..891d0ae5 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -66,6 +66,9 @@ next whether a multi valued variable is allowed is determined by the quoting and substitution context it appears in. (#849, fix #701, @rgrinberg) +- Fix documentation generation for private libraries. (#864, fix #856, + @rgrinberg) + 1.0+beta20 (10/04/2018) -----------------------