yallop / ocaml-ctypes

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

ctypes.0.19.1 does not build on debian-11-ocaml-4.11 #698

Closed Lupus closed 2 years ago

Lupus commented 2 years ago

Steps to reproduce:

$ docker run --rm -ti ocaml/opam:debian-11-ocaml-4.11 opam install ctypes
The following actions will be performed:
 - install ocamlfind       1.9.1  [required by ctypes]
 - install dune            2.9.1  [required by bigarray-compat, integers]
 - install integers        0.5.1  [required by ctypes]
 - install bigarray-compat 1.0.0  [required by ctypes]
 - install ctypes          0.19.1
===== 5 to install =====                                                                                                                                                                                                                                                                                                              <><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><><><>                                                                                   [bigarray-compat.1.0.0] downloaded from https://github.com/mirage/bigarray-compat/archive/v1.0.0.tar.gz                                                            [ctypes.0.19.1] downloaded from https://github.com/ocamllabs/ocaml-ctypes/archive/0.19.1.tar.gz                                                                    [integers.0.5.1] downloaded from https://github.com/ocamllabs/ocaml-integers/archive/0.5.1.tar.gz                                                                  [ocamlfind.1.9.1] downloaded from http://download.camlcity.org/download/findlib-1.9.1.tar.gz                                                                       [dune.2.9.1] downloaded from https://github.com/ocaml/dune/releases/download/2.9.1/dune-2.9.1.tbz                                                                                                                                                                                                                                     <><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>                                                                                   -> installed ocamlfind.1.9.1
-> installed dune.2.9.1
-> installed bigarray-compat.1.0.0
-> installed integers.0.5.1
[ERROR] The compilation of ctypes failed at "/usr/bin/make XEN=disable ctypes-base ctypes-stubs".

#=== ERROR while compiling ctypes.0.19.1 ======================================#
# context     2.0.10 | linux/x86_64 | ocaml-base-compiler.4.11.2 | file:///home/opam/opam-repository
# path        ~/.opam/4.11/.opam-switch/build/ctypes.0.19.1
# command     /usr/bin/make XEN=disable ctypes-base ctypes-stubs
# exit-code   2
# env-file    ~/.opam/log/ctypes-1-804caa.env
# output-file ~/.opam/log/ctypes-1-804caa.out
### output ###
# ocamlfind: Package `threads' not found
# ocamlfind: Package `threads' not found
# ocamlfind: Package `threads' not found
# ./src/discover/determine_as_needed_flags.sh >> asneeded.config
# ocamlfind: Package `threads' not found
# ocamlfind: Package `threads' not found
# ocamlfind: Package `threads' not found
# ocamlfind  ocamlc -o gen_c_primitives -package str -strict-sequence -linkpkg src/configure/extract_from_c.ml src/configure/gen_c_primitives.ml -I src/configure
# ocamlfind: Package `threads' not found
# make: *** [Makefile:130: src/ctypes/ctypes_primitives.ml] Error 2

<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
+- The following actions failed
| - build ctypes 0.19.1
+-
+- The following changes have been performed
| - install bigarray-compat 1.0.0
| - install dune            2.9.1
| - install integers        0.5.1
| - install ocamlfind       1.9.1
+-
yallop commented 2 years ago

Thank you for the report!

Steps to reproduce:

$ docker run --rm -ti ocaml/opam:debian-11-ocaml-4.11 opam install ctypes

Here's what I see:

$ docker run --rm -ti ocaml/opam:debian-11-ocaml-4.11 opam install ctypes
Unable to find image 'ocaml/opam:debian-11-ocaml-4.11' locally
debian-11-ocaml-4.11: Pulling from ocaml/opam

Digest: sha256:9ce035dac51c3d4b40dcf539cac4e46a504ed9f1bad539e8dc4d2a6691626557
Status: Downloaded newer image for ocaml/opam:debian-11-ocaml-4.11
The following actions will be performed:
  - install ocamlfind       1.9.1  [required by ctypes]
  - install dune            2.9.1  [required by bigarray-compat, integers]
  - install integers        0.5.1  [required by ctypes]
  - install bigarray-compat 1.0.0  [required by ctypes]
  - install ctypes          0.19.1
===== 5 to install =====

<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[bigarray-compat.1.0.0] downloaded from https://github.com/mirage/bigarray-compat/archive/v1.0.0.tar.gz
[ctypes.0.19.1] downloaded from https://github.com/ocamllabs/ocaml-ctypes/archive/0.19.1.tar.gz
[dune.2.9.1] downloaded from https://github.com/ocaml/dune/releases/download/2.9.1/dune-2.9.1.tbz
[integers.0.5.1] downloaded from https://github.com/ocamllabs/ocaml-integers/archive/0.5.1.tar.gz
[ocamlfind.1.9.1] downloaded from http://download.camlcity.org/download/findlib-1.9.1.tar.gz

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
-> installed ocamlfind.1.9.1
-> installed dune.2.9.1
-> installed bigarray-compat.1.0.0
-> installed integers.0.5.1
-> installed ctypes.0.19.1
Done.
Lupus commented 2 years ago

Thanks for quick response! For some reason this reproduces for me pretty stable both on dev vm and in CI jobs...

Lupus commented 2 years ago

Only one environment seems to be broken (used both by dev vm and CI), I can't repro it elsewhere. Will debug this further. Unlikely to be an issue with ctypes, closing this issue, sorry for the noise 🙏