Skip to content

Commit

Permalink
Fix bigarray config (ocaml#5494)
Browse files Browse the repository at this point in the history
The bigarray library has already inculded in the Standard Library since
OCaml 4.07, the library has been removed in OCaml 5.00 and this fix
avoid an Error durig resolving the library by just emitting a Warning.
  • Loading branch information
moyodiallo committed Mar 21, 2022
1 parent 8677fe3 commit c63d329
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions src/dune_rules/lib.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1435,14 +1435,26 @@ end = struct
in
(acc_res, acc_selects, acc_re_exports)
| Direct (loc, name) ->
let+ lib = resolve_dep db (loc, name) ~private_deps in
let acc_res =
let open Resolve.O in
let+ lib = lib
and+ acc_res = acc_res in
lib :: acc_res
in
(acc_res, acc_selects, acc_re_exports)
let ocaml_version = db.lib_config.ocaml_version in
if String.equal "bigarray" (Lib_name.to_string name)
&& not (Ocaml_version.has_bigarray_library ocaml_version)
then
begin
User_warning.emit ~loc
[ Pp.textf
"Already in the Standard Library of OCaml %s"
db.lib_config.ocaml_version_string
];
Memo.Build.return (acc_res, acc_selects, acc_re_exports)
end
else
let+ lib = resolve_dep db (loc, name) ~private_deps in
let acc_res =
let open Resolve.O in
let+ lib = lib
and+ acc_res = acc_res in
lib :: acc_res
in (acc_res, acc_selects, acc_re_exports)
| Select select ->
let+ res, resolved_select = resolve_select select in
let acc_res =
Expand Down

0 comments on commit c63d329

Please sign in to comment.