yoriyuki / Camomile

A Unicode library for OCaml
Other
125 stars 26 forks source link

Does not compile with OCaml 4.09.0 #83

Open zeule opened 4 years ago

zeule commented 4 years ago

Generates errors about Pervasives:

Error (alert deprecated): module Stdlib.Pervasives
Use Stdlib instead.
kousu commented 4 years ago

I'm having problems too, but with a different error on OpenBSD. OpenBSD 6.6 has OCaml 4.09 in packages right now (https://openports.se/lang/ocaml) and

$ opam install camomile
The following actions will be performed:
  - install camomile 1.0.2

<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[camomile.1.0.2] downloaded from cache at https://opam.ocaml.org/cache

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[ERROR] The compilation of camomile failed at "/home/kousu/.opam/default/bin/dune build -p camomile -j 1 @install".

#=== ERROR while compiling camomile.1.0.2 =====================================#
# context     2.0.5 | openbsd/x86_64 | ocaml-system.4.09.0 | https://opam.ocaml.org#0825e2d9
# path        ~/.opam/default/.opam-switch/build/camomile.1.0.2
# command     ~/.opam/default/bin/dune build -p camomile -j 1 @install
# exit-code   1
# env-file    ~/.opam/log/camomile-20648-d0f245.env
# output-file ~/.opam/log/camomile-20648-d0f245.out
### output ###
# [...]
# camomilelocaledef Camomile/locales/zh_MO.mar (exit 2)
# (cd _build/default/Camomile && tools/camomilelocaledef.exe --file locales/zh_MO.txt locales)
# Fatal error: exception Stack overflow
# camomilelocaledef Camomile/locales/zh_TW.mar (exit 2)
# (cd _build/default/Camomile && tools/camomilelocaledef.exe --file locales/zh_TW.txt locales)
# Fatal error: exception Stack overflow
# camomilelocaledef Camomile/locales/zh_TW_STROKE.mar (exit 2)
# (cd _build/default/Camomile && tools/camomilelocaledef.exe --file locales/zh_TW_STROKE.txt locales)
# Fatal error: exception Stack overflow
# camomilelocaledef Camomile/locales/zh__PINYIN.mar (exit 2)
# (cd _build/default/Camomile && tools/camomilelocaledef.exe --file locales/zh__PINYIN.txt locales)
# Fatal error: exception Stack overflow

<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
+- The following actions failed
| - build camomile 1.0.2
+- 
- No changes have been performed
yurivict commented 3 years ago

Does not compile with ocaml-4.12:

dune build @install
File "Camomile/internal/byte_labeled_dag.ml", line 90, characters 29-47:
90 |   let comp (s1, _) (s2, _) = Pervasives.compare s1 s2 in
                                  ^^^^^^^^^^^^^^^^^^
Error (alert deprecated): module Stdlib.Pervasives
Use Stdlib instead.

If you need to stay compatible with OCaml < 4.07, you can use the 
stdlib-shims library: https://github.com/ocaml/stdlib-shims
File "Camomile/public/oOChannel.mli", line 116, characters 22-43:
116 | class of_in_channel : Pervasives.in_channel -> char_input_channel
                            ^^^^^^^^^^^^^^^^^^^^^
Error (alert deprecated): module Stdlib.Pervasives
Use Stdlib instead.

If you need to stay compatible with OCaml < 4.07, you can use the 
stdlib-shims library: https://github.com/ocaml/stdlib-shims
File "Camomile/public/oOChannel.mli", line 119, characters 23-45:
119 | class of_out_channel : Pervasives.out_channel -> char_output_channel
                             ^^^^^^^^^^^^^^^^^^^^^^
Error (alert deprecated): module Stdlib.Pervasives
Use Stdlib instead.
mndrix commented 2 years ago

Fatal error: exception Stack overflow

I resolved this error (camomile 1.0.2, OpenBSD 7.0, OCaml 4.13.1) by increasing ulimits:

$ ulimit -n "$(ulimit -H -n)" -l "$(ulimit -H -l)" -s "$(ulimit -H -s)"

The adjustment to -n was probably not necessary.

kousu commented 2 years ago

Thank you @mndrix :)