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 C3D3A7FF50 for ; Mon, 8 Aug 2016 19:13:08 +0200 (CEST) IronPort-PHdr: 9a23:wohvFh8AHXjtvf9uRHKM819IXTAuvvDOBiVQ1KB80+kcTK2v8tzYMVDF4r011RmSDN2duqoP0rKJ+4nbGkU4qa6bt34DdJEeHzQksu4x2zIaPcieFEfgJ+TrZSFpVO5LVVti4m3peRMNQJW2WVTerzWI4CIIHV2nbEwud7yzS9aZ1pzon8mJuLTrKz1SgzS8Zb4gZD6Xli728vcsvI15N6wqwQHIqHYbM85fxGdvOE7B102kvpT41NdZ/i9Ro/Ms8dJbGeW/JvxgDO9uNyk9K20++OHssBDCS0PPuipdAS0qlU9nCgLf7Rz+Fqz6sibgu/A1jCaTN9f3QLRyQj+i4r1mUjfnjS4GM3gy92SB2eJqi6cOjx+7q1RE34nQeIScMvw2KqLbc9QySmdbUoNKSytFGoa1aY1JA+dXbrUQlJX0u1Zb9Uj2PgKrHu66j2IRiw== Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=info@gerd-stolpmann.de; spf=None smtp.mailfrom=info@gerd-stolpmann.de; spf=None smtp.helo=postmaster@mout.kundenserver.de Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of info@gerd-stolpmann.de) identity=pra; client-ip=217.72.192.75; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="info@gerd-stolpmann.de"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of info@gerd-stolpmann.de) identity=mailfrom; client-ip=217.72.192.75; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="info@gerd-stolpmann.de"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mout.kundenserver.de) identity=helo; client-ip=217.72.192.75; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="postmaster@mout.kundenserver.de"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0B3AACGvKhXh0vASNldgxiBA3ynSoUmhDWHc4F9JIV5AoE+OBQBAQEBAQEBAREBAQEIDQkJGS+CMgQBE4IVAQVVGQYFEAsYDRoHISQBEQYTCQmIBQMYAwEJviIDCoQuAQEBAQEBAQMBAQEBARQOhTKFRYJDggmCPYMSBYZaDIE/kGA0gTwChF+GMoI7gjmHGIVyiC0hg2aDeB6CWYFZbAGGGSqBGwEBAQ X-IPAS-Result: A0B3AACGvKhXh0vASNldgxiBA3ynSoUmhDWHc4F9JIV5AoE+OBQBAQEBAQEBAREBAQEIDQkJGS+CMgQBE4IVAQVVGQYFEAsYDRoHISQBEQYTCQmIBQMYAwEJviIDCoQuAQEBAQEBAQMBAQEBARQOhTKFRYJDggmCPYMSBYZaDIE/kGA0gTwChF+GMoI7gjmHGIVyiC0hg2aDeB6CWYFZbAGGGSqBGwEBAQ X-IronPort-AV: E=Sophos;i="5.28,490,1464645600"; d="asc'?scan'208";a="187204940" Received: from mout.kundenserver.de ([217.72.192.75]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Aug 2016 19:13:07 +0200 Received: from office1.lan.sumadev.de ([188.107.80.120]) by mrelayeu.kundenserver.de (mreue101) with ESMTPSA (Nemesis) id 0Ls9Sp-1b61DZ1ZIF-013vY5; Mon, 08 Aug 2016 19:13:06 +0200 Received: from [IPv6:fd55:cf:6598:7f:d41c:69a0:27ca:5665] (unknown [IPv6:fd55:cf:6598:7f:d41c:69a0:27ca:5665]) by office1.lan.sumadev.de (Postfix) with ESMTPSA id A6F41DC05E; Mon, 8 Aug 2016 19:13:05 +0200 (CEST) Message-ID: <1470676348.31388.4.camel@e130.lan.sumadev.de> From: Gerd Stolpmann To: Gabriel Scherer Cc: moosotc@gmail.com, caml users Date: Mon, 08 Aug 2016 19:12:28 +0200 In-Reply-To: References: <8737mfp7j3.fsf@gmail.com> Content-Type: multipart/signed; micalg="pgp-sha1"; protocol="application/pgp-signature"; boundary="=-4+uPgOPM0gx6tzkujU2W" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 X-Provags-ID: V03:K0:XjJAY0vWCI8A8zyJrKHueQ1bx3kdoK4FG2FiiApD3Y0mK9M+dEu Ylx+E13xhoo6V1zGDTajdzhtCbWRuPTn4641y7WN9gaVFWyJSEs0h3ACsR2IciVJGbj4k61 9xfYAZIF793wzxcsLWD2tWcbaIfRAsgtd/Ftyqtxv0XNrG5fMFaOXTNFyA8kfvLGuBgw5I/ MdYR9549etxc8vWZXXMog== X-UI-Out-Filterresults: notjunk:1;V01:K0:FqTIjrKyUcw=:jxNom0IMS/viqCZlG5JDXE yAl/bIYCnySKocZ6gBoc4RyMU0Wh0oQzSDCXviGNhvG/JmzJbNeAZvDPZAi69/6IeaxMAiB4p fC/CL5ndG8gCUlljI8A55gFwu1t1t8Ze3KA1XtsLHxmUCfFn3w0UQhJmr5wEYVqs4GaO5RB7T PoRSN/1PHqZLyoVQ2Yv1PuXXiR3x0TbWF6xB491loUzES2/EgQoseDZ88nJKakv5bL7Z8au4B 5vp1PX79zVsMoqlNOgfTwazbJK0gb8oBaNAIS8R8ROcvlDeB0izIZ10jGnw+kYQngcRirHPro Zaj20oMFT82T+POpRaz+MzlryretZ5PWj6h8jPlECUsJERlpHUg3rDeSjN+xzJlrUx1V8CReP wM7hc80PRKuqNyCcTi4zg5vgW4PzZuhylllOwRibHxV1EIgwG92fuBUifnCd9aie03VrSTD9g NtClpb0V5fRhLjJAbU5VCE/+/uU19HpJmuSGA42ph+y58O+hNOYRkXcHjQbxfDv3ADsCNBr/V nDGJRYl8CV/bRpxZ42MyYjHHisJa1+q4en7kPaWmhDdNJiiU5Zi3cSPUyxcBWIlzvwebKUidI AKgSLFSnAHSajyfOptEKaWNWAhqjbsjseoRti3176JTeKimdipNP6dWgPNkL3CK031zmL/QSE VxBOk1Bqyp96aZU8lM4mDYxPVcq5F8AEYmYxEltVuLzNnW+kgIcXeKBJGUvQ5ocQS9L4= Subject: Re: [Caml-list] Interface(.mli) location --=-4+uPgOPM0gx6tzkujU2W Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable Gabriel, there is in deed an issue, because when you compile a .ml file and there is no .cmi file in the same directory, a new .cmi is created (even if the .cmi is in the search path - compilation units must be in the same directory). This situation might be considered as an error by the compiler. Gerd Am Montag, den 08.08.2016, 19:03 +0200 schrieb Gabriel Scherer: > 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). >=20 > On Mon, Aug 8, 2016 at 6:09 PM, wrote: > > > > It appears that .mli ought to always reside in the same directory > > corresponding .ml lives in. Here's a simple shell script to illustrate > > (probably a good idea to run inside freshly created temporary > > directory): > > > > #!/bin/sh > > set -x > > rm -fr a* d > > > > touch a.ml > > ocamldep a.ml > > ocamlc -c a.ml || echo no cookie 1 > > ls > > rm -f a* *.cm* > > > > touch a.ml a.mli > > ocamldep a.ml > > ocamlc -c a.ml || echo no cookie 2 && ls > > ocamlc -c a.mli && ls > > ocamldep a.ml > > ocamlc -c a.ml || echo no cookie 3 && ls > > rm -f a* > > > > mkdir -p d > > touch a.ml d/a.mli > > ocamldep -I d a.ml > > ocamlc -I d -c a.ml > > ls > > > > Transcript: > > + rm -fr 'a*' d > > + touch a.ml > > + ocamldep a.ml > > a.cmo : > > a.cmx : > > + ocamlc -c a.ml > > + ls > > a.cmi > > a.cmo > > a.ml > > repro.sh > > + rm -f a.cmi a.cmo a.ml a.cmi a.cmo > > + touch a.ml a.mli > > + ocamldep a.ml > > a.cmo : a.cmi > > a.cmx : a.cmi > > + ocamlc -c a.ml > > File "a.ml", line 1: > > Error: Could not find the .cmi file for interface a.mli. > > + echo no cookie 2 > > no cookie 2 > > + ls > > a.ml > > a.mli > > repro.sh > > + ocamlc -c a.mli > > + ls > > a.cmi > > a.ml > > a.mli > > repro.sh > > + ocamldep a.ml > > a.cmo : a.cmi > > a.cmx : a.cmi > > + ocamlc -c a.ml > > + ls > > a.cmi > > a.cmo > > a.ml > > a.mli > > repro.sh > > + rm -f a.cmi a.cmo a.ml a.mli > > + mkdir -p d > > + touch a.ml d/a.mli > > + ocamldep -I d a.ml > > a.cmo : > > a.cmx : > > + ocamlc -I d -c a.ml > > + ls > > a.cmi > > a.cmo > > a.ml > > d > > repro.sh > > > > In essence: if one needs a variant build with some module providing the > > same interface but different implementations (in different directories) > > ocaml(c|opt|dep) will force this person to have the same (stable and > > unchanging) .mli in those implementation specific directories. > > > > Section 2.5 of the manual does not specify the relative file-system > > locations of interface/implementation files, but typing/typemod.ml, if I > > am reading it correctly, forces specific layout. > > > > So it would have been nice to either lift this restriction (i.e. have > > ocaml[c|opt|dep] look inside -I supplied directories or spell out the > > requirements in the documentation. > > > > -- > > mailto:moosotc@gmail.com > > > > -- > > Caml-list mailing list. Subscription management and archives: > > https://sympa.inria.fr/sympa/arc/caml-list > > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > > Bug reports: http://caml.inria.fr/bin/caml-bugs >=20 --=20 ------------------------------------------------------------ Gerd Stolpmann, Darmstadt, Germany gerd@gerd-stolpmann.de My OCaml site: http://www.camlcity.org Contact details: http://www.camlcity.org/contact.html Company homepage: http://www.gerd-stolpmann.de ------------------------------------------------------------ --=-4+uPgOPM0gx6tzkujU2W Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAABAgAGBQJXqL18AAoJEAaM4b9ZLB5TGJ4H/jlJWmW50izVPBSah6iq1Z7f dXpafzNg9566saeecKhQZvOwK2JvNOddxxzLtjFjgQguwG8MkbQ5KQhWjmcehiT8 wAZUr4pdIL+dGMJQ1WT1G6Vvm7l2nSF/6Dl90BhAXZrcxXhgemoQYmhk0TOHYBt/ COWjJsKhbl1r5sQnfcCJuqlHeRsywgjKQpfK6IEGfz+0p7cuiTcRcflaHeYyDe2E wP0RkSsOnrST57XmwJecXw9D0UwPdFyv0NT+iQkPmvTNho2jfnnBVgafI+qm6j4R 4USYI01vr1E89IosqoitR4kaR6xiU5js5xyQC6YQA3byM4DkMX5ByBz6DTp+N18= =FHBe -----END PGP SIGNATURE----- --=-4+uPgOPM0gx6tzkujU2W--