Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: select with bigarray in OCaml 5 #10011

Merged
merged 1 commit into from
Mar 6, 2024
Merged
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
2 changes: 2 additions & 0 deletions doc/changes/10011.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Fix conditional source selection with `select` on `bigarray` in OCaml 5
(#10011, @moyodiallo)
6 changes: 3 additions & 3 deletions src/dune_rules/lib.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1154,10 +1154,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
Loading