-
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
Conversation
Thanks for this! Comparing opam-repository for current trunk OCaml (with opam-alpha-repository enabled), this unblocks 56 packages and reveals 7 new failing packages - several of which look they have pertinent errors. |
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.
What is the status of this? I see there is some discussion around the warning... I would suggest to keep the fix minimal by removing the warning and simply focusing on making bigarray
a no-op in OCaml 5 and later. The warning can be added later if necessary/wanted.
6ecac5e
to
6c8d122
Compare
As it happens, I started reviewing and poking this today, too, @nojb! I think the other two cases need ( FWIW, it should be possible to extend this behaviour back to 4.08 - IIRC since 4.08 it has not been necessary ever to use the legacy bigarray library, but it would be better to do that in a separate PR (if at all), as well. |
Implementing "Select" rule and "Re_export" witch is the same as "Direct". ocaml#5526 (comment) is a good report for this fix. Signed-off-by: Alpha DIALLO <[email protected]>
I think it's ready for last review then to be merged. |
5bfff0b
to
e8d9458
Compare
Hi @dra27, I noticed we could end-up require and forbidden empty so that switch quietly in the case "(_ -> ...)". |
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.
OK, let's get that one past the finish line. I'd like to make sure we can keep this logic not to spread around and we should be able to fix that for the next version of dune.
Implementing "Select" rule and "Re_export" witch is the same as "Direct". ocaml#5526 (comment) is a good report for this fix. Signed-off-by: Alpha DIALLO <[email protected]>
Implementing "Select" rule and "Re_export" witch is the same as "Direct". ocaml#5526 (comment) is a good report for this fix. Signed-off-by: Alpha DIALLO <[email protected]> Signed-off-by: Etienne Millon <[email protected]>
I pulled the code in a way that adds a new "rewrite" step before the rest of the processing. This ensures that this PR is a no-op for OCaml 4.x. For the part that rewrites the lib dep, we create a new lib dep that is interpreted as before. This is done with the same rules we would use if we were upgrading a project to OCaml 5+.
There's a mildly interesting corner case which happens when no choices are left after rewriting. This happens with |
Implementing "Select" rule and "Re_export" witch is the same as "Direct". ocaml#5526 (comment) is a good report for this fix. Signed-off-by: Alpha DIALLO <[email protected]> Signed-off-by: Etienne Millon <[email protected]>
Implementing "Select" rule and "Re_export" witch is the same as "Direct". ocaml#5526 (comment) is a good report for this fix. Signed-off-by: Alpha DIALLO <[email protected]> Signed-off-by: Etienne Millon <[email protected]>
Implementing "Select" rule and "Re_export" witch is the same as "Direct". ocaml#5526 (comment) is a good report for this fix. Signed-off-by: Alpha DIALLO <[email protected]> Signed-off-by: Etienne Millon <[email protected]>
Implementing "Select" rule and "Re_export" witch is the same as "Direct". ocaml#5526 (comment) is a good report for this fix. Signed-off-by: Alpha DIALLO <[email protected]> Signed-off-by: Etienne Millon <[email protected]>
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]>
The skip of bigarray remains Signed-off-by: Alpha DIALLO <[email protected]> Signed-off-by: Etienne Millon <[email protected]>
Implementing "Select" rule and "Re_export" witch is the same as "Direct". ocaml#5526 (comment) is a good report for this fix. Signed-off-by: Alpha DIALLO <[email protected]> Signed-off-by: Etienne Millon <[email protected]>
A new test case Select rule with bigarray Signed-off-by: Alpha DIALLO <[email protected]> Signed-off-by: Etienne Millon <[email protected]>
"Select" rule prevent the case when we endup on require and forbiden empty. Skipping bigarray could result having require and forbiden empty that case is the same as no literals "(_ -> dummy)". Some test-cases for "Direct", "Re-export" and "Select" Signed-off-by: Alpha DIALLO <[email protected]> Signed-off-by: Etienne Millon <[email protected]>
Signed-off-by: Etienne Millon <[email protected]>
Signed-off-by: Etienne Millon <[email protected]>
Signed-off-by: Etienne Millon <[email protected]>
Signed-off-by: David Allsopp <[email protected]>
I rebased and propose b2958db to update the test case - this runs three different programs which exercise the three cases in the code. The test is expected to run in the same way on any OCaml version - i.e. when Dune starts testing OCaml 5.0 in CI then that test should remain unchanged (I ran it locally with OCaml 5, of course). |
In ocaml/ocaml#11007 (comment) I suggested shipping |
I'm just paging in the OCaml PR, but we definitely shouldn't have a |
Right, I'll make a note upstream, thanks for the clarifying. |
Could it be necessary to test which file is emitted from the case 3 ( |
It does - each of the files prints a different message, so if the wrong file is selected the cram test will fail because of different output. |
Thanks! I rebased and tested that on the 5.0 branch. |
Signed-off-by: Etienne Millon <[email protected]>
Signed-off-by: Etienne Millon <[email protected]>
…ne-site, dune-rpc, dune-rpc-lwt, dune-private-libs, dune-glob, dune-configurator, dune-build-info, dune-action-plugin and chrome-trace (3.3.0) CHANGES: - Sandbox preprocessing, lint, and dialect rules by default. All these rules now require precise dependency specifications (ocaml/dune#5807, @rgrinberg) - Allow list expansion in the `pps` specification for preprocessing (ocaml/dune#5820, @Firobe) - Add warnings 67-69 to dune's default set of warnings. These are warnings of the form "unused X.." (ocaml/dune#5844, @rgrinbreg) - Introduce project "composition" for coq theories. Coq theories in separate projects can now refer to each other when in the same workspace (ocaml/dune#5784, @Alitzer, @rgrinberg) - Fix hint message for ``data_only_dirs`` that wrongly mentions the unknown constructor ``data_only`` (ocaml/dune#5803, @lambdaxdotx) - Fix creating sandbox directory trees by getting rid of buggy memoization (@5794, @rgrinberg, @snowleopard) - Handle directory dependencies in sandboxed rules. Previously, the parents of these directory dependencies weren't created. (ocaml/dune#5754, @rgrinberg) - Set the exit code to 130 when dune is terminated with a signal (ocaml/dune#5769, fixes ocaml/dune#5757) - Support new locations of unix, str, dynlink in OCaml >= 5.0 (ocaml/dune#5582, @dra27) - The ``coq.theory`` stanza now produces rules for running ``coqdoc``. Given a theory named ``mytheory``, the directory targets ``mytheory.html/`` and ``mytheory.tex/`` or additionally the aliases `@doc` and `@doc-latex` will build the HTML and LaTeX documentation repsectively. (ocaml/dune#5695, fixes ocaml/dune#3760, @Alizter) - Coq theories marked as `(boot)` cannot depend on other theories (ocaml/dune#5867, @ejgallego) - Ignore `bigarray` in `(libraries)` with OCaml >= 5.0. (ocaml/dune#5526, fixes ocaml/dune#5494, @moyodiallo) - Start with :standard when building the ctypes generated foreign stubs so that we include important compiler flags, such as -fPIC (ocaml/dune#5816, fixes ocaml/dune#5809).
in | ||
if bigarray_in_std_libraries then deps | ||
else | ||
let bigarray = Lib_name.of_string "bigarray" in |
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 .
This is a tentative fix for #5494, bigarray issue on OCaml 5.00
I explored 2 solutions and I chose the second one.
I'm not sure this is the right way to go about this problem, let me know if anyone thought of a better solution and I can make adjustments to this PR.
cc @kit-ty-kate