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

Remove compatibility with OCaml 4.02 (makes ctypes stubs compatible with ocaml-multicore for free) #673

Merged
merged 1 commit into from
Jun 14, 2021

Conversation

kit-ty-kate
Copy link
Contributor

The stubs generation part of ctypes doesn't seem to be compatible with ocaml-multicore at the moment. For instance, the following error message is raised when trying to compile decompress which uses ctypes' stubs generation:

#=== ERROR while compiling decompress.1.4.1 ===================================#
# context              2.1.0~beta4 | linux/x86_64 | ocaml-variants.4.12.0+domains | file:///home/opam/opam-repository
# path                 ~/.opam/4.12.0+domains/.opam-switch/build/decompress.1.4.1
# command              ~/.opam/4.12.0+domains/bin/dune runtest -p decompress -j 31
# exit-code            1
# env-file             ~/.opam/log/decompress-2686-ca0fe3.env
# output-file          ~/.opam/log/decompress-2686-ca0fe3.out
### output ###
#          gcc bindings/stubs/gen_decompress.o (exit 1)
# (cd _build/default/bindings/stubs && /usr/bin/gcc -O2 -fno-strict-aliasing -fwrapv -fPIC -D_FILE_OFFSET_BITS=64 -D_REENTRANT -O2 -fno-strict-aliasing -fwrapv -fPIC -g -I /home/opam/.opam/4.12.0+domains/lib/ocaml -I /home/opam/.opam/4.12.0+domains/lib/bigarray-compat -I /home/opam/.opam/4.12.0+domains/lib/bytes -I /home/opam/.opam/4.12.0+domains/lib/checkseum/c -I /home/opam/.opam/4.12.0+domains/lib/ctypes -I /home/opam/.opam/4.12.0+domains/lib/integers -I /home/opam/.opam/4.12.0+domains/lib/optint -I . -I ../../lib -o gen_decompress.o -c gen_decompress.c)
# gen_decompress.c: In function 'decompress_inflate':
# gen_decompress.c:38:4: error: 'caml_local_roots' undeclared (first use in this function); did you mean 'caml_local_roots_ptr'?
#    38 |    caml_local_roots = caml__frame;;
#       |    ^~~~~~~~~~~~~~~~
#       |    caml_local_roots_ptr
# gen_decompress.c:38:4: note: each undeclared identifier is reported only once for each function it appears in

Looking into it, it seems the direct use of caml_local_roots stems from a care for backwards compatibility. Given it is relatively easy to simply bump the required version and use the "new" CAMLdrop() macro I feel like it might be worth doing anyway.

@yallop
Copy link
Owner

yallop commented Jun 14, 2021

Thank you! It seems like a reasonable time to drop support for 4.02.3.

@yallop yallop merged commit b5924fc into yallop:master Jun 14, 2021
@yallop yallop mentioned this pull request Jun 14, 2021
13 tasks
avsm added a commit to avsm/ocaml-ctypes that referenced this pull request Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants