yallop / ocaml-ctypes

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

OCaml 5.2 support #762

Closed kit-ty-kate closed 4 months ago

kit-ty-kate commented 4 months ago

ctypes currently fails to build with OCaml 5.2 with the following message:

#=== ERROR while compiling ctypes.0.21.1 ======================================#
# context              2.2.0~beta2~dev | linux/x86_64 | ocaml-variants.5.2.0+trunk | file:///home/opam/opam-repository
# path                 ~/.opam/5.2/.opam-switch/build/ctypes.0.21.1
# command              ~/.opam/5.2/bin/dune build -p ctypes -j 1 --promote-install-files=false @install
# exit-code            1
# env-file             ~/.opam/log/ctypes-19-c4c6fb.env
# output-file          ~/.opam/log/ctypes-19-c4c6fb.out
### output ###
# (cd _build/default && /home/opam/.opam/5.2/bin/ocamlc.opt -w -40 -g -bin-annot -I src/ctypes/.ctypes.objs/byte -I /home/opam/.opam/5.2/lib/bigarray-compat -I /home/opam/.opam/5.2/lib/integers -I /home/opam/.opam/5.2/lib/stdlib-shims -no-alias-deps -o src/ctypes/.ctypes.objs/byte/ctypes_bigarray_stubs.cmo -c -impl src/ctypes/ctypes_bigarray_stubs.ml)
# File "src/ctypes/ctypes_bigarray_stubs.ml", lines 23-36, characters 61-37:
# 23 | .............................................................function
# 24 |   | Bigarray_compat.Float32 -> Kind_float32
# 25 |   | Bigarray_compat.Float64 -> Kind_float64
# 26 |   | Bigarray_compat.Int8_signed -> Kind_int8_signed
# 27 |   | Bigarray_compat.Int8_unsigned -> Kind_int8_unsigned
# ...
# 33 |   | Bigarray_compat.Nativeint -> Kind_nativeint
# 34 |   | Bigarray_compat.Complex32 -> Kind_complex32
# 35 |   | Bigarray_compat.Complex64 -> Kind_complex64
# 36 |   | Bigarray_compat.Char -> Kind_char
# Error (warning 8 [partial-match]): this pattern-matching is not exhaustive.
# Here is an example of a case that is not matched:
# Float16
yallop commented 4 months ago

Thank you for the report! There's a minimal fix in #764.

kit-ty-kate commented 4 months ago

Would it be possible to make a new release with this fix?

yallop commented 4 months ago

Yes: see https://github.com/ocaml/opam-repository/pull/25229