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.

Signed-off-by: Alpha DIALLO <[email protected]>
Signed-off-by: Etienne Millon <[email protected]>
  • Loading branch information
moyodiallo authored and emillon committed May 25, 2022
1 parent a73b066 commit 4850cc0
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/dune_rules/lib.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1245,9 +1245,20 @@ end = struct
| Re_export lib ->
let+ lib = resolve_dep db lib ~private_deps in
add_re_exports acc lib
| Direct lib ->
let+ lib = resolve_dep db lib ~private_deps in
add_resolved acc lib
| Direct (loc, name) ->
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 (
User_warning.emit ~loc
[ Pp.textf "Already in the Standard Library of OCaml %s"
db.lib_config.ocaml_version_string
];
Memo.return acc)
else
let+ lib = resolve_dep db (loc, name) ~private_deps in
add_resolved acc lib
| Select select ->
let+ resolved, select = resolve_select select in
add_select acc resolved select)
Expand Down

0 comments on commit 4850cc0

Please sign in to comment.