Skip to content
Merged
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
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### Fixed

- Fix bug causing stack overflow in odoc_driver_monorepo (@jonludlam, #1304)
- Fix backtrace on invalid input in compile-deps (@jonludlam, #1313)

# 3.0.0~beta1

Expand Down
32 changes: 23 additions & 9 deletions src/odoc/bin/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1410,15 +1410,29 @@ end)
module Depends = struct
module Compile = struct
let list_dependencies input_files =
let deps =
Depends.for_compile_step (List.map ~f:Fs.File.of_string input_files)
in
List.iter
~f:(fun t ->
Printf.printf "%s %s\n" (Depends.Compile.name t)
(Digest.to_hex @@ Depends.Compile.digest t))
deps;
flush stdout
try
let deps =
Depends.for_compile_step (List.map ~f:Fs.File.of_string input_files)
in
List.iter
~f:(fun t ->
Printf.printf "%s %s\n" (Depends.Compile.name t)
(Digest.to_hex @@ Depends.Compile.digest t))
deps;
flush stdout
with Cmi_format.Error e ->
let msg =
match e with
| Not_an_interface file ->
Printf.sprintf "File %S is not an interface" file
| Wrong_version_interface (file, v) ->
Printf.sprintf "File %S is compiled for %s version of OCaml" file
v
| Corrupted_interface file ->
Printf.sprintf "File %S is corrupted" file
in
Printf.eprintf "ERROR: %s\n%!" msg;
exit 1

let cmd =
let input =
Expand Down