Skip to content

Commit e0c008d

Browse files
committed
Fix #4799
Private libraries should be excluded from the package index Signed-off-by: Rudi Grinberg <[email protected]>
1 parent 445d135 commit e0c008d

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

CHANGES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
Unreleased
22
----------
33

4+
- Do not list private libraries in package listings (#4945, fixes #4799,
5+
@rgrinberg)
6+
47
- Allow spaces in the directory argument of the `subdir` stanza (#4943, fixes
58
#4907, @rgrinberg)
69

src/dune_rules/odoc.ml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,12 @@ let entry_modules_by_lib sctx lib =
603603
>>| Modules.entry_modules
604604

605605
let entry_modules sctx ~pkg =
606-
let l = libs_of_pkg sctx ~pkg in
606+
let l =
607+
libs_of_pkg sctx ~pkg
608+
|> List.filter ~f:(fun lib ->
609+
Lib.Local.info lib |> Lib_info.status |> Lib_info.Status.is_private
610+
|> not)
611+
in
607612
let+ l =
608613
Memo.Build.parallel_map l ~f:(fun l ->
609614
let+ m = entry_modules_by_lib sctx l in

test/blackbox-tests/test-cases/odoc/gh4799.t

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,3 @@ Private libraries attached to packages shouldn't be displayed in the index
1515
$ dune build @doc
1616
$ cat _build/default/_doc/_mlds/foo/index.mld
1717
{0 foo index}
18-
{1 Library foo}
19-
The entry point of this library is the module:
20-
{!module-Foo}.

0 commit comments

Comments
 (0)