-
Notifications
You must be signed in to change notification settings - Fork 409
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 bigarray config (#5494) #5526
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
0ffd189
Fix bigarray config (#5494)
moyodiallo b1f451d
keep it simple by removing the warning message
moyodiallo 047c6ed
Fix bigarray config #5494
moyodiallo 4b5f43c
Fix bigarray config #5494
moyodiallo 53280a5
Fix bigarray config #5494
moyodiallo cb2c7d2
Turn filtering into a separate step
emillon e90db67
Fix formatting
emillon 0019ae4
Simplify rewrite
emillon b2958db
Update test case
dra27 1ec12f0
Merge branch 'main' into fix-bigarray
emillon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
let _c = Bigarray.C_layout_typ | ||
|
||
let () = Printf.eprintf "Welcome to a\n%!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
(executable | ||
(name a) | ||
(libraries bigarray)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
let _c1 = B_lib.v | ||
|
||
let _c2 = Bigarray.C_layout_typ | ||
|
||
let () = Printf.eprintf "Welcome to b\n%!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
let v = Bigarray.C_layout_typ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
(library | ||
(name b_lib) | ||
(libraries | ||
(re_export bigarray)) | ||
(modules b_lib)) | ||
|
||
(executable | ||
(name b) | ||
(libraries b_lib) | ||
(modules b)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
let _c = Bigarray.C_layout_typ | ||
|
||
let () = Printf.eprintf "Welcome to c WITH bigarray support\n%!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
let () = Printf.eprintf "Welcome to c with nothing inferred\n%!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
let () = Printf.eprintf "Welcome to c WITHOUT bigarray support\n%!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
(executable | ||
(name c) | ||
(libraries | ||
(select | ||
c.ml | ||
from | ||
(!bigarray -> c.nobigarray.ml) | ||
(bigarray -> c.bigarray.ml) | ||
(-> c.dummy.ml)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
(lang dune 3.0) | ||
|
||
(implicit_transitive_deps false) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
This tests the support for the bigarray atom in the dune libraries stanza. | ||
|
||
History: | ||
- OCaml 4.05 ([ocaml/ocaml#997](https://github.com/ocaml/ocaml/pull/997) and | ||
[ocaml/ocaml#1077](https://github.com/ocaml/ocaml/pull/1077)) add | ||
`Unix.map_file` allowing the `map_file` functions in `Bigarray` to be | ||
deprecated. Bigarray remains a separate library. | ||
- OCaml 4.07 ([ocaml/ocaml#1685](https://github.com/ocaml/ocaml/pull/1685)) | ||
adds `Stdlib.Bigarray`, but without the `map_file` functions (since these | ||
required `Unix.file_descr`. The separate library remains with those | ||
functions (but still marked as deprecated). Code can be updated to use | ||
Unix.map_file and then Stdlib.Bigarray and not require the separate library | ||
at all, but the separate remains compatible with OCaml 4.06. | ||
- OCaml 4.08 ([ocaml/ocaml#2263](https://github.com/ocaml/ocaml/pull/2263)) | ||
deletes the `map_file` functions completely, requiring _all_ code to be | ||
updated to use `Unix.map_file`, if appropriate. From this release, it is | ||
unnecessary to link with the separate Bigarray library. | ||
- OCaml 5.00 ([ocaml/ocaml#10896](https://github.com/ocaml/ocaml/pull/10896) | ||
removes the separate Bigarray library. | ||
|
||
Code may be written which is designed to support both OCaml 4.06 and earlier and | ||
also OCaml 5.0+. In such cases, it is appropriate to have `(libraries bigarray)` | ||
even though there is no Bigarray library in OCaml 5. | ||
|
||
This test uses `(libraries bigarray)` (the program uses `Bigarray`) | ||
$ dune exec a/a.exe | ||
Welcome to a | ||
This test uses `(libraries (re_export bigarray))` similarly | ||
$ dune exec b/b.exe | ||
Welcome to b | ||
This test uses a `(select )` construct and should always select bigarray support | ||
$ dune exec c/c.exe | ||
Welcome to c WITH bigarray support |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is incorrect and introduces a bug that forbids local libraries named
bigarray
from being used on OCaml < 5.0.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, I don't know how we can test if there a local library called
bigarray
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that has been fixed in #8902 .