g2p / git-fs

A filesystem interface to git repositories
GNU General Public License v2.0
234 stars 19 forks source link

Error: Unbound module Unix_util #7

Closed alx closed 11 years ago

alx commented 11 years ago

Hi,

I'd like to use a raspberry-pi as a Sparkleshare media library.

Sparkleshare is directing to use git-fs to mount media libraries, and I've follow the installation instructions until this error.

Could you give me a hint as I'm not use to omake compilations?

Thanks a lot;

Alex

git-fs $ omake
*** omake: reading OMakefiles
*** omake: finished reading OMakefiles (0.15 sec)
- build build git_fs.cmi
+ ocamlfind ocamlc -package batteries,bigarray,pcre -warn-error A -thread -g -I . -I ../deps/ocamlfuse/lib -c git_fs.ml
File "git_fs.ml", line 150, characters 10-24:
Error: Unbound module Unix_util
*** omake: 17/30 targets are up to date
*** omake: failed (1.31 sec, 0/1 scans, 1/1 rules, 0/58 digests)
*** omake: targets were not rebuilt because of errors:
   build/git_fs.cmi
      depends on: build/git_fs.ml
   build/git_fs.cmo
      depends on: build/git_fs.ml
alx commented 11 years ago

Here is the method containing the error:

(* Run a command, read the output into a BigArray.Array1. *)
let subprocess_read_bigarray cmd offset big_array =
  log (Printf.sprintf "Command %S" (BatString.join " " cmd));
  let out_pipe = SubprocessWithBatIO.open_process_in (Array.of_list cmd) in
  let out_fd = SubprocessWithBatIO.descr_of_input out_pipe in
  (* Can't seek a pipe. Read and ignore. *)
  (* XXX lossy int64 conversion *)
  ignore (BatIO.really_nread out_pipe (Int64.to_int offset));
  (* Returns how much was read, may raise. *)
  let r = Unix_util.read out_fd big_array in
  require_normal_exit out_pipe;
  r

With the line 150 error on this line:

  let r = Unix_util.read out_fd big_array in
g2p commented 11 years ago

I can't really look at this until tomorrow, but for now, Unix_util is supposed to be shipped by ocamlfuse.

alx commented 11 years ago

Thanks for the tips :)

I'm on debian (raspbian for raspi) and I can't get this line from the readme working:

sudo pacman -S omake ocamlfuse-cvs pcre-ocaml ocaml-batteries

That's probably the place where I'm missing ocamlfuse.

Have a nice night,

Alex

alx commented 11 years ago

I've retried the installation from the start, and I think it comes from ocamlfuse dependency (I've never touched a ocaml project):

git-fs $ make -C deps/ocamlfuse/lib
make: Entering directory `/home/alx/code/git-fs/deps/ocamlfuse/lib'
make[1]: Entering directory `/home/alx/code/git-fs/deps/ocamlfuse/lib'
make[1]: `libFuse_stubs.a' is up to date.
ocamlopt -c -thread Result.ml
/bin/sh: 5: ocamlopt: not found
make[1]: *** [Result.cmi] Error 127
make[1]: Leaving directory `/home/alx/code/git-fs/deps/ocamlfuse/lib'
make: *** [native-code-library] Error 2
make: Leaving directory `/home/alx/code/git-fs/deps/ocamlfuse/lib'

I've tried to look around, ocamlopt doesn't seem available for raspi, so I'm not sure what's the next step.

Thanks for your help :)

g2p commented 11 years ago

The aptitude line in the README is supposed to pull in ocaml-nox, which contains the ocamlopt command. If there's an error at that step the rest isn't likely to succeed.

g2p commented 11 years ago

For some reason the debian source package will build ocamlopt on armel but not armhf (edit: OCaml 4.00 does build ocamlopt on armhf). If you look at ocamlfuse's README.md, it gives alternative build instructions that may work on the raspberry:

cd deps/ocamlfuse
ocaml setup.ml -configure
ocaml setup.ml -build

The git-fs OMakefile should be portable enough to do the rest, so please give it a test.

alx commented 11 years ago

Thanks, I've now managed to buid ocaml-fuse and I'm back on the ocamlopt: not found issue.

I'll let you know if I find a way to install OCaml 4.00 on the raspi.

alx commented 11 years ago

Nice, I've succeeded installing OCaml 4.00 thanks to paparazzi wiki : http://paparazzi.enac.fr/wiki/Installation/RaspberryPi

I've retry the make command then, to get this error.

git-fs $ make -C deps/ocamlfuse/lib
make: Entering directory `/home/alx/code/git-fs/deps/ocamlfuse/lib'
make[1]: Entering directory `/home/alx/code/git-fs/deps/ocamlfuse/lib'
make[1]: `libFuse_stubs.a' is up to date.
ocamlc -c -thread Fuse_bindings.mli
File "Fuse_bindings.mli", line 37, characters 8-23:
Error: Unbound module Com
make[1]: *** [Fuse_bindings.cmi] Error 2
make[1]: Leaving directory `/home/alx/code/git-fs/deps/ocamlfuse/lib'
make: *** [native-code-library] Error 2
make: Leaving directory `/home/alx/code/git-fs/deps/ocamlfuse/lib'

I've tried to install opam to see if it helps, but I've got this error: Fatal error: OCaml and preprocessor have incompatible versions

Would it help on the Com module error to have opam running?

g2p commented 11 years ago

Com is part of camlidl. After adding the ocaml-rpi repo, you should be able to run the rest of the installation as normal. You should re-run the aptitude line; there should be no need for OPAM. If everything works well with just the extra repo added, I'll mention it in the README.

g2p commented 11 years ago

That said, if things get much more complicated than that, I suggest not using OCaml 4 and building without ocamlopt. In which case you should downgrade OCaml, make a clean clone, and replace the build instructions with this:

git submodule update --init
make -C deps/ocamlfuse/lib byte-code-library
omake
g2p commented 11 years ago

Oh, the ocaml-rpi repo contains just the compiler, it didn't rebuild camlidl or anything else. That won't work. Please go with the non-ocamlopt instructions, I'll be glad to have someone test them.

alx commented 11 years ago

thanks @g2p, the modified build instructions are working perfectly with the original ocaml-rpi :)

g2p commented 11 years ago

I've updated the README. Thanks!