mirage / mirage-www

Website infrastructure and content for mirage.io
https://mirage.io
ISC License
171 stars 106 forks source link

Site build error locally #310

Closed amirmc closed 9 years ago

amirmc commented 9 years ago

Ok, what am I doing wrong now?

$ make
ocamlbuild -use-ocamlfind -pkgs lwt.syntax,conduit.mirage,cow.syntax,cowabloga,cstruct,io-page,io-page.unix,lwt,mirage-clock-unix,mirage-console.unix,mirage-fs-unix,mirage-http,mirage-net-unix,mirage-types,mirage-types.lwt,mirage.runtime,tcpip.stack-direct -tags "syntax(camlp4o),annot,bin_annot,strict_sequence,principal" -tag-line "<static*.*>: -syntax(camlp4o)" -cflag -g -lflags -g,-linkpkg main.native
+ ocamlfind ocamldep -package tcpip.stack-direct -package mirage.runtime -package mirage-types.lwt -package mirage-types -package mirage-net-unix -package mirage-http -package mirage-fs-unix -package mirage-console.unix -package mirage-clock-unix -package lwt -package io-page.unix -package io-page -package cstruct -package cowabloga -package cow.syntax -package conduit.mirage -package lwt.syntax -syntax camlp4o -modules main.ml > main.ml.depends
Fatal error: cannot load shared library dllunix
Reason: dlopen(/usr/local/lib/ocaml/stublibs/dllunix.so, 138): Symbol not found: _caml_strdup
  Referenced from: /usr/local/lib/ocaml/stublibs/dllunix.so
  Expected in: flat namespace
 in /usr/local/lib/ocaml/stublibs/dllunix.so
Preprocessing error on file main.ml
Error while running external preprocessor
Command line: camlp4 '-I' '/Users/amir/.opam/mirage-401/lib/ocaml/camlp4' '-I' '/Users/amir/.opam/mirage-401/lib/ocaml' '-I' '/Users/amir/.opam/mirage-401/lib/type_conv' '-I' '/Users/amir/.opam/mirage-401/lib/dyntype' '-I' '/Users/amir/.opam/mirage-401/lib/xmlm' '-I' '/Users/amir/.opam/mirage-401/lib/uutf' '-I' '/Users/amir/.opam/mirage-401/lib/jsonm' '-I' '/Users/amir/.opam/mirage-401/lib/hex' '-I' '/Users/amir/.opam/mirage-401/lib/ocaml' '-I' '/Users/amir/.opam/mirage-401/lib/ocaml' '-I' '/Users/amir/.opam/mirage-401/lib/sexplib' '-I' '/Users/amir/.opam/mirage-401/lib/ezjsonm' '-I' '/Users/amir/.opam/mirage-401/lib/cow' '-I' '/Users/amir/.opam/mirage-401/lib/lwt' '-I' '/Users/amir/.opam/mirage-401/lib/lwt' '-parser' 'o' '-parser' 'op' '-printer' 'p' 'str.cma' 'pa_type_conv.cma' 'pa_dyntype.cma' 'xmlm.cma' 'uutf.cma' 'jsonm.cma' 'hex.cma' 'unix.cma' 'bigarray.cma' 'sexplib.cma' 'ezjsonm.cma' 'xmlm.cma' 'str.cma' 'pa_cow.cma' 'ezjsonm.cma' 'lwt-syntax-options.cma' 'lwt-syntax.cma'  'main.ml' > /var/folders/gd/bdnlf1ld21g4ynlctmqgml5h0000gn/T/ocamlppc9362c

Command exited with code 2.
Compilation unsuccessful after building 1 target (0 cached) in 00:00:00.
make: *** [main.native] Error 10

# OPAM status report
# opam-version    1.2.0
# self-upgrade    no
# os              darwin
# external-solver no
# criteria        -removed,-notuptodate,-changed*
# jobs            4
# repositories    1* (http)
# pinned          0
# current-switch  mirage-401
# last-update     2015-04-20 16:16
amirmc commented 9 years ago

I've just realised I haven't done brew update in a while. I'm running that and will update to opam 1.2.1 and maybe this issue will go away.

amirmc commented 9 years ago

That didn't help. I found my way to this, which indicates that this might be related to homebrew.

samoht commented 9 years ago
/Users/amir/.opam/mirage-401/lib/ocaml/camlp4
/usr/local/lib/ocaml/stublibs/dllunix.so

This seems to indicate that opam still thinks that your OCaml system compiler is 4.01 while you've updated your compiler version (with brew) to 4.02. You need to recompile your switch. Or to remove setup.data, call eval 'opam config env'and call make again.

amirmc commented 9 years ago

I rebuilt the switch, reinstalled the packages, made sure I was on opam 1.2.1 and the site now builds just fine. Had a bit of a hiccup with ocaml-uri but it seems to have sorted itself out. Closing.