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 CB9497FF50 for ; Mon, 8 Aug 2016 21:39:21 +0200 (CEST) IronPort-PHdr: 9a23:w2AQdBxW724uFc3XCy+O+j09IxM/srCxBDY+r6Qd0OsfIJqq85mqBkHD//Il1AaPBtSDraMcwLOM4ujJYi8p2d65qncMcZhBBVcuqP49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL2PbrnD61zMOABK3bVMzfbWtXN+KxJ3thqibwN76W01wnj2zYLd/fl2djD76kY0ou7ZkMbs70RDTo3FFKKx8zGJsIk+PzV6nvp/jtLYqySlbuuog+shcSu26Ov1gFf0LRAghZiow48rwsgXIZQSK73oYFG4Rl1AAVw3C6wr9QpzZvS7zt+470y6fa4m+YbkqWDjqxqNvUxjwkG9TOyQwtWfalddYia9HqQm9rhd8hYXTZdfGGuB5e/bxdM0bSSJoWsJKUDRZStewdYJKCeceJs5dopX0vEcHphj4Dg6pUrC8ggRUj2P7iPVpm98qFhvLiUl5R4oD Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=dra-news@metastack.com; spf=Pass smtp.mailfrom=dra-news@metastack.com; spf=None smtp.helo=postmaster@outmail149081.authsmtp.net Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of dra-news@metastack.com) identity=pra; client-ip=62.13.149.81; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="dra-news@metastack.com"; x-sender="dra-news@metastack.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of dra-news@metastack.com designates 62.13.149.81 as permitted sender) identity=mailfrom; client-ip=62.13.149.81; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="dra-news@metastack.com"; x-sender="dra-news@metastack.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@outmail149081.authsmtp.net) identity=helo; client-ip=62.13.149.81; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="dra-news@metastack.com"; x-sender="postmaster@outmail149081.authsmtp.net"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0ATAAC/3qhXl1GVDT5dgxiBA24OB6xpjiUchgECgUA8EAEBAQEBAQEBEQEBAQEBCBYHSIIyBAETAYITAQEFOjoFEAIBCBgeECERJQIEAQ0FCBKHfQMYAwG+UQ2ELgEBAQEBBQEBAQEBAQEBAR6Kd4JDgX+DKoIvBZkFNIxPgjsKjzmILSGHXjWCQoFXboZgfwEBAQ X-IPAS-Result: A0ATAAC/3qhXl1GVDT5dgxiBA24OB6xpjiUchgECgUA8EAEBAQEBAQEBEQEBAQEBCBYHSIIyBAETAYITAQEFOjoFEAIBCBgeECERJQIEAQ0FCBKHfQMYAwG+UQ2ELgEBAQEBBQEBAQEBAQEBAR6Kd4JDgX+DKoIvBZkFNIxPgjsKjzmILSGHXjWCQoFXboZgfwEBAQ X-IronPort-AV: E=Sophos;i="5.28,491,1464645600"; d="scan'208";a="229365431" Received: from outmail149081.authsmtp.net ([62.13.149.81]) by mail2-smtp-roc.national.inria.fr with ESMTP; 08 Aug 2016 21:39:20 +0200 Received: from mail-c247.authsmtp.com (mail-c247.authsmtp.com [62.13.128.247]) by punt22.authsmtp.com (8.14.2/8.14.2/) with ESMTP id u78JdJF6067803; Mon, 8 Aug 2016 20:39:19 +0100 (BST) Received: from romulus.metastack.com (114.212-105-213.static.virginmediabusiness.co.uk [213.105.212.114]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/) with ESMTP id u78JdImI002968 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 8 Aug 2016 20:39:18 +0100 (BST) Received: from remus.metastack.local (remus.metastack.com [172.16.0.1]) by romulus.metastack.com (8.14.2/8.14.2) with ESMTP id u78JdH8L018963; Mon, 8 Aug 2016 20:39:17 +0100 Received: from Remus.metastack.local ([fe80::547c:3c42:e1da:eda2]) by Remus.metastack.local ([fe80::547c:3c42:e1da:eda2%10]) with mapi id 14.03.0301.000; Mon, 8 Aug 2016 20:39:17 +0100 From: David Allsopp To: "moosotc@gmail.com" , David Allsopp CC: Gabriel Scherer , caml users Thread-Topic: [Caml-list] Interface(.mli) location Thread-Index: AQHR8aanWCvy6CNG7kmmtpBMUxmENKA/dJQw Date: Mon, 8 Aug 2016 19:39:16 +0000 Message-ID: References: <8737mfp7j3.fsf@gmail.com> <87y447npv3.fsf@gmail.com> <87r39znl6m.fsf@gmail.com> In-Reply-To: <87r39znl6m.fsf@gmail.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.16.0.29] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MSL-Actually-To: dra-news@metastack.com Organization: MetaStack Solutions Ltd. X-Scanned-By: MIMEDefang 2.65 on 172.16.0.20 X-Server-Quench: cc4cbf0b-5d9f-11e6-bcde-0015176ca198 X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCd1ZAARAlZZVg1f DC4bFwdFRBksPQFF ChxFJgxfNl8UURhQ KkJXbgESJgVMAnhE VHkJW1VSQF9xU2B8 YQtYIwdcYVRPXwB0 UklLXFNTEBpqBAMA SFsZWmMmDlg/eH5y bEBqEHFbWkJyOxUu Rh0GQ21UeGI0YTYC UUENcR4GI1cfYx9F a1V+U3VeMGQObjQC Ml17DBs4ODEaLCVO XjRFDFQOTFwFFzUx B1YHGTRuVUkCTCwv LhsgQl4B X-Authentic-SMTP: 61633634383431.1038:706 X-AuthFastPath: 0 (Was 255) X-AuthSMTP-Origin: 213.105.212.114/25 X-AuthVirus-Status: No virus detected - but ensure you scan with your own anti-virus system. Subject: RE: [Caml-list] Interface(.mli) location moosotc@gmail.com wrote: > David Allsopp writes: > > moosotc@gmail.com wrote: > >> Gabriel Scherer writes: > >> > >> > It is correct that ocamldep assumes that the .ml and .mli of a > >> > given module are at the same place, but this is not the case for > >> > the rest of the compilation chain, which is either concerned with > >> > single source files (a .ml file or a .mli file) or with > >> > "compilation units" (a .cmo and .cmi files passed together, > >> > independently of where their source files were). In particular, all > >> > type-checking tools do look in -I directories to find .cmi files > >> > for the dependencies of the module being compiled (and at this stage > they do not care for .mli files). > >> > >> But the script seems to (somewhat) contradict this, i.e. after > >> `ocamlc -I d -c a.ml' ocamlc ignores the presence of .mli inside > >> subdirectory d/, producing both .cmi/.cmo when when compiling a.ml. > > > > The -I option specifies extra directories for compiled files only, so > > it's correct that the compiler ignores d/a.mli. >=20 > After sending the first post I've realized that: ocamlc -c d/a.mli was > forgotten, but even after adding that to the script things do not change, > i.e. following compilation of a.ml with -I d where d contains a.cmi still > produces both a.cmo and a.cmi in the top-level directory. Indeed - but that's the correct documented behaviour, even if not necessari= ly the ideal. There are various things you can do: a) Delete ./a.cmi as part of your build procedure. This isn't ideal, though= , because you lose the type-checking against d/a.cmi b) Have an empty ./a.mli but never compile it - the compiler will then unif= y ./a.cmo against d/a.cmi. This isn't ideal because having a source file wh= ich you don't expect to compile will confuse dependency generators and auto= matic build rules. c) Implement a new option in the compiler driver which suppresses the autom= atic generation of .cmi files (e.g. ocamlc -c -I d -no-cmi a.ml) David