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

Missing requires in META file? #339

Closed
talex5 opened this issue Sep 28, 2017 · 5 comments
Closed

Missing requires in META file? #339

talex5 opened this issue Sep 28, 2017 · 5 comments
Labels

Comments

@talex5
Copy link
Contributor

talex5 commented Sep 28, 2017

I was getting this stange error:

       In module TCPV4:
       Type declarations do not match:
         type error = TCPV4.error
       is not included in
         type error = private [> Mirage_protocols.Tcp.error ]   

when doing just
module Sock : Mirage_stack_lwt.V4 = Tcpip_stack_socket

Trying in utop I found I couldn't load the stack-socket library directly unless I first loaded some other libraries:

utop # #load "/Users/tal/.opam/4.04.0+afl/lib/io-page-unix/io_page_unix.cma";;
utop # #require "tcpip.stack-socket";;
Error: Reference to undefined global `Udpv4_socket'
utop # #require "tcpip.udpv4-socket";;
utop # #require "tcpip.stack-socket";;
Error: Reference to undefined global `Tcpv4_socket'
utop # #require "tcpip.tcpv4-socket";;
utop # #require "tcpip.stack-socket";;

Adding manual dependencies on tcpip.tcpv4-socket and tcpip.udpv4-socket allowed my code to compile.

@talex5
Copy link
Contributor Author

talex5 commented Sep 28, 2017

(the #load is for mirage/io-page#50)

@talex5 talex5 changed the title Missing requires in META file Missing requires in META file? Sep 28, 2017
@talex5
Copy link
Contributor Author

talex5 commented Sep 29, 2017

Also, when linking with jbuilder I had to specify the libraries in the correct order (tcpip.tcpv4-socket tcpip.udpv4-socket tcpip.unix tcpip.stack-socket). If I put tcpip.stack-socket first, it failed to link with:

Error: Required module `Tcpv4_socket' is unavailable

@talex5
Copy link
Contributor Author

talex5 commented Sep 29, 2017

Test case:

test.ml:

let x = Tcpip_stack_socket.disconnect

jbuild:

(jbuild_version 1)

(executable (
  (name test)
  (libraries (tcpip.stack-socket))
))

(tested with docker run --rm -it ocaml/opam:debian-9_ocaml-4.04.0)

$ opam install tcpip jbuilder
$ jbuilder build --dev test.exe
Error: No implementations provided for the following modules:
         Udpv4_socket referenced from /home/opam/.opam/4.04.0/lib/tcpip/stack-socket/tcpip_stack_socket.cmxa(Tcpip_stack_socket)
         Tcpv4_socket referenced from /home/opam/.opam/4.04.0/lib/tcpip/stack-socket/tcpip_stack_socket.cmxa(Tcpip_stack_socket)
o

@yomimono
Copy link
Contributor

yomimono commented Nov 5, 2017

Belated thanks for the report and the test cases; I agree that this is annoying and we should fix it.

@yomimono yomimono added the bug label Nov 17, 2017
@yomimono
Copy link
Contributor

yomimono commented Mar 8, 2019

Trying to load tcpip.stack-socket in utop now appears to work as expected, so closing as "works for me" - please feel free to reopen if I've misunderstood or this still seems broken.

@yomimono yomimono closed this as completed Mar 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants