From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id AA8567EEEF for ; Sat, 13 Jun 2015 09:22:54 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of tim@gfxmonk.net) identity=pra; client-ip=209.85.223.174; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="tim@gfxmonk.net"; x-sender="tim@gfxmonk.net"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of tim@gfxmonk.net) identity=mailfrom; client-ip=209.85.223.174; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="tim@gfxmonk.net"; x-sender="tim@gfxmonk.net"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-ie0-f174.google.com) identity=helo; client-ip=209.85.223.174; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="tim@gfxmonk.net"; x-sender="postmaster@mail-ie0-f174.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0BXAQBC2XtVm67fVdFcg2RlgxisFQGXYQdMAQEBAQEBEgEBAQEBBgsLCSEuhDsRbwYHNwIkEgEFAVeIDQWVVo06gzE+MYs/lwoKj1cegzqBRQWfFpZFEiOBFYQxgyQBAQE X-IPAS-Result: A0BXAQBC2XtVm67fVdFcg2RlgxisFQGXYQdMAQEBAQEBEgEBAQEBBgsLCSEuhDsRbwYHNwIkEgEFAVeIDQWVVo06gzE+MYs/lwoKj1cegzqBRQWfFpZFEiOBFYQxgyQBAQE X-IronPort-AV: E=Sophos;i="5.13,607,1427752800"; d="scan'208";a="164994464" Received: from mail-ie0-f174.google.com ([209.85.223.174]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 13 Jun 2015 09:22:53 +0200 Received: by iebgx4 with SMTP id gx4so36058983ieb.0 for ; Sat, 13 Jun 2015 00:22:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-type; bh=8YrbIgavYcVsmTiYZqpry93mSCXFY3TZ/1LxzD4TEJE=; b=QWe5VuXdJCR9O0juCoa9X8nNnX9eWT7Zlu9YkaxvVTpQlJl5RNRS+zJz7RuJvVD0k1 vRfHlmK4IW2K06R2bndjKfPFpM3qX+gvKqajtphbBpAgi70xthYHZ5/Eefe6w4lEKRG+ NkcQxf+smhFHkQKOjf8CfouIjKQ1fHnF7OCf3LGTR7nhELyqNOEDDqixXI8O/gFahHUN Kc1qQIs74f8OxL3gqIigI5qf+g4nAaj1HF2hTX5xIj0jywf76xteMx8L5bkEeCtki/ef K1N7LAMliUS7Vz4dtmlOPZgOHyFpXVhYk+iYD1zbfDll0y3qfmmLioCvZDtl4DVvZFv9 a4pg== X-Gm-Message-State: ALoCoQmrIQFQeG5r8m13KdhJlZlgKnEz8EaDoxnTerNrJPzfXKW1xwsOpmU6lWkY21JP9wIuVnli X-Received: by 10.107.46.226 with SMTP id u95mr23007486iou.68.1434180172188; Sat, 13 Jun 2015 00:22:52 -0700 (PDT) Received: from mail-ie0-f170.google.com (mail-ie0-f170.google.com. [209.85.223.170]) by mx.google.com with ESMTPSA id g3sm2867435igi.10.2015.06.13.00.22.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 13 Jun 2015 00:22:50 -0700 (PDT) Received: by iebmu5 with SMTP id mu5so36065641ieb.1 for ; Sat, 13 Jun 2015 00:22:49 -0700 (PDT) X-Received: by 10.50.61.241 with SMTP id t17mr2387747igr.34.1434180169424; Sat, 13 Jun 2015 00:22:49 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.252.10 with HTTP; Sat, 13 Jun 2015 00:22:28 -0700 (PDT) From: Tim Cuthbertson Date: Sat, 13 Jun 2015 17:22:28 +1000 Message-ID: To: caml-list@inria.fr Content-Type: multipart/alternative; boundary=047d7bdca9688aec0005186117e3 Subject: [Caml-list] Determining what code is depending on `Unix` --047d7bdca9688aec0005186117e3 Content-Type: text/plain; charset=UTF-8 Hi all, I'm attempting to convert an existing (reasonably small) HTTP server written in OCaml to run on mirage's xen backend. I've gotten the compiler reasonably happy by replacing uses of Unix / Lwt_unix with appropriate mirage-compatible modules. But when it comes to link time, it seems that my application is still indirectly depending on Unix: + ocamlbuild -quiet -cflag -warn-error -cflag +a-3 -build-dir [...]/_build/mirage-xen -use-ocamlfind -lflags -g,-linkpkg,-dontlink,unix main.native.o + ocamlfind ocamlopt -g -linkpkg -dontlink unix -output-obj -syntax camlp4o -package 'fat-filesystem, io-page, mirage-block-xen.front, batteries, yojson, safepass, sha, lwt, lwt.syntax, mirage-console.xen, mirage-types, mirage-types.lwt, mirage-net-xen, mirage-types,cohttp,cohttp.lwt, mirage-http, lwt, mirage.runtime, tcpip.stack-direct,tcpip.stack-socket,mirage-clock-xen,conduit.mirage' src/passe.cmx src/passe_server.cmx src/unikernel.cmx main.cmx -o main.native.o File "_none_", line 1: Error: No implementations provided for the following modules: Unix referenced from /home/tim/.opam/mirage_4_01_0/lib/lwt/lwt-unix.cmxa(Lwt_engine), /home/tim/.opam/mirage_4_01_0/lib/lwt/lwt-unix.cmxa(Lwt_unix), /home/tim/.opam/mirage_4_01_0/lib/ipaddr/ipaddr_unix.cmxa(Ipaddr_unix) Command exited with code 2. I can't figure out why those modules are being linked in, though. I have grepped all files in _build/mirage-xen/**/*.ml.depends (as well as my own source code), and nothing in there matches "unix", nor mentions any of the modules listed above. The only lwt_* matches are: Cohttp_lwt_body Lwt_mutex Lwt_stream Which all seem like they shouldn't depend on unix either directly or indirectly. Is there some way to see a tree / list of "what module in my source code is transitively depending on Unix, and via what modules is that dependency inherited?" Or even if there's no way to see a tree, is there a way to do it one step at a time (e.g "what is depending directly on Lwt_unix", then repeat the process for those modules listed until I see something that surprises me) Failing that, does anyone have tricks for weeding indirect `Unix` usage out of a codebase which is not directly using it? Thanks, - Tim Cuthbertson --047d7bdca9688aec0005186117e3 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi all,

I'm attempting to convert an existing (reasonably small) HTTP server= written in OCaml to run on mirage's xen backend. I've gotten the c= ompiler reasonably happy by replacing uses of Unix / Lwt_unix with appropri= ate mirage-compatible modules. But when it comes to link time, it seems tha= t my application is still indirectly depending on Unix:

+ ocamlbuild= -quiet -cflag -warn-error -cflag +a-3 -build-dir [...]/_build/mirage-xen -= use-ocamlfind -lflags -g,-linkpkg,-dontlink,unix main.native.o
+ ocamlfi= nd ocamlopt -g -linkpkg -dontlink unix -output-obj -syntax camlp4o -package= 'fat-filesystem, io-page, mirage-block-xen.front, batteries, yojson, s= afepass, sha, lwt, lwt.syntax, mirage-console.xen, mirage-types, mirage-typ= es.lwt, mirage-net-xen, mirage-types,cohttp,cohttp.lwt, mirage-http, lwt, m= irage.runtime, tcpip.stack-direct,tcpip.stack-socket,mirage-clock-xen,condu= it.mirage' src/passe.cmx src/passe_server.cmx src/unikernel.cmx main.cm= x -o main.native.o
File "_none_", line 1:
Error: No impleme= ntations provided for the following modules:
=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 Unix referenced from /home/tim/.opam/mirage_4_01_0/li= b/lwt/lwt-unix.cmxa(Lwt_engine),
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 /home/tim/.opam/mirage_4_01_0/lib/lwt/lwt-unix.cmxa(L= wt_unix),
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /= home/tim/.opam/mirage_4_01_0/lib/ipaddr/ipaddr_unix.cmxa(Ipaddr_unix)
Co= mmand exited with code 2.

I can't figure out why those mod= ules are being linked in, though. I have grepped all files in _build/mirage= -xen/**/*.ml.depends (as well as my own source code), and nothing in there = matches "unix", nor mentions any of the modules listed above. The= only lwt_* matches are:

Cohttp_lwt_body
Lwt_mutex
Lwt_stream<= br>
Which all seem like they shouldn't depend on unix either d= irectly or indirectly.

Is there some way to see a tree / list = of "what module in my source code is transitively depending on Unix, a= nd via what modules is that dependency inherited?" Or even if there= 9;s no way to see a tree, is there a way to do it one step at a time (e.g &= quot;what is depending directly on Lwt_unix", then repeat the process = for those modules listed until I see something that surprises me)
=
Failing that, does anyone have tricks for weeding indirect `= Unix` usage out of a codebase which is not directly using it?

=
Thanks,
=C2=A0- Tim Cuthbertson
--047d7bdca9688aec0005186117e3--