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

Successfully sun-setting the bigarray package #5494

Closed
dra27 opened this issue Feb 28, 2022 · 1 comment · Fixed by #5526 or ocaml/opam-repository#21555
Closed

Successfully sun-setting the bigarray package #5494

dra27 opened this issue Feb 28, 2022 · 1 comment · Fixed by #5526 or ocaml/opam-repository#21555

Comments

@dra27
Copy link
Member

dra27 commented Feb 28, 2022

#5420/#5421 removes the internal definition of the bigarray package for OCaml 5.0+. This is of course correct, but it's proving a little painful for ecosystem testing, and this issue explores a possible halfway house.

There is a bug - albeit a very academic one - in the handling of the internal dummy packages. If you have a compiler with 4.08-4.14 configured with --disable-bigarray-lib and you do not install ocamlfind, then a library which includes bigarray in its libraries field will successfully compile (because the dummy package is used by Dune) but the META file for that library will incorrectly include bigarray in the requires field.

The dual of this behaviour is what I think is really wanted for OCaml 5.0+ in Dune. I'd like to suggest two tweaks in both 2.9.x and 3.x:

  1. In OCaml 5.0+ switches, the bigarray package is a no-op, rather than a dummy. That is to say that (libraries bigarray) is effectively ignored - most importantly, it doesn't get emitted in the requires field in META.
  2. In cases where Dune can determine that the package requires OCaml 4.07 or later, a deprecation warning should be emitted if bigarray appears in the libraries field.

The first change would allow code targeting both OCaml 4.06 and earlier and OCaml 5.0+ to continue specifying bigarray. This is what's hurting ecosystem testing at the moment - we have packages which are breaking solely because of the metadata problem, but in fact build successfully in both 4.x and 5.x.

The second - optional - change encourages an ending to all this (and could also be accompanied by similar support on the opam/opam-dune-lint side) by ensuring that code targeting only OCaml 4.07 and later removes the reference to this unnecessary package and leads us towards a day where it's no longer referenced at all.

The alternatives aren't quite as pretty:

  • packages using Bigarray could required to target only 4.07+ but, crucially, this requires new releases of those packages for 5.0 to remove the reference to bigarray in the dune files (there do appear to be packages which otherwise do not require new releases, so it's that which is unfortunate, rather than forcing a 4.07 minimum version of OCaml)
  • ocamlfind could install a dummy bigarray package for OCaml 5.0+ (i.e. as for bytes). However, this introduces a hard build-time dependency on ocamlfind and also has no sunset.
@nojb
Copy link
Collaborator

nojb commented Feb 28, 2022

  1. sounds reasonable to me. cc @kit-ty-kate

moyodiallo added a commit to moyodiallo/dune that referenced this issue Mar 21, 2022
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.
moyodiallo added a commit to moyodiallo/dune that referenced this issue Mar 21, 2022
    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]>
moyodiallo added a commit to moyodiallo/dune that referenced this issue Mar 21, 2022
    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]>
moyodiallo added a commit to moyodiallo/dune that referenced this issue Mar 21, 2022
    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]>
dra27 pushed a commit to dra27/dune that referenced this issue Mar 24, 2022
    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]>
dra27 pushed a commit to dra27/dune that referenced this issue Mar 24, 2022
    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]>
moyodiallo added a commit to moyodiallo/dune that referenced this issue Apr 20, 2022
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]>
moyodiallo added a commit to moyodiallo/dune that referenced this issue Apr 21, 2022
A new test case Select rule with bigarray

Signed-off-by: Alpha DIALLO <[email protected]>
moyodiallo added a commit to moyodiallo/dune that referenced this issue Apr 28, 2022
"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"
moyodiallo added a commit to moyodiallo/dune that referenced this issue Apr 28, 2022
"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]>
@emillon emillon linked a pull request May 23, 2022 that will close this issue
emillon pushed a commit to moyodiallo/dune that referenced this issue May 24, 2022
    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]>
emillon pushed a commit to moyodiallo/dune that referenced this issue May 24, 2022
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]>
emillon pushed a commit to moyodiallo/dune that referenced this issue May 24, 2022
A new test case Select rule with bigarray

Signed-off-by: Alpha DIALLO <[email protected]>
emillon pushed a commit to moyodiallo/dune that referenced this issue May 24, 2022
"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]>
emillon pushed a commit to moyodiallo/dune that referenced this issue May 24, 2022
    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]>
emillon pushed a commit to moyodiallo/dune that referenced this issue May 24, 2022
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]>
emillon pushed a commit to moyodiallo/dune that referenced this issue May 24, 2022
A new test case Select rule with bigarray

Signed-off-by: Alpha DIALLO <[email protected]>
Signed-off-by: Etienne Millon <[email protected]>
emillon pushed a commit to moyodiallo/dune that referenced this issue May 24, 2022
"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]>
emillon pushed a commit to moyodiallo/dune that referenced this issue May 24, 2022
    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]>
emillon pushed a commit to moyodiallo/dune that referenced this issue May 24, 2022
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]>
emillon pushed a commit to moyodiallo/dune that referenced this issue May 24, 2022
A new test case Select rule with bigarray

Signed-off-by: Alpha DIALLO <[email protected]>
Signed-off-by: Etienne Millon <[email protected]>
emillon pushed a commit to moyodiallo/dune that referenced this issue May 24, 2022
"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]>
emillon pushed a commit to moyodiallo/dune that referenced this issue May 25, 2022
    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]>
emillon pushed a commit to moyodiallo/dune that referenced this issue May 25, 2022
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]>
emillon pushed a commit to moyodiallo/dune that referenced this issue May 25, 2022
A new test case Select rule with bigarray

Signed-off-by: Alpha DIALLO <[email protected]>
Signed-off-by: Etienne Millon <[email protected]>
emillon pushed a commit to moyodiallo/dune that referenced this issue May 25, 2022
"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]>
emillon pushed a commit to moyodiallo/dune that referenced this issue May 25, 2022
    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]>
emillon pushed a commit to moyodiallo/dune that referenced this issue May 25, 2022
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]>
emillon pushed a commit to moyodiallo/dune that referenced this issue May 25, 2022
A new test case Select rule with bigarray

Signed-off-by: Alpha DIALLO <[email protected]>
Signed-off-by: Etienne Millon <[email protected]>
emillon pushed a commit to moyodiallo/dune that referenced this issue May 25, 2022
"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]>
emillon pushed a commit to moyodiallo/dune that referenced this issue May 30, 2022
    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]>
emillon pushed a commit to moyodiallo/dune that referenced this issue May 30, 2022
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]>
emillon pushed a commit to moyodiallo/dune that referenced this issue May 30, 2022
A new test case Select rule with bigarray

Signed-off-by: Alpha DIALLO <[email protected]>
Signed-off-by: Etienne Millon <[email protected]>
emillon pushed a commit to moyodiallo/dune that referenced this issue May 30, 2022
"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]>
dra27 pushed a commit to moyodiallo/dune that referenced this issue Jun 7, 2022
    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]>
dra27 pushed a commit to moyodiallo/dune that referenced this issue Jun 7, 2022
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]>
dra27 pushed a commit to moyodiallo/dune that referenced this issue Jun 7, 2022
A new test case Select rule with bigarray

Signed-off-by: Alpha DIALLO <[email protected]>
Signed-off-by: Etienne Millon <[email protected]>
dra27 pushed a commit to moyodiallo/dune that referenced this issue Jun 7, 2022
"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]>
emillon added a commit that referenced this issue Jun 13, 2022
* Fix bigarray config (#5494)

This filters out "bigarray" in (libraries) on ocaml >= 5.0.

Signed-off-by: Alpha DIALLO <[email protected]>
Co-authored-by: Etienne Millon <[email protected]>
Co-authored-by: David Allsopp <[email protected]>
kit-ty-kate pushed a commit to ocaml/opam-repository that referenced this issue Jun 17, 2022
…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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment