OCamlPro / ocp-indent

Indentation tool for OCaml, to be used from editors like Emacs and Vim.
http://www.typerex.org/ocp-indent.html
Other
200 stars 63 forks source link

error occurs when I install ocp-indent 1.4.2 via opam #149

Closed lijunsong closed 8 years ago

lijunsong commented 10 years ago

Here is the error message. I don't know whether I need to post this error to ocp-build?

~$ opam install ocp-indent
The following actions will be performed:
 - install ocp-build.1.99.8-beta [required by ocp-indent]
 - install ocp-indent.1.4.2
2 to install | 0 to reinstall | 0 to upgrade | 0 to downgrade | 0 to remove
Do you want to continue ? [Y/n] y

=-=-= Installing ocp-build.1.99.8-beta =-=-=
Building ocp-build.1.99.8-beta:
  ./configure --prefix /Users/ljs/.opam/system
  make
  make install
[ERROR] The compilation of ocp-build.1.99.8-beta failed.
Removing ocp-build.1.99.8-beta.
  rm -f /Users/ljs/.opam/system/bin/ocp-build
  rm -f /Users/ljs/.opam/system/bin/ocp-build.byte
  rm -f /Users/ljs/.opam/system/lib/META.ocp-build-bundle
  rm -rf /Users/ljs/.opam/system/lib/ocaml/typerex/ocp-build-bundle
  rm -f /Users/ljs/.opam/system/lib/META.ocp-build-win32
  rm -rf /Users/ljs/.opam/system/lib/ocaml/typerex/ocp-build-win32
  rm -f /Users/ljs/.opam/system/lib/META.ocp-build-misc
  rm -rf /Users/ljs/.opam/system/lib/ocaml/typerex/ocp-build-misc
  rm -f /Users/ljs/.opam/system/lib/META.ocp-build
  rm -rf /Users/ljs/.opam/system/lib/ocaml/typerex/ocp-build

[ERROR] Due to some errors while processing ocp-build.1.99.8-beta, the following actions will NOT proceed:
 - install ocp-indent.1.4.2

===== ERROR while installing ocp-build.1.99.8-beta =====
# opam-version 1.1.1
# os           darwin
# command      make
# path         /Users/ljs/.opam/system/build/ocp-build.1.99.8-beta
# compiler     system (4.01.0)
# exit-code    2
# env-file     /Users/ljs/.opam/system/build/ocp-build.1.99.8-beta/ocp-build-21021-ffb3fd.env
# stdout-file  /Users/ljs/.opam/system/build/ocp-build.1.99.8-beta/ocp-build-21021-ffb3fd.out
# stderr-file  /Users/ljs/.opam/system/build/ocp-build.1.99.8-beta/ocp-build-21021-ffb3fd.err
### stdout ###
# ...[truncated]
#
# Executables will be installed in /Users/ljs/.opam/system/bin
# Libraries will be installed in /Users/ljs/.opam/system/lib/ocaml/typerex
# Data files will be installed in /Users/ljs/.opam/system/share/typerex
# Manual pages will be installed in /Users/ljs/.opam/system/share/man
# Creating root directory _obuild/
# /Applications/Xcode.app/Contents/Developer/usr/bin/make -C boot
# awk '{ print "external "$1": unit -> unit = \"" $1 "\"" }' primitives > primitives.ml
# ./make-ocpbuild-run.sh
# ocamlc -o ocp-build.run -custom -make-runtime win32_c.c primitives.ml unix.cma -cclib -lunix
### stderr ###
# config.status: WARNING:  '../src/ocp-build-bundle.ocp.in' seems to ignore the --datarootdir setting
# clang: error: unknown argument: '-fno-defer-pop' [-Wunused-command-line-argument-hard-error-in-future]
# clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
# make[1]: *** [ocp-build] Error 2
# make: *** [boot/ocp-build] Error 2
sheijk commented 9 years ago

Seeing similar issues. For me ocp-build (1.99.8-beta) builds on OS X 10.9.4 and OCaml 4.02.0 but ocp-index 1.4.2 fails. There are some warnings about mutating functions in String that are now deprecated. Unfortunately warnings as errors is turned on so this causes the build to fail.

File "src/approx_lexer.mll", line 110, characters 28-41: Warning 3: deprecated: String.create File "src/approx_lexer.mll", line 120, characters 19-32: Warning 3: deprecated: String.create File "src/approx_lexer.mll", line 124, characters 2-19: Warning 3: deprecated: String.unsafe_set File "src/approx_lexer.mll", line 223, characters 15-27: Warning 3: deprecated: String.set File "_obuild/ocp-indent.lexer/temp/approx_lexer.ml", line 1: Error: Some fatal warnings were triggered (4 occurrences)

This can be fixed by passing -warn-error A-3 to ocamlopt/ocamlc. Also please consider not to use warnings as errors in deployment builds (for development the option is fine) as this is likely to cause breakages with every new compiler version.

lijunsong commented 9 years ago

After I switched to 4.02.0, the error was gone...

sheijk commented 9 years ago

Just tried again with opam update but I'm still seeing the same issue, unfortunately.

hhugo commented 9 years ago

@lijunsong, ocaml 4.01 does not work out of the box in recent versions of OSX. There is now a patch in homebrew and opam to fix this. You could just reinstall ocaml.4.01 to fix the issue. (see https://github.com/ocaml/opam/issues/1236)

@sheijk ocp-indent master + ocaml 4.02 builds fine with OSX

lefessan commented 8 years ago

Seems to be fixed.