Skip to content

Commit 5367937

Browse files
committed
Fix an issue with dune virtual library implementations
The way dune compiles implementations of virtual libraries means that there isn't a digest of the interface. We only use this for a convenient unique key, so this commit adds a fallback to using the source hash intead, and if _that_ doesn't exist, just use the name.
1 parent 91247de commit 5367937

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/loader/odoc_loader.ml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,11 @@ let read_cmt ~make_root ~parent ~filename () =
136136
in
137137
let interface = cmt_info.cmt_interface_digest in
138138
(match cmt_info.cmt_interface_digest with
139-
| None -> raise Corrupted
139+
| None ->
140+
(match cmt_info.cmt_source_digest with
141+
| Some x -> (try Odoc_model.Names.set_unique_ident (Digest.to_hex x) with _ -> ())
142+
| None ->
143+
(try Odoc_model.Names.set_unique_ident name with _ -> ()))
140144
| Some digest -> (
141145
try Odoc_model.Names.set_unique_ident (Digest.to_hex digest)
142146
with _ -> ()));

0 commit comments

Comments
 (0)