Kappa-Dev/KappaTools

Error while compiling kappa-library: unerasable-optional-arguments

Closed this issue · 5 comments

Command:

opam pin add kappa-library git+https://github.com/Kappa-Dev/KappaTools.git

Error reported:

[ERROR] The compilation of kappa-library.4.1~dev failed at "dune build -p kappa-library -j 4".

#=== ERROR while compiling kappa-library.4.1~dev ==============================#
# context     2.1.0 | linux/x86_64 | base-unix.base | pinned(git+https://github.com/Kappa-Dev/KappaTools.git#341232f5)
# path        ~/.opam/system/.opam-switch/build/kappa-library.4.1~dev
# command     ~/.opam/system/bin/dune build -p kappa-library -j 4
# exit-code   1
# env-file    ~/.opam/log/kappa-library-23053-8bdec5.env
# output-file ~/.opam/log/kappa-library-23053-8bdec5.out
### output ###
# [...]
# File "core/simulation/counter.ml", line 243, characters 37-45:
# 243 | let create ?(init_t=0.) ?(init_e=0) ?max_time ?max_event ~plot_period ~nb_rules =
#                                            ^^^^^^^^
# Error (warning 16 [unerasable-optional-argument]): this optional argument cannot be erased.
# File "core/simulation/counter.ml", line 243, characters 26-34:
# 243 | let create ?(init_t=0.) ?(init_e=0) ?max_time ?max_event ~plot_period ~nb_rules =
#                                 ^^^^^^^^
# Error (warning 16 [unerasable-optional-argument]): this optional argument cannot be erased.
# File "core/simulation/counter.ml", line 243, characters 13-22:
# 243 | let create ?(init_t=0.) ?(init_e=0) ?max_time ?max_event ~plot_period ~nb_rules =
#                    ^^^^^^^^^
# Error (warning 16 [unerasable-optional-argument]): this optional argument cannot be erased.

OCaml 4.12.0
OPAM 2.1.0

feret commented

As far as I understand, in some version of OCaml/Ocaml compilers, it is not allowed to have only labelled arguments in a function. Thus I added a new, void, one to this function.
I was not able to reproduce the issue on my setting, thus I cannot test.
Let me know, it is worked.

Thanks Jerome! That fixed the first command, and I got the library to compile. But now the binaries fail with a similar error.

$ opam pin add kappa-binaries git+https://github.com/Kappa-Dev/KappaTools.git
[kappa-binaries.4.1.0] synchronised (git+https://github.com/Kappa-Dev/KappaTools.git)
kappa-binaries is now pinned to git+https://github.com/Kappa-Dev/KappaTools.git (version 4.1~dev)

The following actions will be performed:
  ∗ install kappa-binaries 4.1~dev*
Do you want to continue? [Y/n] y

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[ERROR] The compilation of kappa-binaries.4.1~dev failed at "dune build -p kappa-binaries -j 4".

#=== ERROR while compiling kappa-binaries.4.1~dev =============================#
# context     2.1.0 | linux/x86_64 | base-unix.base | pinned(git+https://github.com/Kappa-Dev/KappaTools.git#3a0a22c3)
# path        ~/.opam/system/.opam-switch/build/kappa-binaries.4.1~dev
# command     ~/.opam/system/bin/dune build -p kappa-binaries -j 4
# exit-code   1
# env-file    ~/.opam/log/kappa-binaries-14163-e3a8fc.env
# output-file ~/.opam/log/kappa-binaries-14163-e3a8fc.out
### output ###
#     ocamlopt core/KaSa_rep/type_interface/.kappa_kasa_type_interface.objs/native/kappa_kasa_type_interface__Public_data.{cmx,o} (exit 2)
# (cd _build/default && /home/hfm5/.opam/system/bin/ocamlopt.opt -w -40 -w @a -open Kappa_generic_toolset -open Kappa_mixtures -g -I core/KaSa_rep/type_interface/.kappa_kasa_type_interface.objs/byte -I core/KaSa_rep/type_interface/.kappa_kasa_type_interface.objs/native -I /home/hfm5/.opam/system/lib/biniou -I /home/hfm5/.opam/system/lib/easy-format -I /home/hfm5/.opam/system/lib/kappa-library/g[...]
# File "core/KaSa_rep/type_interface/public_data.ml", line 1052, characters 26-49:
# 1052 |     ?binding_type_symbol:(binding_type_symbol=".")
#                                  ^^^^^^^^^^^^^^^^^^^^^^^
# Error (warning 16 [unerasable-optional-argument]): this optional argument cannot be erased.



<><> Error report <><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
┌─ The following actions failed
│ λ build kappa-binaries 4.1~dev
└─
╶─ No changes have been performed
[NOTE] Pinning command successful, but your installed packages may be out of sync.
feret commented

This one should be fixed as well.
It was the same issue on a different function.
Let me know if there are other ones.

feret commented

Is it OK now, or do you still get some compilation errors ?

Hi Jerome, it's working now, and the executable behaves as expected. Thanks!