Skip to content

Commit

Permalink
fix: select with bigarray in OCaml 5
Browse files Browse the repository at this point in the history
This is related to ocaml#9981.

Signed-off-by: Alpha DIALLO <moyodiallo@gmail.com>
  • Loading branch information
moyodiallo committed Feb 13, 2024
1 parent 8fac9f5 commit b9abe69
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/dune_rules/lib.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1149,10 +1149,10 @@ end = struct

let available_internal db (name : Lib_name.t) =
let open Memo.O in
resolve_dep db (Loc.none, name) ~private_deps:Allow_all
find_internal db name
>>| function
| Some x -> Resolve.is_ok x
| None -> false
| Ignore | Found _ -> true
| Not_found | Invalid _ | Hidden _ -> false
;;

let resolve_simple_deps db names ~private_deps : t list Resolve.Memo.t =
Expand Down
3 changes: 3 additions & 0 deletions test/blackbox-tests/test-cases/bigarray.t/d/d.bigarray.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
let _d = Bigarray.C_layout_typ

let () = Printf.eprintf "Welcome to d WITH bigarray support\n%!"
1 change: 1 addition & 0 deletions test/blackbox-tests/test-cases/bigarray.t/d/d.dummy.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let () = Printf.eprintf "Welcome to d with nothing inferred\n%!"
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let () = Printf.eprintf "Welcome to d WITHOUT bigarray support\n%!"
9 changes: 9 additions & 0 deletions test/blackbox-tests/test-cases/bigarray.t/d/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
(executable
(name d)
(libraries
(select
d.ml
from
(bigarray -> d.bigarray.ml)
(!bigarray -> d.nobigarray.ml)
(-> d.dummy.ml))))
3 changes: 3 additions & 0 deletions test/blackbox-tests/test-cases/bigarray.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ This test uses `(libraries (re_export bigarray))` similarly
This test uses a `(select )` construct and should always select bigarray support
$ dune exec c/c.exe
Welcome to c WITH bigarray support
This test uses a `(select )` construct and should always select bigarray supprot (the evaluation of `select` order differ from the previous test)
$ dune exec d/d.exe
Welcome to d WITH bigarray support

0 comments on commit b9abe69

Please sign in to comment.