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 7FD5B7FF50 for ; Mon, 8 Aug 2016 20:57:08 +0200 (CEST) IronPort-PHdr: 9a23:kjqXix/p/7sDA/9uRHKM819IXTAuvvDOBiVQ1KB91u0cTK2v8tzYMVDF4r011RmSDN2duqoP0rCH+4nbGkU4qa6bt34DdJEeHzQksu4x2zIaPcieFEfgJ+TrZSFpVO5LVVti4m3peRMNQJW2WVTerzWI4CIIHV2nbEwud7yzS9aZ1p7mn8mJuLTrKz1SgzS8Zb4gZD6Xli728vcsvI15N6wqwQHIqHYbM85fxGdvOE7B102kvpT41NdZ/i9Ro/Ms8dJbGeW/JvxgDO8QMDNzH2kr5cGjnB3HVgyX/jNIXn8f1xxFHBPt6RzmV4ztuyD58OF63X/JE9fxSOUxXjO56LtgYBDtgSYDcTU+9TKEwvdshb5W9Ury7yd0xJTZNcTMbKJz 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-f50.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.50; 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.50 as permitted sender) identity=mailfrom; client-ip=74.125.82.50; 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-f50.google.com) identity=helo; client-ip=74.125.82.50; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="moosotc@gmail.com"; x-sender="postmaster@mail-wm0-f50.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AfAQBo1ahXhjJSfUpdhBt8uRiBfRyGAQKBQDoSAQEBAQEBAQERAQEBCAsLCRkvgjIEARMBghMBAQQBAREuARsYBQEDAQsGBQsDCgkeBw8BBA0CEQEFAQsXExoIh3QBAw8IBKUUgTI+MY0lglsFhksKGScNVINaAQEBAQEBAQMBAQEBAQEZAgYQhA+DNYMjgkOHWAWPCYl8NIxPgjuJR4V8iC0hhh4xgQ8kAYJSgVprh18BAQE X-IPAS-Result: A0AfAQBo1ahXhjJSfUpdhBt8uRiBfRyGAQKBQDoSAQEBAQEBAQERAQEBCAsLCRkvgjIEARMBghMBAQQBAREuARsYBQEDAQsGBQsDCgkeBw8BBA0CEQEFAQsXExoIh3QBAw8IBKUUgTI+MY0lglsFhksKGScNVINaAQEBAQEBAQMBAQEBAQEZAgYQhA+DNYMjgkOHWAWPCYl8NIxPgjuJR4V8iC0hhh4xgQ8kAYJSgVprh18BAQE X-IronPort-AV: E=Sophos;i="5.28,491,1464645600"; d="scan'208";a="229363346" Received: from mail-wm0-f50.google.com ([74.125.82.50]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 08 Aug 2016 20:57:07 +0200 Received: by mail-wm0-f50.google.com with SMTP id f65so133941094wmi.0 for ; Mon, 08 Aug 2016 11:57:07 -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=lgKD5oc7O4RhYJ3KVPF0RUia2ciCjU+yV4UnkPWIfZs=; b=lav3d9t1/xcqftNLNwWzm6GVi32/M25brBa6oi6Bm5k5/PaPMrQuIQaG57kuKSi8M6 xyvzvsDBVNm1HGIUTqs0oTxkjyc+x1GCMrzRgD3BIznSQsGGEEEN+Qoj5lYtzB7MCTXF 5TIE+okM6CkCUFtZVlRHHBJ/nJVvG1Y1NrzuudTjvAFsMXNZSoC16wI/GQqMHnG7nhwr E+Ng7fPH6lUzD/tNR0jcFlJ3PEzISzupdovb3cEWfUCo0XVYUJYQaMwT6RwzAqQ21ZJ6 7AYXWusD50Xy1APKabE0Vwh5RK3dQak61ujw1Mz7T74cnY5MIIi7euIq+7m9a6GBql8E 6b9Q== 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=lgKD5oc7O4RhYJ3KVPF0RUia2ciCjU+yV4UnkPWIfZs=; b=e9dXmR/sQwOzw1lkP/njwI14WBMpD0/ozvQyZNExUwefMuD6v08WxsLWY7bQ3qGe0r iug+nK+klklivWODtlQ6EZFK1E70O7ZcTulou0Vgxd5GhDpYcwgX3gCJmKb7aDzfswdM GdSrGJeRxhVW1F7krCj2//GUqP4CDEEaWmXJyhuo3elj2lFyKRtYGSxSU59gvWBcqXkv khVzT/Xr1TAHhkiSFw/kwepuEYaZ1H11xXXz0/REhfsvhPuhNlPM5d9VtG6vPHd2BGhr jSJZT/5mEOgDf84wKWd9/YMqxyW7DsOBbsRcW3opNRozMP13K2Ga0gu3etoVnzj/DKPB j3gw== X-Gm-Message-State: AEkoouv8fcegIBAhyQup5S4s47uGPhOSpswNFegIn7Trqdwp5uI97APnQdtDw3Zb4tYjlQ== X-Received: by 10.25.139.214 with SMTP id n205mr23464142lfd.84.1470682627325; Mon, 08 Aug 2016 11:57:07 -0700 (PDT) Received: from linmac2 ([188.123.252.212]) by smtp.gmail.com with ESMTPSA id f64sm5778407lfi.36.2016.08.08.11.57.06 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Aug 2016 11:57:06 -0700 (PDT) From: moosotc@gmail.com To: David Allsopp Cc: Gabriel Scherer , caml users References: <8737mfp7j3.fsf@gmail.com> <87y447npv3.fsf@gmail.com> Date: Mon, 08 Aug 2016 21:57:05 +0300 In-Reply-To: (David Allsopp's message of "Mon, 8 Aug 2016 18:30:03 +0000") Message-ID: <87r39znl6m.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: >> 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. > > Gerd is right that it's not so great that the compiler ignores d/a.cmi > and still generates the automatic a.cmi (though I'm not convinced it's > an error, personally). The automatic .cmi files are a pain in other > areas (it's a nuisance in build systems, as it makes parallelisation > harder). I'd have preferred to have something like ocamlc -ci a.ml > being roughly equivalent to: > > $ ocamlc -i a.ml > a.mli > $ ocamlc -c a.mli > $ rm a.mli > > and the "gotcha" of forgetting to run ocamlc -ci a.ml being the first > lesson in always producing .mli files, but it's a bit late for changes > that :o) > > > David > -- mailto:moosotc@gmail.com