savonet / liquidsoap

Liquidsoap is a statically typed scripting general-purpose language with dedicated operators and backend for all thing media, streaming, file generation, automation, HTTP backend and more.
http://liquidsoap.info
GNU General Public License v2.0
1.42k stars 130 forks source link

Menhir: build issues with version 20211125 and OCaml 4.08 to 4.10 #2083

Closed TheRealMattLear closed 2 years ago

TheRealMattLear commented 2 years ago

Describe the bug New opam installation of liquidsoap either version 1.4.4 or 2.0.0 we are seeing the folling error on both CentOS 7.9 and Debian 11.

OCAMLOPT -c lang/evaluation.ml
OCAMLOPT -c lang/lang_encoders.ml
OCAMLOPT -c lang_encoders/lang_avi.ml
OCAMLOPT -c lang_encoders/lang_external_encoder.ml
OCAMLOPT -c lang_encoders/lang_fdkaac.ml
OCAMLOPT -c lang_encoders/lang_ffmpeg.ml
OCAMLOPT -c lang_encoders/lang_flac.ml
OCAMLOPT -c lang_encoders/lang_gstreamer.ml
OCAMLOPT -c lang_encoders/lang_mp3.ml
OCAMLOPT -c lang_encoders/lang_opus.ml
OCAMLOPT -c lang_encoders/lang_shine.ml
OCAMLOPT -c lang_encoders/lang_speex.ml
OCAMLOPT -c lang_encoders/lang_theora.ml
OCAMLOPT -c lang_encoders/lang_vorbis.ml
OCAMLOPT -c lang_encoders/lang_wav.ml
OCAMLOPT -c lang/parser_helper.ml
OCAMLOPT -c lang/parser.mli
OCAMLOPT -c lang/parser.ml
File "lang/parser.ml", line 400, characters 2-18108:
400 | ..fun _menhir_env _menhir_stack _menhir_s _v ->
401 |     match _menhir_s with
402 |     | MenhirState389 | MenhirState305 | MenhirState201 ->
403 |         let (_menhir_env : _menhir_env) = _menhir_env in
404 |         let (_menhir_stack : ('freshtv1767 * Lexing.position * _menhir_state * (
...
648 |         | _ ->
649 |             _menhir_fail ()) : 'freshtv1794) : 'freshtv1796)) : 'freshtv1798)
650 |     | _ ->
651 |         _menhir_fail ()
Error: This definition has type
         'ttv_tail.
           _menhir_env ->
           'ttv_tail -> _menhir_state -> string list -> 'freshtv1768
       which is less general than
         'ttv_tail 'ttv_return.
           _menhir_env ->
           'ttv_tail -> _menhir_state -> string list -> 'ttv_return
make[2]: *** [../Makefile.rules:122: lang/parser.cmx] Error 2
make[2]: Leaving directory '/usr/local/mediacp/.opam/4.08.1/.opam-switch/build/liquidsoap.2.0.0/src'
make[1]: *** [../Makefile.rules:69: all-auto-ocaml-prog] Error 2
make[1]: Leaving directory '/usr/local/mediacp/.opam/4.08.1/.opam-switch/build/liquidsoap.2.0.0/src'
make: *** [Makefile.rules:29: all-subdirs] Error 2

To Reproduce

opam init --bare -a -y;
opam switch create 4.08.1;
opam pin -y -n liquidsoap 1.4.4;
opam install -y faad fdkaac flac theora vorbis taglib mad lame cry samplerate liquidsoap;

Just in case, i've verified depext requirements check out also:

mediacp@radio:~$ opam depext liquidsoap
Opam plugin "depext" is not installed. Install it on the current switch? [Y/n] y

The following actions will be performed:
  ∗ install opam-depext 1.2.0

<><> Gathering sources ><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
[opam-depext.1.2.0] downloaded from cache at https://opam.ocaml.org/cache

<><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><>
∗ installed opam-depext.1.2.0
Done.
# Run eval $(opam env) to update the current shell environment

<><> Carrying on to "opam depext liquidsoap" ><><><><><><><><><><><><><><><><><>

# Detecting depexts using vars: arch=x86_64, os=linux, os-distribution=debian, os-family=debian
# The following system packages are needed:
autoconf
automake
debianutils
libpcre3-dev
pkg-config
# All required OS packages found.
toots commented 2 years ago

Hi,

This is a weird issue I believe with the menhir package. Untikl it is fixed with opam, I recommend to upgrade your OCaml version to 4.11 or above.

Here's another example of the build error with 2.0.0~rc1: https://opam.ci.ocaml.org/github/ocaml/opam-repository/commit/f4440b1f540e2bcb30bb8ab415d7acf31c4dea06/variant/opam-2.0,compilers,4.08,liquidsoap.2.0.0~rc1

Here's a case where it does not fail: https://opam.ci.ocaml.org/github/ocaml/opam-repository/commit/f4440b1f540e2bcb30bb8ab415d7acf31c4dea06/variant/opam-2.0,compilers,4.08,liquidsoap.2.0.0

I can't see a difference in deps and/or code between the two, though..

Assigning this error to opam at least. May need to be brought up to the menhir developers.