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 64DD57F72A for ; Tue, 9 Aug 2016 20:33:17 +0200 (CEST) IronPort-PHdr: 9a23:OOiSiBcQhypfmQ+4qSFw1bEVlGMj4u6mDksu8pMizoh2WeGdxc+6ZR7h7PlgxGXEQZ/co6odzbGH6ua4ACdbuN7B6ClEK80UEUddyI0/pE8JOIa9E0r1LfrnPWQRPf9pcxtbxUy9KlVfA83kZlff8TWY5D8WHQjjZ0IufrymUrDbg8n/7e2u4ZqbO1wO32vkJ+srZ07v5UWJ749N0NMkcv5wgjLy4VJwM9xMwm1pIV/B1z3d3eyXuKBZziJLpvg6/NRBW6ipN44xTLhfESh0ezttvJ6jnVD5QACO/noRVHkN2loNWlCdrUKyYpCk+C79sfF6xCKyMsj/TLRyUjOnpe8/TRjvkyAbPBY29WjWjop7i6cN8zy7oBkq74fKYY3dHf56ZaTFZZtOSXBIG8BcSDdpB46gZpATBuECe+1fqt+u9BM1sRKiCFz0V6vUwThSiyqzhPVi3g== 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@outmail148093.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.148.93; 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.148.93 as permitted sender) identity=mailfrom; client-ip=62.13.148.93; 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@outmail148093.authsmtp.net) identity=helo; client-ip=62.13.148.93; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="dra-news@metastack.com"; x-sender="postmaster@outmail148093.authsmtp.net"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CQAQBBIapXh12UDT5dgxiBA3wHpBUBAQaIWI4lHIYBAoFMPBABAQEBAQEBAREBAQEKCwkJGSQLgjIEARMBghMBAQU6OgUQAgEIGB4QIRElAgQOBQgSh30DGAMBvHYNhCwBAQEBBgEBAQEBAQEBH4VihRWCQ4F/gyqCLwWZBTSMT4I7Co85iC0hh141gkKBV26GLX8BAQE X-IPAS-Result: A0CQAQBBIapXh12UDT5dgxiBA3wHpBUBAQaIWI4lHIYBAoFMPBABAQEBAQEBAREBAQEKCwkJGSQLgjIEARMBghMBAQU6OgUQAgEIGB4QIRElAgQOBQgSh30DGAMBvHYNhCwBAQEBBgEBAQEBAQEBH4VihRWCQ4F/gyqCLwWZBTSMT4I7Co85iC0hh141gkKBV26GLX8BAQE X-IronPort-AV: E=Sophos;i="5.28,495,1464645600"; d="scan'208";a="229467871" Received: from outmail148093.authsmtp.net ([62.13.148.93]) by mail2-smtp-roc.national.inria.fr with ESMTP; 09 Aug 2016 20:33:16 +0200 Received: from mail-c247.authsmtp.com (mail-c247.authsmtp.com [62.13.128.247]) by punt20.authsmtp.com (8.14.2/8.14.2/) with ESMTP id u79IXGtH081046; Tue, 9 Aug 2016 19:33:16 +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 u79IXFFN096198 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 9 Aug 2016 19:33:15 +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 u79IXEPE008900; Tue, 9 Aug 2016 19:33:14 +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; Tue, 9 Aug 2016 19:33:14 +0100 From: David Allsopp To: "moosotc@gmail.com" CC: Gabriel Scherer , caml users Thread-Topic: [Caml-list] Interface(.mli) location Thread-Index: AQHR8a9sWCvy6CNG7kmmtpBMUxmENKBA9R+g Date: Tue, 9 Aug 2016 18:33:13 +0000 Message-ID: References: <8737mfp7j3.fsf@gmail.com> <87y447npv3.fsf@gmail.com> <87r39znl6m.fsf@gmail.com> <87mvknnia0.fsf@gmail.com> In-Reply-To: <87mvknnia0.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 Organization: MetaStack Solutions Ltd. X-Scanned-By: MIMEDefang 2.65 on 172.16.0.20 X-Server-Quench: bc7c85c8-5e5f-11e6-bcde-0015176ca198 X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCd1ZAARAlZZVg1f DC4bFwdFRBksPQFF ChxFJgxfNl8UURhQ KkJXbgESJgVNAnhE VHkJW1VSQFx4U2B2 YQtUIwdcYVRPXwB0 UklLXFNTEBpqBAMA SFsZW2AaAXM4eHd2 ZE9qEHFZXU14OxQu RR1cED4OeGI1bTYC 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: >=20 > > 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. > >> > >> 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 > > necessarily 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 > > unify ./a.cmo against d/a.cmi. This isn't ideal because having a > > source file which you don't expect to compile will confuse dependency > > generators and automatic build rules. > > c) Implement a new option in the compiler driver which suppresses the > > automatic generation of .cmi files (e.g. ocamlc -c -I d -no-cmi a.ml) >=20 > d) Make the compiler skip generation of .cmi if it sees one in the -I > directories? Of course, there is a dirty option e) if you have a.mli and a.cmi in direct= ory d as before: ocamlc -intf-suffix .ml -I d -c a.ml will use the .cmi in d and not generate one in the current directory... David=20