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 6EB227FF50 for ; Mon, 8 Aug 2016 21:59:55 +0200 (CEST) IronPort-PHdr: 9a23:QHRmVRB5eZreJuj/MaSzUyQJP3N1i/DPJgcQr6AfoPdwSP7+oMbcNUDSrc9gkEXOFd2CrakV06yH6+u5BTVIyK3CmUhKSIZLWR4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TWM5DIfUi/yKRBybrysXNWD14Lmj6vrp8SbSj4LrQL1Wal1IhSyoFeZnegtqqwmFJwMzADUqGBDYeVcyDAgD1uSmxHh+pX4p8Y7oGx48sgs/M9YUKj8Y79wDfkBVGxnYCgJ45jHvAfCQUOm4n8HVX0O2k5EGQGA6hzlRb/0vzfzrfZ00yrcNsrzG+MaQzOnuqJsTwTvlCwvODsw8WWRgct13/ETmw6ouxEqm92cW4qSLvcrO/qFJd4= 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-f51.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.51; 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.51 as permitted sender) identity=mailfrom; client-ip=74.125.82.51; 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-f51.google.com) identity=helo; client-ip=74.125.82.51; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="moosotc@gmail.com"; x-sender="postmaster@mail-wm0-f51.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AfAQCB46hXhjNSfUpdhBt8uRmBfRyGAQKBQDkTAQEBAQEBAQERAQEBCAsLCRkvgjIEARMBghMBAQQBAREuARsYBQEDAQsGBQsDCgkeBw8BBA0CEQEFAQsXExoIh3QBAw8IBKUdgTI+MY0lglsFhkwKGScNVINaAQEBAQEBAQMBAQEBAQEZAgYQhA+GWIJDh1gFjwmJfDSMT4I7iUeFfIgtIYYeMYEPIAOCVIFaa4dfAQEB X-IPAS-Result: A0AfAQCB46hXhjNSfUpdhBt8uRmBfRyGAQKBQDkTAQEBAQEBAQERAQEBCAsLCRkvgjIEARMBghMBAQQBAREuARsYBQEDAQsGBQsDCgkeBw8BBA0CEQEFAQsXExoIh3QBAw8IBKUdgTI+MY0lglsFhkwKGScNVINaAQEBAQEBAQMBAQEBAQEZAgYQhA+GWIJDh1gFjwmJfDSMT4I7iUeFfIgtIYYeMYEPIAOCVIFaa4dfAQEB X-IronPort-AV: E=Sophos;i="5.28,491,1464645600"; d="scan'208";a="187213359" Received: from mail-wm0-f51.google.com ([74.125.82.51]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 08 Aug 2016 21:59:54 +0200 Received: by mail-wm0-f51.google.com with SMTP id f65so136655298wmi.0 for ; Mon, 08 Aug 2016 12:59:54 -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=sJb6CPzVfBLhYji7Aeiej7Cb3PFXF79Mx9l0FLeAvvA=; b=hDtT7TqlVE9s9wtktpYD0cLUC5eolXwqND1R4oP6QRKN7NirSZH0Gswy64cAZlB/2a uQCHhC9ODbiQDLIH6Hhl84NHAVTgod4iHzqnrxU2OoHbAWv/gWnIiTsMfjkYnFESFhUZ oImhrXfCKMP4F4H7PCC7pMjbaPBE0kkk+ksqshBWboYDWwN1Bezwjjqe/CYN1kRK9E79 LKyn42D8GlY5xajQzVBXAqv3j19neoFXx6HtMmSSccDsdbizguC2Fq1QJ++RHLwePAVC cF38i/qZKhkbHZSkLXGBJY2ENFeoD0H0S5JBgwjcjHjFA4DICWR4l/rOOQHKAYzYudNh 1ZZA== 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=sJb6CPzVfBLhYji7Aeiej7Cb3PFXF79Mx9l0FLeAvvA=; b=b1F5Yr+ywzHkrzO0d5T2pPIN6Sc4dsBPs9maIeDRGL8XX7MfVvUcS1ZSeufVyCrHvO tNJIbLl0/e19Oxozb6rsTn+KSbSipGuYKi+dCEUs9c+R7WBXfQhxmRsiPQFQaHD6342e JcyqCU8K0/29CCmqAjQKfhl3a8ZUVAI5FhLJqYBdBSJ/5f23BvzqUVsQrLex1V32sSCU un3jRDHOhT+nSyVA/V2gm7mMDK7fezv/ZHiRBM/pIa3YqTsuqpldZmoHo2O11B2gJQFS gpcBOlkYXgKd0jbsvC05T7/Q5kejojWW1Oz0KlxgKpRFcIOHgZT3jJsM5CNikUF4Wx5h O6Ag== X-Gm-Message-State: AEkoouvPZsAmr/kJZQ/hCKys4i0SOOjO0rFJdu6Btd2lbeaOG7J+JiaqF/m9pGTYIjIJyQ== X-Received: by 10.25.133.212 with SMTP id h203mr30280935lfd.28.1470686393328; Mon, 08 Aug 2016 12:59:53 -0700 (PDT) Received: from linmac2 ([188.123.252.212]) by smtp.gmail.com with ESMTPSA id s3sm5920833lja.35.2016.08.08.12.59.52 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Aug 2016 12:59:52 -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> Date: Mon, 08 Aug 2016 22:59:51 +0300 In-Reply-To: (David Allsopp's message of "Mon, 8 Aug 2016 19:39:16 +0000") Message-ID: <87mvknnia0.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: >> >> 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. > > Indeed - but that's the correct documented behaviour, even if not > necessarily the ideal. There are various things you can do: > > a) Delete ./a.cmi as part of your build procedure. This isn't ideal, > though, because you lose the type-checking against d/a.cmi > b) Have an empty ./a.mli but never compile it - the compiler will then > unify ./a.cmo against d/a.cmi. This isn't ideal because having a > source file which you don't expect to compile will confuse dependency > generators and automatic build rules. > c) Implement a new option in the compiler driver which suppresses the > automatic generation of .cmi files (e.g. ocamlc -c -I d -no-cmi a.ml) d) Make the compiler skip generation of .cmi if it sees one in the -I directories? > > > David -- mailto:moosotc@gmail.com