frenetic-lang / frenetic

The Frenetic Programming Language and Runtime System
http://www.frenetic-lang.org/
Other
223 stars 51 forks source link

Can't install via OPAM #562

Closed jrmcclurg closed 7 years ago

jrmcclurg commented 7 years ago

I checked out the latest master branch, and I'm trying to do the following: opam pin add -k git -y frenetic .

This causes many packages to be installed, and the final one ("frenetic") fails with the following error:

[ERROR] The compilation of frenetic failed at "make".
Processing 109/109: [frenetic: ocamlfind remove]
#=== ERROR while installing frenetic.4.0.0 ====================================#
# opam-version 1.2.2
# os           linux
# command      make
# path         /home/synth/.opam/4.03.0/build/frenetic.4.0.0
# compiler     4.03.0
# exit-code    2
# env-file     /home/synth/.opam/4.03.0/build/frenetic.4.0.0/frenetic-14340-18defa.env
# stdout-file  /home/synth/.opam/4.03.0/build/frenetic.4.0.0/frenetic-14340-18defa.out
# stderr-file  /home/synth/.opam/4.03.0/build/frenetic.4.0.0/frenetic-14340-18defa.err
### stdout ###
# [...]
# /home/synth/.opam/4.03.0/bin/ocamlfind ocamldep -package yojson -package threads -package tcpip -package str -package sedlex -package ppx_import -package ocamlgraph -package menhirLib -package ipaddr -package cstruct.ppx -package cstruct -package core -package compiler-libs.common -package base64 -package ppx_deriving,ppx_deriving.eq,ppx_deriving.enum,ppx_deriving.show,ppx_jane -modules lib/Frenetic_Hashcons.ml > lib/Frenetic_Hashcons.ml.depends
# /home/synth/.opam/4.03.0/bin/ocamlfind ocamldep -package yojson -package threads -package tcpip -package str -package sedlex -package ppx_import -package ocamlgraph -package menhirLib -package ipaddr -package cstruct.ppx -package cstruct -package core -package compiler-libs.common -package base64 -package ppx_deriving,ppx_deriving.eq,ppx_deriving.enum,ppx_deriving.show,ppx_jane -modules lib/Frenetic_Bits.mli > lib/Frenetic_Bits.mli.depends
# /home/synth/.opam/4.03.0/bin/ocamlfind ocamlc -c -w @5+8@11@12-40 -short-paths -g -annot -bin-annot -thread -thread -package yojson -package threads -package tcpip -package str -package sedlex -package ppx_import -package ocamlgraph -package menhirLib -package ipaddr -package cstruct.ppx -package cstruct -package core -package compiler-libs.common -package base64 -package ppx_deriving,ppx_deriving.eq,ppx_deriving.enum,ppx_deriving.show,ppx_jane -I lib -o lib/Frenetic_Bits.cmi lib/Frenetic_Bits.mli
# /home/synth/.opam/4.03.0/bin/ocamlfind ocamldep -package yojson -package threads -package tcpip -package str -package sedlex -package ppx_import -package ocamlgraph -package menhirLib -package ipaddr -package cstruct.ppx -package cstruct -package core -package compiler-libs.common -package base64 -package ppx_deriving,ppx_deriving.eq,ppx_deriving.enum,ppx_deriving.show,ppx_jane -modules lib/Frenetic_Bits.ml > lib/Frenetic_Bits.ml.depends
# /home/synth/.opam/4.03.0/bin/ocamlfind ocamldep -package yojson -package threads -package tcpip -package str -package sedlex -package ppx_import -package ocamlgraph -package menhirLib -package ipaddr -package cstruct.ppx -package cstruct -package core -package compiler-libs.common -package base64 -package ppx_deriving,ppx_deriving.eq,ppx_deriving.enum,ppx_deriving.show,ppx_jane -modules lib/Frenetic_Fdd.mli > lib/Frenetic_Fdd.mli.depends
# + /home/synth/.opam/4.03.0/bin/ocamlfind ocamldep -package yojson -package threads -package tcpip -package str -package sedlex -package ppx_import -package ocamlgraph -package menhirLib -package ipaddr -package cstruct.ppx -package cstruct -package core -package compiler-libs.common -package base64 -package ppx_deriving,ppx_deriving.eq,ppx_deriving.enum,ppx_deriving.show,ppx_jane -modules lib/Frenetic_Fdd.mli > lib/Frenetic_Fdd.mli.depends
# File "lib/Frenetic_Fdd.mli", line 56, characters 16-20:
# Cannot locate deriver sexp
# Command exited with code 2.
# Makefile:16: recipe for target 'build' failed
### stderr ###
# E: Failure("Command ''/home/synth/.opam/4.03.0/bin/ocamlbuild' lib/frenetic.cma lib/frenetic.cmxa lib/frenetic.a lib/frenetic.cmxs ppx/ppx.cma ppx/ppx.cmxa ppx/ppx.a ppx/ppx.cmxs ppx/ppx.native async/async.cma async/async.cmxa async/async.a async/async.cmxs frenetic/frenetic.native frenetic/openflow.native bench/src/Main.native -use-ocamlfind -package ppx_deriving,ppx_deriving.eq,ppx_deriving.enum,ppx_deriving.show,ppx_jane -use-menhir -cflags -w,@5+8@11@12-40,-short-paths -tag debug -j 4' terminated with error code 10")
# make: *** [build] Error 1

Am I doing something wrong? Any ideas what I can do to resolve this?

smolkaj commented 7 years ago

Hi Jed, Jane street recently updated their libraries, so a bunch of things broke. @jnfoster fixed things on the jnf-fixes branch, but hasn't merged the fixed into master yet.

So here is what should work for the time being:

opam update
opam switch 4.04.1     # get newest OCaml
git checkout jnf-fixes
# now install frenetic
jrmcclurg commented 7 years ago

Hi Steffen, thanks, this helps! Although I still can't quite get it to work - when I do...

opam update
opam switch 4.04.1
git checkout jnf-fixes
opam pin add -k git -y frenetic .

... I immediately get the following error:

The following dependencies couldn't be met:
  - frenetic -> sexplib < 113.01.00
Your request can't be satisfied:
  - sexplib<113.01.00 is not available because your system doesn't comply with ocaml-version >= "4.02.1" & ocaml-version < "4.03".

Strangely, when I try the same steps on my other (basically identical) machine, I get a different error:

Your request can't be satisfied:
  - frenetic.3.4.1 is not available because the package is pinned to /home/jrmcclurg/git/frenetic, version 3.4.1.

If I switch to OCaml 4.02.3, then all the prerequisite packages are installed, and then the final step ("frenetic") fails with a dependency on OCaml >= 4.04.

smolkaj commented 7 years ago

Your error looks like either you have some stale files or your environment variables are not set correctly. Try again:

opam update
opam switch 4.04.1
eval `opam config env` # make sure environment variables are set correctly
git pull && git checkout jnf-fixes
make clean && make

(Ocaml 4.02.3 definitely won't work, we rely on ppx, which is a relatively recent feature)

jrmcclurg commented 7 years ago

I tried this and still get the first error I mentioned, when I run the opam pin command (make doesn't seem to work at all for me - I just get a huge list of errors regarding missing dependencies such as core etc.). Maybe there is some other key step in the installation that I'm missing...

For now, I can make the master branch work by doing:

git pull && git checkout master
opam pin add -y lwt 2.6.0
opam pin add -y cstruct 2.3.1
opam pin add -y async 113.33.00
opam pin add -k git -y frenetic .

This is a bit ugly, but should work for me, so I'm closing the Issue. Thanks for your help Steffen!

smolkaj commented 7 years ago

This is very strange, but I'm glad you got it to work. My last guess is that maybe your opam is not up to date.