yallop / ocaml-ctypes

Library for binding to C libraries using pure OCaml
MIT License
363 stars 95 forks source link

Remove bigarray which is a part of the standard library #660

Closed dinosaure closed 3 years ago

dinosaure commented 3 years ago

I'm not sure about which version of OCaml ocaml-ctypes should support but this patch delete the non-essential unix dependency for the core library (and ctypes.stubs). This patch unlock the ability to do a reverse binding of an OCaml library which does not depends on unix.

yallop commented 3 years ago

This is a useful change, and I'm happy to merge it if it can be adapted to keep support for OCaml versions before 4.07.0 (when bigarray was added to the stdlib).

We'd probably need conditions both in the Makefile and the opam file (and eventually for dune: see #588). I'm not sure how best to deal with the findlib META file, though.

dinosaure commented 3 years ago

One possibility is to use bigarray-compat which does the dispatch for you but it requires to explicitly use Bigarray_compat. If you are not agree with such solution, I can find my way to do the dispatch on the Makefile level :+1:.

yallop commented 3 years ago

Using bigarray_compat looks like a reasonable solution.

dinosaure commented 3 years ago

I updated the project according the new usage of bigarray-compat instead bigarray. However, I did not change anything about generated code - I mean, generated code still refers to Bigarray module. I ran make depend to re-generate .depend and updated OPAM and META file :+1:. I think it's ready for a review.

yallop commented 3 years ago

The 4.02.3 build is failing, because bigarray-compat isn't installable:

The following dependencies couldn't be met:
  - ctypes → bigarray-compat → ocaml >= 4.03.0
      base of this switch (use `--unlock-base' to force)

Can the constraint in the bigarray-compat package be relaxed to allow OCaml 4.02.3?

dinosaure commented 3 years ago

See ocaml/opam-repository#17600 and mirage/bigarray-compat#3 :+1:.

yallop commented 3 years ago

I've restarted the failing jobs ([1], [2]) now that ocaml/opam-repository#17600 is merged.

dinosaure commented 3 years ago

Seems all green :tada: ! It's possible to cut a minor release with it ?