Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
yuval-k opened this issue Nov 9, 2016 · 6 comments

Comments

@yuval-k
Copy link

yuval-k commented Nov 9, 2016

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
Copy link
Contributor

yomimono commented Nov 15, 2016

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
Copy link
Author

yuval-k commented Nov 15, 2016

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
Copy link
Contributor

yomimono commented Nov 15, 2016

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
Copy link
Author

yuval-k commented Nov 15, 2016

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

@yuval-k yuval-k closed this as completed Nov 15, 2016
@adam-hanna
Copy link

adam-hanna commented Dec 8, 2018

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
Copy link
Member

hannesm commented Dec 8, 2018

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants