stedolan / malfunction

Malfunctional Programming
Other
338 stars 19 forks source link

Error when compiling with latest OCaml compiler (4.04.0+flambda) #11

Closed timjs closed 7 years ago

timjs commented 7 years ago

Installing Malfunction with version 4.03.0+flambda works like a breeze. Doing the same using 4.04.0+flambda however results in this error:

#=== ERROR while installing malfunction.~unknown ==============================#
# opam-version 1.2.2
# os           darwin
# command      ocaml pkg/pkg.ml build --pinned true
# path         /Users/Tim/.opam/4.04.0+flambda/build/malfunction.~unknown
# compiler     4.04.0+flambda
# exit-code    1
# env-file     /Users/Tim/.opam/4.04.0+flambda/build/malfunction.~unknown/malfunction-57250-ad8886.env
# stdout-file  /Users/Tim/.opam/4.04.0+flambda/build/malfunction.~unknown/malfunction-57250-ad8886.out
# stderr-file  /Users/Tim/.opam/4.04.0+flambda/build/malfunction.~unknown/malfunction-57250-ad8886.err
### stdout ###
# [...]
# ocamlfind ocamlc -c -g -bin-annot -package unix -package str -package compiler-libs.optcomp -package zarith -package findlib -package dynlink -w @8 -I src -o src/malfunction_interpreter.cmi src/malfunction_interpreter.mli
# + ocamlfind ocamlc -c -g -bin-annot -package unix -package str -package compiler-libs.optcomp -package zarith -package findlib -package dynlink -w @8 -I src -o src/malfunction_interpreter.cmi src/malfunction_interpreter.mli
# findlib: [WARNING] Interface topdirs.cmi occurs in several directories: /Users/Tim/.opam/4.04.0+flambda/lib/ocaml/compiler-libs, /Users/Tim/.opam/4.04.0+flambda/lib/ocaml
# ocamlfind ocamlopt -c -g -bin-annot -package unix -package str -package compiler-libs.optcomp -package zarith -package findlib -package dynlink -w @8 -I src -o src/malfunction_compiler.cmx src/malfunction_compiler.ml
# + ocamlfind ocamlopt -c -g -bin-annot -package unix -package str -package compiler-libs.optcomp -package zarith -package findlib -package dynlink -w @8 -I src -o src/malfunction_compiler.cmx src/malfunction_compiler.ml
# findlib: [WARNING] Interface topdirs.cmi occurs in several directories: /Users/Tim/.opam/4.04.0+flambda/lib/ocaml/compiler-libs, /Users/Tim/.opam/4.04.0+flambda/lib/ocaml
# File "src/malfunction_compiler.ml", line 205, characters 27-41:
# Error: The constructor Lprim expects 3 argument(s),
#        but is applied here to 2 argument(s)
# Command exited with code 2.
### stderr ###
# pkg.ml: [ERROR] cmd ['ocamlbuild' '-use-ocamlfind' '-classic-display' '-tag' 'debug'
# [...]
#      'src/malfunction.cmxa' 'src/malfunction.cma'
#      'src/malfunction_interpreter.cmx' 'src/malfunction_interpreter.cmi'
#      'src/malfunction_interpreter.mli' 'src/malfunction_compiler.cmx'
#      'src/malfunction_compiler.cmi' 'src/malfunction_compiler.mli'
#      'src/malfunction_parser.cmx' 'src/malfunction_parser.cmi'
#      'src/malfunction_parser.mli' 'src/malfunction_sexp.cmx'
#      'src/malfunction_sexp.cmi' 'src/malfunction_sexp.mli'
#      'src/malfunction.cmx' 'src/malfunction.cmi' 'src/malfunction.mli'
#      'src/malfunction_main.native']: exited with 10

I'm not an OCaml user. Any idea what changed between 4.03 and 4.04? I'm on macOS 10.0.1.

stedolan commented 7 years ago

This is basically expected, but I'll get around to fixing it soon.

Malfunction relies on OCaml's internal APIs, which change in incompatible ways on every release. Indeed, one of the major motivations for malfunction is to provide a reasonably stable way of targeting those APIs. However, I haven't gotten around to updating it for 4.04 yet.

timjs commented 7 years ago

Thanks for the background info Stephen!


T.J. Steenvoorden, MSc

PhD Candidate | Radboud University Nijmegen Faculty of Science | Department of Software Science Mercator 1 Building | Room 01.08 Toernooiveld 212 | 6525 EC | Nijmegen | The Netherlands +31 24 365 22 91 | t.steenvoorden@cs.ru.nl

On 13 jan. 2017 09:39 +0100, Stephen Dolan notifications@github.com, wrote:

This is basically expected, but I'll get around to fixing it soon. Malfunction relies on OCaml's internal APIs, which change in incompatible ways on every release. Indeed, one of the major motivations for malfunction is to provide a reasonably stable way of targeting those APIs. However, I haven't gotten around to updating it for 4.04 yet. — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.