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 389DD7F72A for ; Tue, 9 Aug 2016 21:55:25 +0200 (CEST) IronPort-PHdr: 9a23:vZNPBhV23vVKvinEaVfRRyPTevHV8LGtZVwlr6E/grcLSJyIuqrYZhOOt8tkgFKBZ4jH8fUM07OQ6PG5HzRZqsrQ+DBaKdoXBkdD0Z1X1yUbQ+e9QXXhK/DrayFoVO9jb3RCu0+BDE5OBczlbEfTqHDhpRQbGxH4KBYnbr+tQt2asc272qiI9oHJZE0Q3XzmMOo0dEz98VSZ9pFPx9AzcuBpklqBi0ALUtwe/XlvK1OXkkS0zeaL17knzR5tvek8/dVLS6TwcvdwZ7VZCDM7LzJ9v5Wz5lHrBDGC7XoEU2gQjgEAQ02ctEm7Dd/NtX7Wv/R81GGzOcntSqgsEWCu9a4uThL3kw8COiIw633egc82h6Ve9kGPvRt6lovTZ5qSKPFWcabUfNdcTm1EDZUZbDBIHo7pN9hHNOEGJ+sN6tCl/1Y= Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=moosotc@gmail.com; spf=Pass smtp.mailfrom=moosotc@gmail.com; spf=None smtp.helo=postmaster@mail-wm0-f41.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of moosotc@gmail.com) identity=pra; client-ip=74.125.82.41; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="moosotc@gmail.com"; x-sender="moosotc@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of moosotc@gmail.com designates 74.125.82.41 as permitted sender) identity=mailfrom; client-ip=74.125.82.41; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="moosotc@gmail.com"; x-sender="moosotc@gmail.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@mail-wm0-f41.google.com) identity=helo; client-ip=74.125.82.41; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="moosotc@gmail.com"; x-sender="postmaster@mail-wm0-f41.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AMAQA2NKpXhilSfUpdhBt8uSSBfSSFeQKBTjoSAQEBAQEBAQERAQEBCAsLCRkvgjIEARMBghMBAQQBAREuARsdAQMBCwYFCwMKCR4HDwEEDQIRAQUBCxcTGgiHdAEDDwgECqM3gTI+MY0lglsFhksKGScNVINcAQEBAQEBBAEBAQEBGgIGEIQPhliCQ4dYBYgehmtFiTc0hh2GMoI7gjmHDoV8iC2GPzGBDyUHgkuBWmsBhysBAQE X-IPAS-Result: A0AMAQA2NKpXhilSfUpdhBt8uSSBfSSFeQKBTjoSAQEBAQEBAQERAQEBCAsLCRkvgjIEARMBghMBAQQBAREuARsdAQMBCwYFCwMKCR4HDwEEDQIRAQUBCxcTGgiHdAEDDwgECqM3gTI+MY0lglsFhksKGScNVINcAQEBAQEBBAEBAQEBGgIGEIQPhliCQ4dYBYgehmtFiTc0hh2GMoI7gjmHDoV8iC2GPzGBDyUHgkuBWmsBhysBAQE X-IronPort-AV: E=Sophos;i="5.28,496,1464645600"; d="scan'208";a="229471874" Received: from mail-wm0-f41.google.com ([74.125.82.41]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 09 Aug 2016 21:55:24 +0200 Received: by mail-wm0-f41.google.com with SMTP id f65so51765213wmi.0 for ; Tue, 09 Aug 2016 12:55:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=ey+10tpjsxfveift/xP6ahuepyqkW/RgvgxEz1ZByo8=; b=hNJyJKS/n4vXTCTJWvII/tWzlccp4bnIf45+JGT35gFdycaMEdKnlZCG6dSjTFhEZ2 jvu+W0VH3XI4QPKG92Xohp2oCESukUGmGjwG/wrs8BLY82ApsAQIhpvkTO3fI7PEMKhe vMDnkV3i85gK0wDxWKla8Gm4aoZaVzqcNuRbqkLvHi07EtBokNPPCtdLJRWtpf0nOfVz FcO379KDz8dln3lOY/PQ/lvfp4+wbm/nW8NR2qJNdVS3B4GE3i3YVyq2vj9f/kvAGBZ5 NPsRlQ/Q22nZw2iyZeLpEIDWdF5Vm/G0n0aUYaQZtgYdGLdSI7M0ef4VLWyUpApl2yZb jMgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=ey+10tpjsxfveift/xP6ahuepyqkW/RgvgxEz1ZByo8=; b=GbF8Z0eHTBo8BMXRuGUTdmptv5GwDgHJC/IkrtsiNh8/SQ0ueGYaYRSO51yBLGXTE3 gsmpqbobS3hNc9ePFlJ+9VEO8Td4C9gVy+xpzDfbWGp+WCNWsm00TRFtGf8yzG946k2D KEp65ttBZXp1aP4M8R4GNPFPb8s/lkID18jUHJVzKCtyAx6Rmld2Ks/QjCHaq4NwPIiG JofaB0UN1aOtE7DDCJhiAM1Rmd0Yr3d5YfJT17PHxJlW2sH33kYAkiduFFpAatV0iptG lLrxo+gjftRSMdftfgEV9gjgObXXomjc2lEI6DaK/X388dJYXzCQljr9tvCHvK/0JsSX 2gDA== X-Gm-Message-State: AEkoousqOGZvKgYvAsWz0yFlkcSBEilcKsB3gqSiQTHsx9KQJZvWTq+LTHNdAGTYzg/iLg== X-Received: by 10.25.212.212 with SMTP id l203mr20683lfg.2.1470772524178; Tue, 09 Aug 2016 12:55:24 -0700 (PDT) Received: from linmac2 ([188.123.252.212]) by smtp.gmail.com with ESMTPSA id q73sm6756387lfg.17.2016.08.09.12.55.23 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Aug 2016 12:55:23 -0700 (PDT) From: moosotc@gmail.com To: David Allsopp Cc: Gabriel Scherer , caml users 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> <87vaz9bxjq.fsf@gmail.com> Date: Tue, 09 Aug 2016 22:55:22 +0300 In-Reply-To: (David Allsopp's message of "Tue, 9 Aug 2016 18:59:09 +0000") Message-ID: <87k2fpbtud.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Caml-list] Interface(.mli) location David Allsopp writes: > moosotc@gmail.com wrote: >> David Allsopp writes: >> >> > moosotc@gmail.com wrote: >> >> moosotc@gmail.com writes: >> >> >> >> > 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 checked against) and the description of -I in >> > http://caml.inria.fr/pub/docs/manual-ocaml/comp.html#sec264 explains >> > that -I only adds search directories for compiled files, not source >> > files. >> >> Thanks, but the manual is completely silent on WHERE it looks for those >> files. The issue is not trivial as there are 3 options I can readily come >> up with: >> a. current working directory >> b. base directory of -o argument >> c. a set of -I directories >> d. directory where file to be compiled lives >> >> It looks as if option d. is in effect, but nowhere it is spelled out. > > Hmm - to my taste the silence says everything required! Options b and > c are completely illogical (b would involve inferring an input > directory from an output directory and option c contradicts something > the manual does state about what -I means). Option a would be > surprising behaviour and to my mind is contradicted by the use of "x" > in italics 8.1 which to me quite reasonably reads as "change the .ml > to .mli" and so include the directory, if there is one. To expect the > compiler to look for ./foo.mli when you specified bar/foo.ml would > mean you'd changed "x". > As outlined in the original message, suppose you have the same interface but several different implementations (selected during the package configuration step for instance), let's call the module Mod. Under option d. variants (living in different directories) would each have to carry the _same_ mod.mli file in the container directory just to satisfy the compilers discovery logic. srctree/var1/mod.{ml,mli} srctree/var2/mod.{ml,mli} instead of potential srctree/mod.mli srctree/var1/mod.ml srctree/var2/mod.ml -- mailto:moosotc@gmail.com