ocaml / ocamlfind

The OCaml findlib library manager
Other
30 stars 30 forks source link

Fails to build on OCaml 5.00 trunk #29

Closed talex5 closed 2 years ago

talex5 commented 2 years ago

In https://github.com/ocaml/ocaml/pull/10867, OCaml removed a load of deprecated functions. This prevents ocamlfind from installing:

#=== ERROR while compiling ocamlfind.1.9.1 ====================================#
# context     2.1.0 | linux/x86_64 | ocaml-variants.5.00.0+trunk | https://opam.ocaml.org#ffd4aedc
# path        ~/.opam/5.00.0+trunk/.opam-switch/build/ocamlfind.1.9.1
# command     ~/.opam/opam-init/hooks/sandbox.sh build make all
# exit-code   2
# env-file    ~/.opam/log/ocamlfind-93913-b17e9e.env
# output-file ~/.opam/log/ocamlfind-93913-b17e9e.out
### output ###
# [...]
# ocamlc -I +compiler-libs -opaque -g -c frontend.ml
# File "frontend.ml", line 859, characters 10-39:
# 859 |           Fl_package_base.package_users predicates1 packages1
#                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# Warning 6 [labels-omitted]: label preds was omitted in the application of this function.
# File "frontend.ml", line 1826, characters 16-29:
# 1826 |       let buf = String.create buflen in   (* FIXME: Bytes.create *)
#                        ^^^^^^^^^^^^^
# Error: Unbound value String.create
# make[1]: *** [Makefile:165: frontend.cmo] Error 2
# make[1]: Leaving directory '/home/user/.opam/5.00.0+trunk/.opam-switch/build/ocamlfind.1.9.1/src/findlib'
# make: *** [Makefile:14: all] Error 2

Applying the fix in the comment does indeed fix it.

gerdstolpmann commented 2 years ago

Oh yes. Where is the fix?

talex5 commented 2 years ago

Oh yes. Where is the fix?

The comment says (* FIXME: Bytes.create *), and that worked for me.

gerdstolpmann commented 2 years ago

Ok, here is a proper PR: #30. It would be nice if this could get a bit of testing.