Skip to content
Open
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 @@ -5,6 +5,7 @@
- Remove requirement for ppx_expect in tests (@jonludlam, #1445)
- Support for OxCaml modalities (@art-w, #1420)
- Fix resolving functor through `module type of` (@Leonidas-from-XIV, #1471)
- Fix odoc_driver's detection of `stdlib` when it is in `$prefix/lib64`, requires ocamlfind >= 1.9.8 (@katrinafyi, #1477, #1474)

# 3.2.1

Expand Down
2 changes: 1 addition & 1 deletion odoc-driver.opam
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ depends: [
"bos"
"fpath" {>= "0.7.3"}
"yojson" {>= "2.0.0"}
"ocamlfind"
"ocamlfind" {>= "1.9.8"}
"opam-format" {>= "2.1.0"}
"logs"
"eio_main"
Expand Down
8 changes: 1 addition & 7 deletions src/driver/ocamlfind.ml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
let init =
let initialized = ref false in
fun () ->
if !initialized then ()
else
let prefix = Opam.prefix () in
let env_camllib = Fpath.(v prefix / "lib" / "ocaml" |> to_string) in
let config = Fpath.(v prefix / "lib" / "findlib.conf" |> to_string) in
Findlib.init ~config ~env_camllib ()
fun () -> if !initialized then () else Findlib.init ()

let all () =
init ();
Expand Down
25 changes: 13 additions & 12 deletions src/driver/opam.ml
Original file line number Diff line number Diff line change
Expand Up @@ -196,18 +196,19 @@ let classify_libs prefix only_package contents =
match only_package with None -> true | Some p -> p = pkg
in

let libs =
List.fold_left
(fun set fpath ->
match Fpath.segs fpath with
| "lib" :: "stublibs" :: _ -> set
| "lib" :: pkg :: _ :: _
when Fpath.has_ext ".cmi" fpath && pkg_match pkg ->
Fpath.Set.add Fpath.(prefix // fpath |> split_base |> fst) set
| _ -> set)
Fpath.Set.empty contents
in
libs
contents
|> List.filter (Fpath.has_ext ".cmi")
|> List.filter_map (fun fpath ->
match Fpath.segs fpath with
| ("lib" | "lib64") :: "stublibs" :: _ -> None
(* e.g., [lib/cohttp/**/*.cmi] *)
| ("lib" | "lib64") :: pkg :: _ :: _ when pkg_match pkg ->
Some Fpath.(prefix // fpath |> split_base |> fst)
(* e.g., [lib64/stdlib.cmi] *)
| [ ("lib" | "lib64"); _ ] ->
Some Fpath.(prefix // fpath |> split_base |> fst)
| _ -> None)
|> Fpath.Set.of_list

let find_odoc_config prefix only_package contents =
let pkg_match pkg =
Expand Down
Loading