Skip to content

Commit

Permalink
Make driver suppress warnings for unselected packages
Browse files Browse the repository at this point in the history
  • Loading branch information
jonludlam committed Nov 28, 2024
1 parent 9c35a9f commit 0cdb9ba
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/driver/compile.ml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ let compile ?partial ~partial_dir (all : Odoc_unit.t list) =
in
Odoc.compile ~output_dir:unit.output_dir
~input_file:unit.input_file ~includes
~suppress_warnings:(not unit.enable_warnings)
~parent_id:unit.parent_id;
Atomic.incr Stats.stats.compiled_units;

Expand Down Expand Up @@ -191,7 +192,7 @@ let compile ?partial ~partial_dir (all : Odoc_unit.t list) =
| `Mld ->
let includes = Fpath.Set.empty in
Odoc.compile ~output_dir:unit.output_dir ~input_file:unit.input_file
~includes ~parent_id:unit.parent_id;
~includes ~suppress_warnings:false ~parent_id:unit.parent_id;
Atomic.incr Stats.stats.compiled_mlds;
Ok [ unit ]
| `Md ->
Expand Down
3 changes: 2 additions & 1 deletion src/driver/odoc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ let compile_deps f =
| [ (_, digest) ], deps -> Ok { digest; deps }
| _ -> Error (`Msg "odd")

let compile ~output_dir ~input_file:file ~includes ~parent_id =
let compile ~output_dir ~input_file:file ~includes ~suppress_warnings ~parent_id =
let open Cmd in
let includes =
Fpath.Set.fold
Expand All @@ -50,6 +50,7 @@ let compile ~output_dir ~input_file:file ~includes ~parent_id =
%% includes % "--enable-missing-root-warning"
in
let cmd = cmd % "--parent-id" % Id.to_string parent_id in
let cmd = if suppress_warnings then cmd % "--suppress-warnings" else cmd in
let desc = Printf.sprintf "Compiling %s" (Fpath.to_string file) in
ignore
@@ Cmd_outputs.submit
Expand Down
1 change: 1 addition & 0 deletions src/driver/odoc.mli
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ val compile :
output_dir:Fpath.t ->
input_file:Fpath.t ->
includes:Fpath.set ->
suppress_warnings:bool ->
parent_id:Id.t ->
unit
val compile_md :
Expand Down

0 comments on commit 0cdb9ba

Please sign in to comment.