mirage / ocaml-fat

Read and write FAT format filesystems from OCaml
ISC License
26 stars 18 forks source link

Error: The implementation lib/KV_RO.m does not match the interface lib/KV_RO.cmi #54

Closed yuval-k closed 7 years ago

yuval-k commented 7 years ago

Got an error trying to build mirage-fat, (I am trying to get the fat binary built), I get this error message:

# W: Cannot find source file matching module 'fat' in library fat
# E: Failure("Command ''/usr/bin/ocamlbuild' lib/fat.cma lib/fat.cmxa lib/fat.a lib/fat.cmxs fat/main.native shell/main.native lib_test/test.native -tag debug -tag tests -j 4' terminated with error code 10")
# make: *** [build] Error 1

I used this Dockerfile to build mirage-fat:

FROM ubuntu:16.04

RUN DEBIAN_FRONTEND=noninteractive apt-get update -y && \
    apt-get install -y  ocaml-nox-4.02.3 ocaml-native-compilers opam m4 pkg-config && \
    apt-get clean -y && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN opam init -y && cd /tmp/ && \
    git clone https://github.com/mirage/ocaml-fat && \
    cd /tmp/ocaml-fat && \
    opam pin add ocaml-fat . -n -y && \
    opam install ocaml-fat --verbose

(place it in an empty folder and do docker build .)

I tried checking out and building old versions, going back to early September, all failed..

Help is appreciated! Yuval

yomimono commented 7 years ago

Sorry for the delayed response, @uvgroovy . The current master of fat-filesystem is built against the upcoming MirageOS 3 API, and won't build without the accompanying set of tools in that universe. Until MirageOS 3 is available in the public opam repository, you'll need to amend your RUN statement to get the right set of dependencies for the current master:

RUN opam init -y && cd /tmp/ && \
    opam remote add mirage-dev https://github.com/mirage/mirage-dev.git && \
    opam update && \
    git clone https://github.com/mirage/ocaml-fat && \
    cd /tmp/ocaml-fat && \
    opam pin add ocaml-fat . -n -y && \
    opam install ocaml-fat --verbose
yuval-k commented 7 years ago

That seems to work. Thanks!

Is there any way to pin the specific version of mirage-dev in "opam remote add mirage-dev https://github.com/mirage/mirage-dev.git"? My goal is to guarantee that the container build will not fail in the future.

yomimono commented 7 years ago

Unfortunately mirage-dev itself is pointing at the current master of a whole bunch of packages, so pinning a specific commit won't be too helpful. If you can use the last released version of the package (the one you get via opam install fat-filesystem), the better thing to do would be this, which will get you the source for the latest released version of fat-filesystem:

RUN opam init -y && cd /tmp/ && \
   opam source fat-filesystem --dir ocaml-fat && \
    cd /tmp/ocaml-fat && \
    opam pin add ocaml-fat . -n -y && \
    opam install ocaml-fat --verbose
yuval-k commented 7 years ago

That last example gave me build errors - so going to use the previous one. Thanks!

adam-hanna commented 5 years ago

Sorry to bring this thread back from the dead.

@yomimono I'm running the command as you've typed it:

RUN opam init -y && cd /tmp/ && \
    opam remote add mirage-dev https://github.com/mirage/mirage-dev.git && \
    opam update && \
    git clone https://github.com/mirage/ocaml-fat && \
    cd /tmp/ocaml-fat && \
    opam pin add ocaml-fat . -n -y && \
    opam install ocaml-fat --verbose

I've also tried your other suggestion:

RUN opam init -y && cd /tmp/ && \
   opam source fat-filesystem --dir ocaml-fat && \
   cd /tmp/ocaml-fat && \
   opam pin add ocaml-fat . -n -y && \
   opam install ocaml-fat --verbose

But am getting the following error:

[NOTE] No package definition found for ocaml-fat.~dev: please complete the template
Error opening terminal: unknown.
[ERROR] Empty file or editor error, aborting.
[ERROR] No valid package definition found

I don't quite understand the error about a missing package def for ocaml-fat.~dev.

Thanks for any help.

hannesm commented 5 years ago

dear @adam-hanna, the opam package name of this repository is fat-filesystem. it used to use other names (e.g. ocaml-fat). there's no need to add the mirage-dev remote. you should just be able to run opam install fat-filesystem (and depend in your library on fat-filesystem).