jaredly / ohai

easy setup from ocaml/reason native projects
96 stars 8 forks source link

Installation issues #8

Open martinklepsch opened 6 years ago

martinklepsch commented 6 years ago

Hey Jared, thanks for this project, been wanting to try Reason/OCaml for native stuff for a while but always got kind of stuck on setting up the necessary tooling. :)

I'm getting an error during installation of ohai now. I'll try to figure out what's going on but just logging this for reference:

opam pin add ohai git+https://github.com/jaredly/ohai
[NOTE] Package ohai is already git-pinned to https://github.com/jaredly/ohai.
       This will erase any previous custom definition.
Proceed ? [Y/n] Y

[ohai] https://github.com/jaredly/ohai updated
[ohai] Installing new package description from https://github.com/jaredly/ohai

ohai needs to be installed.
The following actions will be performed:
  ∗  install cppo                    1.4.1     [required by containers]
  ∗  install menhir                  20170101  [required by reason-parser]
  ∗  install ocaml-migrate-parsetree 0.7       [required by reason]
  ∗  install topkg                   0.8.1     [required by reason]
  ∗  install merlin-extend           0.3       [required by reason]
  ∗  install lwt                     2.7.1     [required by utop]
       For module Lwt_react, please install package lwt_react
  ∗  install containers              1.1       [required by ohai]
  ∗  install camomile                0.8.5     [required by zed]
  ∗  install ppx_tools_versioned     5.0alpha  [required by reason-parser]
  ∗  install zed                     1.4       [required by lambda-term]
  ∗  install reason-parser           1.13.2    [required by reason]
  ∗  install lambda-term             1.10.1    [required by utop]
  ∗  install utop                    1.19.3    [required by reason]
  ∗  install reason                  1.13.3    [required by ohai]
  ∗  install ohai                    1.0.0*
===== ∗  15 =====
Do you want to continue ? [Y/n] Y

=-=- Gathering sources =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=  🐫
[camomile] Archive in cache
[containers] Archive in cache
[cppo] Archive in cache
[lambda-term] Archive in cache
[lwt] Archive in cache
[menhir] Archive in cache
[merlin-extend] Archive in cache
[ocaml-migrate-parsetree] Archive in cache
[ppx_tools_versioned] Archive in cache
[reason] Archive in cache
[reason-parser] Archive in cache
[topkg] Archive in cache
[utop] Archive in cache
[zed] Archive in cache
[ohai] https://github.com/jaredly/ohai already up-to-date

=-=- Processing actions -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=  🐫
[ERROR] The compilation of ocaml-migrate-parsetree failed at "jbuilder build --only-packages ocaml-migrate-parsetree --root . -j 4 @install".
[ERROR] The compilation of menhir failed at "make -f Makefile PREFIX=/Users/martin/.opam/4.04.0 USE_OCAMLFIND=true docdir=/Users/martin/.opam/4.04.0/doc/menhir
        libdir=/Users/martin/.opam/4.04.0/lib/menhir mandir=/Users/martin/.opam/4.04.0/man/man1".
[ERROR] The compilation of topkg failed at "ocaml pkg/pkg.ml build --pkg-name topkg --pinned false".
[ERROR] The compilation of cppo failed at "make ocamlbuild".
Processing  5/15: [cppo: ocamlfind remove]
#=== ERROR while installing cppo.1.4.1 ========================================#
# opam-version 1.2.2
# os           darwin
# command      make ocamlbuild
# path         /Users/martin/.opam/4.04.0/build/cppo.1.4.1
# compiler     4.04.0
# exit-code    2
# env-file     /Users/martin/.opam/4.04.0/build/cppo.1.4.1/cppo-14530-487c34.env
# stdout-file  /Users/martin/.opam/4.04.0/build/cppo.1.4.1/cppo-14530-487c34.out
# stderr-file  /Users/martin/.opam/4.04.0/build/cppo.1.4.1/cppo-14530-487c34.err
### stdout ###
# cd ocamlbuild_plugin && ocamlbuild -use-ocamlfind ocamlbuild_cppo.cma ocamlbuild_cppo.cmxa ocamlbuild_cppo.a ocamlbuild_cppo.cmxs
# ocamlfind ocamldep -package ocamlbuild -modules ocamlbuild_cppo.mli > ocamlbuild_cppo.mli.depends
# + ocamlfind ocamldep -package ocamlbuild -modules ocamlbuild_cppo.mli > ocamlbuild_cppo.mli.depends
# ocamlfind: Package `ocamlbuild' not found
# Command exited with code 2.
### stderr ###
# make: *** [ocamlbuild] Error 10

#=== ERROR while installing menhir.20170101 ===================================#
# opam-version 1.2.2
# os           darwin
# command      make -f Makefile PREFIX=/Users/martin/.opam/4.04.0 USE_OCAMLFIND=true docdir=/Users/martin/.opam/4.04.0/doc/menhir libdir=/Users/martin/.opam/4.04.0/lib/menhir mandir=/Users/martin/.opam/4.04.0/man/man1
# path         /Users/martin/.opam/4.04.0/build/menhir.20170101
# compiler     4.04.0
# exit-code    2
# env-file     /Users/martin/.opam/4.04.0/build/menhir.20170101/menhir-14530-48c407.env
# stdout-file  /Users/martin/.opam/4.04.0/build/menhir.20170101/menhir-14530-48c407.out
# stderr-file  /Users/martin/.opam/4.04.0/build/menhir.20170101/menhir-14530-48c407.err
### stdout ###
# ocamlbuild -classic-display -j 0 -cflags "-safe-string -bin-annot" menhirLib.cmo menhirLib.cmx
# ocamlopt.opt unix.cmxa -I /usr/local/Cellar/ocamlbuild/0.11.0_3/lib/ocamlbuild /usr/local/Cellar/ocamlbuild/0.11.0_3/lib/ocamlbuild/ocamlbuildlib.cmxa myocamlbuild.ml /usr/local/Cellar/ocamlbuild/0.11.0_3/lib/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
# + ocamlopt.opt unix.cmxa -I /usr/local/Cellar/ocamlbuild/0.11.0_3/lib/ocamlbuild /usr/local/Cellar/ocamlbuild/0.11.0_3/lib/ocamlbuild/ocamlbuildlib.cmxa myocamlbuild.ml /usr/local/Cellar/ocamlbuild/0.11.0_3/lib/ocamlbuild/ocamlbuild.cmx -o myocamlbuild
# File "myocamlbuild.ml", line 1:
# Error: /usr/local/Cellar/ocamlbuild/0.11.0_3/lib/ocamlbuild/ocamlbuild_plugin.cmi
# is not a compiled interface for this version of OCaml.
# It seems to be for a newer version of OCaml.
# Command exited with code 2.
### stderr ###
# make[1]: *** [library] Error 10
# make: *** [all] Error 2

#=== ERROR while installing ocaml-migrate-parsetree.0.7 =======================#
# opam-version 1.2.2
# os           darwin
# command      jbuilder build --only-packages ocaml-migrate-parsetree --root . -j 4 @install
# path         /Users/martin/.opam/4.04.0/build/ocaml-migrate-parsetree.0.7
# compiler     4.04.0
# exit-code    127
# env-file     /Users/martin/.opam/4.04.0/build/ocaml-migrate-parsetree.0.7/ocaml-migrate-parsetree-14530-0c525f.env
# stdout-file  /Users/martin/.opam/4.04.0/build/ocaml-migrate-parsetree.0.7/ocaml-migrate-parsetree-14530-0c525f.out
# stderr-file  /Users/martin/.opam/4.04.0/build/ocaml-migrate-parsetree.0.7/ocaml-migrate-parsetree-14530-0c525f.err

#=== ERROR while installing topkg.0.8.1 =======================================#
# opam-version 1.2.2
# os           darwin
# command      ocaml pkg/pkg.ml build --pkg-name topkg --pinned false
# path         /Users/martin/.opam/4.04.0/build/topkg.0.8.1
# compiler     4.04.0
# exit-code    2
# env-file     /Users/martin/.opam/4.04.0/build/topkg.0.8.1/topkg-14530-8c0dd3.env
# stdout-file  /Users/martin/.opam/4.04.0/build/topkg.0.8.1/topkg-14530-8c0dd3.out
# stderr-file  /Users/martin/.opam/4.04.0/build/topkg.0.8.1/topkg-14530-8c0dd3.err
### stdout ###
# [...]
# File "src/topkg_publish.ml", line 7, characters 5-17:
# Error: Unbound module Topkg_result
# File "src/topkg_pkg.ml", line 7, characters 5-17:
# Error: Unbound module Topkg_result
# File "src/topkg_ipc.ml", line 7, characters 5-17:
# Error: Unbound module Topkg_result
# File "src/topkg_main.ml", line 7, characters 5-17:
# Error: Unbound module Topkg_result
# File "src/topkg.ml", line 9, characters 8-20:
# Error: Unbound module Topkg_result
### stderr ###
# File "./pkg/pkg.ml", line 29, characters 5-10:
# Error: Unbound module Topkg

=-=- Error report -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=  🐫
The following actions were aborted
  ∗  install camomile            0.8.5
  ∗  install containers          1.1
  ∗  install lambda-term         1.10.1
  ∗  install lwt                 2.7.1
  ∗  install merlin-extend       0.3
  ∗  install ohai                1.0.0
  ∗  install ppx_tools_versioned 5.0alpha
  ∗  install reason              1.13.3
  ∗  install reason-parser       1.13.2
  ∗  install utop                1.19.3
  ∗  install zed                 1.4
The following actions failed
  ∗  install cppo                    1.4.1
  ∗  install menhir                  20170101
  ∗  install ocaml-migrate-parsetree 0.7
  ∗  install topkg                   0.8.1
No changes have been performed
[NOTE] Pinning command successful, but your installed packages may be out of sync.
rymdhund commented 6 years ago

I got similar errors when I forgot to do a eval $(opam config env) after opam switch. Did you remember to call it?

martinklepsch commented 6 years ago

@rymdhund thanks for your suggestion, I in fact had some major misconfiguration going on which basically broke everthing OCaml related (I was shadowing install with a script of my own 😅 — tbh I'm surprised anything worked in retrospect)

But now I'm on other trouble, it seems I can't build ohai locally:

~/c/02-oss g clone git@github.com:jaredly/ohai.git
Cloning into 'ohai'...
remote: Counting objects: 135, done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 135 (delta 2), reused 0 (delta 0), pack-reused 129
Receiving objects: 100% (135/135), 23.41 KiB | 1.95 MiB/s, done.
Resolving deltas: 100% (67/67), done.

~/c/02-oss cd ohai/

~/c/0/ohai (master=) jbuilder build -p ohai -j 4
       refmt bin/ohai.re.ml
    ocamldep bin/ohai.depends.ocamldep-output
       refmt lib/Args.re.ml (exit 1)
(cd _build/default && /Users/martin/.opam/4.04.0/bin/refmt --print binary lib/Args.re) > _build/default/lib/Args.re.ml
File "lib/Args.re", line 9, characters 17-23:
Error: 262: syntax error, consider adding a `;' before
       refmt lib/Info.re.ml (exit 1)
(cd _build/default && /Users/martin/.opam/4.04.0/bin/refmt --print binary lib/Info.re) > _build/default/lib/Info.re.ml
File "lib/Info.re", line 20, characters 20-26:
Error: 262: syntax error, consider adding a `;' before
       refmt lib/Files.re.ml (exit 1)
(cd _build/default && /Users/martin/.opam/4.04.0/bin/refmt --print binary lib/Files.re) > _build/default/lib/Files.re.ml
File "lib/Files.re", line 7, characters 14-18:
Error: 1458: <UNKNOWN SYNTAX ERROR>
rymdhund commented 6 years ago

This is probably since the project is written in the old reason syntax and you're trying to compile it using reason 3.