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 0E98A7FF50 for ; Mon, 8 Aug 2016 18:09:24 +0200 (CEST) IronPort-PHdr: 9a23:h2ESZhBCK7tcHCYnKpOcUyQJP3N1i/DPJgcQr6AfoPdwSP76pMbcNUDSrc9gkEXOFd2CrakV06yH6+uxAyQp2tWoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6kO74TNaIBjjLw09fr2zQd+KyZXvnLHos7ToICxwzAKnZr1zKBjk5S7wjeIxxbVYF6Aq1xHSqWFJcekFjUlhJFaUggqurpzopM0roGxsvKcq/stEFKH7ZLgQTLpCDT1gPXpmytfssEzGSgyU4WcXemoTmxtMRQPC6UKpFqztuzf347IukBKROtf7GOg5 Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=moosotc@gmail.com; spf=Pass smtp.mailfrom=moosotc@gmail.com; spf=None smtp.helo=postmaster@mail-wm0-f54.google.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of moosotc@gmail.com) identity=pra; client-ip=74.125.82.54; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="moosotc@gmail.com"; x-sender="moosotc@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of moosotc@gmail.com designates 74.125.82.54 as permitted sender) identity=mailfrom; client-ip=74.125.82.54; receiver=mail3-smtp-sop.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 (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-wm0-f54.google.com) identity=helo; client-ip=74.125.82.54; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="moosotc@gmail.com"; x-sender="postmaster@mail-wm0-f54.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0A2AQBjrahXhjZSfUpdhBt8uROBfRyHQToSAQEBAQEBAQERAQEBCAsLCRkvgjIWgi8uARseAxIQFh4WAQQNAhEBBQELKiKHdAEDFwSiUYIHgTI+MY0lglsFhkQKGScNVIQMAgYQjSqCSYUPBY8JiXw0hh2GMoI7gjmHDoV8iC0hhh4xgQ8lDYJFgVprhhoqgRsBAQE X-IPAS-Result: A0A2AQBjrahXhjZSfUpdhBt8uROBfRyHQToSAQEBAQEBAQERAQEBCAsLCRkvgjIWgi8uARseAxIQFh4WAQQNAhEBBQELKiKHdAEDFwSiUYIHgTI+MY0lglsFhkQKGScNVIQMAgYQjSqCSYUPBY8JiXw0hh2GMoI7gjmHDoV8iC0hhh4xgQ8lDYJFgVprhhoqgRsBAQE X-IronPort-AV: E=Sophos;i="5.28,490,1464645600"; d="scan'208";a="187200903" Received: from mail-wm0-f54.google.com ([74.125.82.54]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 08 Aug 2016 18:09:23 +0200 Received: by mail-wm0-f54.google.com with SMTP id f65so126193415wmi.0 for ; Mon, 08 Aug 2016 09:09:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:user-agent:mime-version; bh=kmNMu8P2s8et2rzH6c1Z1qwUq6Q4PIoSdQQd+67YhQs=; b=Pdf41P4y2/d2jSUsnl43ef/Pk01zQTaJh2OkwlcA/z3zqRRY59fFKScbng/WNcUyEr Jne8RJtHnrNeSIms0NfrkeDBrJ/5NFHRbfCcmvQgiMaEPBkng4ZIW7QSXyX6kIQ/+xAT ZC2UVlyCmEIUM0Rb/4bdYpPl3yhjjoyvDotmgYqJPZMsJicLZoClWVqU2YafzNvVroYG rmZLn6epzblf0jsPdg6TM4WpyKFeyYPg1cntcIUMhVp7ElrzAsQvqrAv9NyGp8w3qeji wOGGRx3c9uVzb9g/7C1CI6J4d5YQ/vbEsnt4MGGJnx1GKOUKLNUPoYVzSGU+s/3ckfEH pJBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:user-agent :mime-version; bh=kmNMu8P2s8et2rzH6c1Z1qwUq6Q4PIoSdQQd+67YhQs=; b=F/gHJ55UZVrewAddpMoBEXGs0gLnHEoHnTpws5euAy2KvCeDb68poxSl5khdE2X5XZ /XGkqsBC0TWNaLxMOF/zvPxAIw2jEigmfzgmHPRjF5XOnxhCREpHQFoImmHMKxT8ujsN 77iGaIDyK0pCliiYafvJx8cRxvwl5EHMLzHQOEDDujhRXSyUF32uDmPEAiIZVU58c+hT DFxhsiA9XT3LkfPI/pFOlCqaoogcIezn35Ix/dR6USJ9RgqipEC9Z/DfwVenMVceImcq PC754IiaEmltoqX165ijQ9zI7C/vpZLEI4+SpNDTysNPstx+J+W3fRQIge0aCuko1xmB 6b8A== X-Gm-Message-State: AEkoouubMFpJYgCoL6950DVV1QKhul6SI77mkNL99uoJX1lYKcA6hH5cTBMHmpGf21yCIw== X-Received: by 10.25.142.203 with SMTP id q194mr23852363lfd.11.1470672560704; Mon, 08 Aug 2016 09:09:20 -0700 (PDT) Received: from linmac2 ([188.123.252.212]) by smtp.gmail.com with ESMTPSA id 205sm5887446ljj.47.2016.08.08.09.09.04 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Aug 2016 09:09:05 -0700 (PDT) From: moosotc@gmail.com To: caml-list@inria.fr Date: Mon, 08 Aug 2016 19:09:04 +0300 Message-ID: <8737mfp7j3.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: [Caml-list] Interface(.mli) location 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