Errors setting up a TZScan instance

I’m trying to run a local instance of tzscan:


But I’m not 100% sure about how to fix the following errors:

Error log:
Error:
[644.1] '/home/ubuntu/.opam/4.07.1/bin/ocamlc.opt' '-w' '+a-48-4-44' '-bin-annot' '-bin-annot' '-c' '-o' '_obuild/RULE-4d36efa3bf25463fa230ed8a3c0368b8/ezEncodingJS.cmo' '-I' './_obuild/ez-api-js' '-I' './libs/ez-api/libs/ez-api' '-I' './_obuild/ez-api-session-client' '-I' './_obuild/ocplib-utils-js' '-I' './libs/ocplib-jsutils/libs/ocplib-utils' '-I' '/home/ubuntu/.opam/4.07.1/lib/js_of_ocaml' '-I' '/home/ubuntu/.opam/4.07.1/lib/js_of_ocaml-tyxml' '-I' '/home/ubuntu/.opam/4.07.1/lib/tyxml' '-I' '/home/ubuntu/.opam/4.07.1/lib/tyxml/functor' '-I' '/home/ubuntu/.opam/4.07.1/lib/reactiveData' '-I' '/home/ubuntu/.opam/4.07.1/lib/react' '-I' './_obuild/ez-api' '-I' '/home/ubuntu/.opam/4.07.1/lib/ocaml/ocplib-lang' '-I' '/home/ubuntu/.opam/4.07.1/lib/ocaml/ocplib-debug' '-I' './_obuild/ocplib-json-typed' '-I' '.' '-I' '/home/ubuntu/.opam/4.07.1/lib/uri' '-I' '/home/ubuntu/.opam/4.07.1/lib/stringext' '-I' '/home/ubuntu/.opam/4.07.1/lib/re/posix' '-I' '/home/ubuntu/.opam/4.07.1/lib/re' '-I' '/home/ubuntu/.opam/4.07.1/lib/ocplib-endian' '-I' '/home/ubuntu/.opam/4.07.1/lib/ocaml/ocplib-compat' '-I' '/home/ubuntu/.opam/4.07.1/lib/lwt' '-I' '/home/ubuntu/.opam/4.07.1/lib/ezjsonm' '-I' '/home/ubuntu/.opam/4.07.1/lib/sexplib' '-I' '/home/ubuntu/.opam/4.07.1/lib/parsexp' '-I' '/home/ubuntu/.opam/4.07.1/lib/sexplib0' '-I' '/home/ubuntu/.opam/4.07.1/lib/base/caml' '-I' '/home/ubuntu/.opam/4.07.1/lib/jsonm' '-I' '/home/ubuntu/.opam/4.07.1/lib/uutf' '-I' '/home/ubuntu/.opam/4.07.1/lib/uchar' '-I' '/home/ubuntu/.opam/4.07.1/lib/hex' '-I' '/home/ubuntu/.opam/4.07.1/lib/cstruct' '-I' '/home/ubuntu/.opam/4.07.1/lib/ocaml' '-I' '/home/ubuntu/.opam/4.07.1/lib/bigarray-compat' '-I' '/home/ubuntu/.opam/4.07.1/lib/result' '-I' '/home/ubuntu/.opam/4.07.1/lib/seq' '-I' '/home/ubuntu/.opam/4.07.1/lib/bytes' '-impl' './_obuild/ez-api-js/_temp/ezEncodingJS.mlpp'

File "./libs/ez-api/libs/ez-api/ezEncodingJS.ml", line 80, characters 26-32:
Error: Unbound module Js

Error:
rule 644: target ./_obuild/ez-api-js/ezEncodingJS.cmo not built
Error:
[625.1] '/home/ubuntu/.opam/4.07.1/bin/ocamlc.opt' '-g' '-w' '+a-48-4-44' '-warn-error' '+a-44' '-bin-annot' '-c' '-o' '_obuild/RULE-88bd64b67a8ea974a9b17c9067ccadf4/base58Blockies.cmo' '-I' './_obuild/base58-blockies' '-I' './libs/base58-blockies' '-I' './_obuild/ocplib-utils-js' '-I' './libs/ocplib-jsutils/libs/ocplib-utils' '-I' '/home/ubuntu/.opam/4.07.1/lib/js_of_ocaml' '-I' '/home/ubuntu/.opam/4.07.1/lib/js_of_ocaml-tyxml' '-I' '/home/ubuntu/.opam/4.07.1/lib/tyxml' '-I' '/home/ubuntu/.opam/4.07.1/lib/tyxml/functor' '-I' '/home/ubuntu/.opam/4.07.1/lib/reactiveData' '-I' '/home/ubuntu/.opam/4.07.1/lib/react' '-I' '/home/ubuntu/.opam/4.07.1/lib/num' '-I' '/home/ubuntu/.opam/4.07.1/lib/ocaml' '-I' '/home/ubuntu/.opam/4.07.1/lib/re' '-I' '/home/ubuntu/.opam/4.07.1/lib/ocaml/ocplib-compat' '-I' '/home/ubuntu/.opam/4.07.1/lib/lwt' '-I' '/home/ubuntu/.opam/4.07.1/lib/uutf' '-I' '/home/ubuntu/.opam/4.07.1/lib/uchar' '-I' '/home/ubuntu/.opam/4.07.1/lib/result' '-I' '/home/ubuntu/.opam/4.07.1/lib/seq' '-I' '/home/ubuntu/.opam/4.07.1/lib/bytes' '-impl' './_obuild/base58-blockies/_temp/base58Blockies.mlpp'

File "./libs/base58-blockies/base58Blockies.ml", line 82, characters 7-32:
Error (warning 3): deprecated: module Tyxml_js
Will be removed past 2019-04-01. Use Js_of_ocaml_tyxml.Tyxml_js instead.

Error:
rule 625: target ./_obuild/base58-blockies/base58Blockies.cmi not built
Error:
rule 625: target ./_obuild/base58-blockies/base58Blockies.cmo not built
Makefile:44: recipe for target 'all' failed

Is there anyone that can help, or is there more info I need to post to be able to?

Thanks
— R

To me it looks like the versions of js_of_ocaml and js_of_ocaml-tyxml are too new, it is best if you install exactly the versions the authors were using to get it to build.

It looks like tzscan has fairly specific dependencies (cohttp=0.99.0 among other things). I’m not sure how the opam file is generated (I’m not familiar with ocp-autoconf), but the instructions should be modified to use opam 2’s local install opam install . and the constraints in the opam file fixed with opam-lock.

(cc @rjbou @altgr)

I was trying not to pin versions for js_of_ocaml but the last 2 releases give some warning on the module path uses. The current version is compatible with js_of_ocaml 3.3.0, I will try to patch it for js_of_ocaml 3.4.0. In the meantime you can pin js_of_ocaml, js_of_ocaml-tyxml and js_of_ocaml-lwt to 3.3.0

opam pin add js_of_ocaml 3.3.0 && opam pin add js_of_ocaml-tyxml 3.3.0 && opam pin add js_of_ocaml-lwt 3.3.0
1 Like

Thanks so much, this has helped me quite a bit further. The next error its giving is the following:

Camlp4: Uncaught exception: DynLoader.Error ("/home/ubuntu/.opam/4.07.1/lib/hex/hex.cma", "error while linking /home/ubuntu/.opam/4.07.1/lib/hex/hex.cma.\nReference to undefined global `Bigarray_compat'")

Does this also have to do with versioning?

Hm, this Hex problem looks like a transitive issue with how the camlp4 dependency is declared in TzScan. There is a dependency from Hex->Cstruct->Bigarray_compat now to deal with the changes upstream in recent OCaml’s to remove the hard Unix dependency, and this seems to have leaked through to the TzScan build system somehow.

You could try downgrading the version of Cstruct to fix this, but really the best way is probably for the TzScan upstream to lock the versions of packages it is using in order to get you a working executable. It’s not released to opam-repository for me to have a look at over there, unfortunately.

1 Like

Thanks @avsm. I managed to build. I had hex 1.4.0 installed, downgrading to 1.3.0 seemed to do the trick