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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id C32C87F72A for ; Tue, 9 Aug 2016 20:08:24 +0200 (CEST) IronPort-PHdr: 9a23:FRp/uBfamwagJ/1E+Ypz4J94lGMj4u6mDksu8pMizoh2WeGdxc+6ZR7h7PlgxGXEQZ/co6odzbGH6ua4ACdauN7B6ClEK80UEUddyI0/pE8JOIa9E0r1LfrnPWQRPf9pcxtbxUy9KlVfA83kZlff8TWY5D8WHQjjZ0IufrymUrDbg8n/7e2u4ZqbO1wO32vkJ+srZ0/v5UWJ749N0NMkcv5wgjLy4VJwM9xMwm1pIV/B1z3d3eyXuKBZziJLpvg6/NRBW6ipN44xTLhfESh0ezttvJ6jnVD5QACO/noRVHkN2loNWlCdrUKyYpCk+C79sfF6xCKyMsj/TLRyUjOnpe8/TRjvkyAbPBY29WjWjop7i6cN8zy7oBkq74fKYY3dHf56ZaTFZZtOSXBIG8BcSDdpB46gZpATBuECe+1fqt+u9BM1sRKiCFz0V6vUwThSiyqzhPVi3g== Authentication-Results: mail3-smtp-sop.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 (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of dra-news@metastack.com) identity=pra; client-ip=62.13.148.93; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="dra-news@metastack.com"; x-sender="dra-news@metastack.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.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=mail3-smtp-sop.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 (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@outmail148093.authsmtp.net) identity=helo; client-ip=62.13.148.93; receiver=mail3-smtp-sop.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: A0CxAgCkG6pXh12UDT5dgxiBA3wHpBUBAQZDiBWOJSSFeQKBTDwQAQEBAQEBAQERAQEBCgsJCRkkC4IyBAETAYITAQEEATo/EAIBCBgeECERJQIEDgUIEod9Aw8JAwEJvGoNhCwBAQgBAQEBAQEhhWKEEoEDgkOBf4Mqgi8FiB6HMIk3NIYdhjKCOwqCL40KiC0hh141gjIQC4FMbgGGLH8BAQE X-IPAS-Result: A0CxAgCkG6pXh12UDT5dgxiBA3wHpBUBAQZDiBWOJSSFeQKBTDwQAQEBAQEBAQERAQEBCgsJCRkkC4IyBAETAYITAQEEATo/EAIBCBgeECERJQIEDgUIEod9Aw8JAwEJvGoNhCwBAQgBAQEBAQEhhWKEEoEDgkOBf4Mqgi8FiB6HMIk3NIYdhjKCOwqCL40KiC0hh141gjIQC4FMbgGGLH8BAQE X-IronPort-AV: E=Sophos;i="5.28,495,1464645600"; d="scan'208";a="187300101" Received: from outmail148093.authsmtp.net ([62.13.148.93]) by mail3-smtp-sop.national.inria.fr with ESMTP; 09 Aug 2016 20:08:23 +0200 Received: from mail-c232.authsmtp.com (mail-c232.authsmtp.com [62.13.128.232]) by punt20.authsmtp.com (8.14.2/8.14.2/) with ESMTP id u79I8KDu016953; Tue, 9 Aug 2016 19:08:20 +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 u79I8I6F094883 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 9 Aug 2016 19:08: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 u79I8H8X008728; Tue, 9 Aug 2016 19:08: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; Tue, 9 Aug 2016 19:08:17 +0100 From: David Allsopp To: "moosotc@gmail.com" CC: Gabriel Scherer , caml users Thread-Topic: [Caml-list] Interface(.mli) location Thread-Index: AQHR8jMvWCvy6CNG7kmmtpBMUxmENKBAgv+ogABpTcA= Date: Tue, 9 Aug 2016 18:08:17 +0000 Message-ID: References: <8737mfp7j3.fsf@gmail.com> <87y447npv3.fsf@gmail.com> <87r39znl6m.fsf@gmail.com> <87mvknnia0.fsf@gmail.com> <87k2fqcirv.fsf@gmail.com> <87d1licgmw.fsf@gmail.com> <878tw6cgh2.fsf@gmail.com> In-Reply-To: <878tw6cgh2.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: 406eac2d-5e5c-11e6-829e-00151795d556 X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCd1ZAARAlZZVg1f DC4bFwdFRBksPQFF ChxFJgxfNl8UURhQ KkJXbgESJgVNAnhE VHkJW1VSQFx4U2N9 YQtYIwdcYVRPXwB0 UklLXFNTEBpqBAMA SFsZW2B6DgMweHd0 bU5hEHFaXU16O0J9 RBsFRm9SeGI1bTMC UUENcR5ccgofYx9F a1V+U3oINWACYDQC Ml17DBs4ODEaLCVO XjRFDFQOTFwFFzUx B1YHGTRuVUkCTCwv LhsgQl4B X-Authentic-SMTP: 61633634383431.1037: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: > moosotc@gmail.com writes: >=20 > > moosotc@gmail.com writes: > > > >> David Allsopp writes: > >> > > [..snip..] > > > >>>> > >>>> d) Make the compiler skip generation of .cmi if it sees one in the -I > >>>> directories? > >>> > >>> No - I think the use-case is too niche to justify breaking backwards > >>> compatibility. That's potentially a very subtle way to break someone > >>> else's existing build system. The existing behaviour is precisely > >>> documented in the manual (even if it's not necessarily the best > >>> approach). > >>> > >> > >> Original post asked for either change of behavior or documentation, I > >> failed to find the precise documentation, care pointing out where > >> exactly things are described in the manual? http://caml.inria.fr/pub/docs/manual-ocaml/comp.html#sec263 describes how .= mli and .ml are handled by the compiler (and when .cmi is generated or chec= ked against) and the description of -I in http://caml.inria.fr/pub/docs/man= ual-ocaml/comp.html#sec264 explains that -I only adds search directories fo= r compiled files, not source files. > > Also, consider this: > > >=20 > Better this (with safety nets in form of added -Is) >=20 > [malc@linmac2 mli]$ cat repro2.sh; sh repro2.sh > #!/bin/sh > set -x > rm -fr a* d o >=20 > mkdir -p o d >=20 > echo 'type a =3D int and b =3D int' >a.ml > echo 'type a =3D int' >d/a.mli >=20 > ocamlc -c -o o/a.cmi d/a.mli > md5sum o/a.cmi > ocamlc -I o -I d -c -o o/a.cmo a.ml > md5sum o/a.cmi > + rm -fr 'a*' d o > + mkdir -p o d > + echo 'type a =3D int and b =3D int' > + echo 'type a =3D int' > + ocamlc -c -o o/a.cmi d/a.mli > + md5sum o/a.cmi > dddf074fdfa94cad226485870c617116 o/a.cmi > + ocamlc -I o -I d -c -o o/a.cmo a.ml > + md5sum o/a.cmi > bc44d889df40c61e43dbd94535ffd614 o/a.cmi >=20 > [..snip..] This, again, is just the compiler acting exacting as it says it should! Whe= n you compile o/a.ml, ocamlc looks for ./a.mli and because it doesn't find = it, it overwrites o/a.cmi (because of the -o switch). David=20