Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't build docs for implementations of virtual libraries #2141

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/lib.ml
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,8 @@ let modes t = t.info.modes

let virtual_ t = t.info.virtual_

let is_impl t = Option.is_some t.implements

let src_dir t = t.info.src_dir
let orig_src_dir t = Option.value ~default:t.info.src_dir t.info.orig_src_dir
let obj_dir t = t.info.obj_dir
Expand Down
5 changes: 5 additions & 0 deletions src/lib.mli
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ val wrapped : t -> Wrapped.t option Or_exn.t

val virtual_ : t -> Lib_modules.t Lib_info.Source.t option

(** [is_impl lib] returns [true] if the library is an implementation
of a virtual library *)
val is_impl : t -> bool


val special_builtin_support
: t -> Dune_file.Library.Special_builtin_support.t option

Expand Down
5 changes: 4 additions & 1 deletion src/odoc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,10 @@ let setup_toplevel_index_rule sctx =
let libs_of_pkg sctx ~pkg =
match Package.Name.Map.find (SC.libs_by_package sctx) pkg with
| None -> Lib.Set.empty
| Some (_, libs) -> libs
| Some (_, libs) ->
(* Filter out all implementations of virtual libraries *)
Lib.Set.filter ~f:(fun lib ->
not (Lib.is_impl lib)) libs

let load_all_odoc_rules_pkg sctx ~pkg =
let pkg_libs = libs_of_pkg sctx ~pkg in
Expand Down