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 1148F7F72A for ; Tue, 9 Aug 2016 12:57:40 +0200 (CEST) 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: A0AAAQAftqlXhjJSfUpdhBt8uSSBfRyGAQKBSToSAQEBAQEBARIBAQEICwsJGS+EXgEBBAEBES4BGxgFAQMBCwYFCwMKCR4HDwEEDQIRAQUBCxcTGgiHdAEDDwgEpHOBMj4xjSWCWwWGUAoZJw1Ug1oBAQEBAQEEAQEBAQEaAgYQhA+GWIJDh1gFiB6Ga0WJNzSMT4I7iUeFfIgtIYYeMYEPJQOCT4Faa4dNAQEB X-IPAS-Result: A0AAAQAftqlXhjJSfUpdhBt8uSSBfRyGAQKBSToSAQEBAQEBARIBAQEICwsJGS+EXgEBBAEBES4BGxgFAQMBCwYFCwMKCR4HDwEEDQIRAQUBCxcTGgiHdAEDDwgEpHOBMj4xjSWCWwWGUAoZJw1Ug1oBAQEBAQEEAQEBAQEaAgYQhA+GWIJDh1gFiB6Ga0WJNzSMT4I7iUeFfIgtIYYeMYEPJQOCT4Faa4dNAQEB X-IronPort-AV: E=Sophos;i="5.28,494,1464645600"; d="scan'208";a="229427872" Received: from mail-wm0-f50.google.com ([74.125.82.50]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 09 Aug 2016 12:56:54 +0200 Received: by mail-wm0-f50.google.com with SMTP id o80so26326506wme.1 for ; Tue, 09 Aug 2016 03:56: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=kQsQDnUmNyfVw0WdAVDTyFyUxdrYklPws9N3W0stcJI=; b=dFamHOWCGMPN9Sw9ftsS89dc29+v8/zEPHdWz5nJ6LU50ni6kEnBSo/Qd++vSjMuig ARSdx9hQiqh/psFDsHZWQo+HOP1cGyfeKVPUNcBPFSMQ0vFni2LZwVRFCbD0Vx6J0BkT ZK6D3ORG0PyZ5wk4oraCKbq+atdw/4+YH/DTp49B9P6JhC3433QSTTE0ZmOmUxbo1T+N 5yATgSXzb/ZbC9QmvcyM3QaRyo3/xUmWg5nAtwG7YBGBxJZdzhJFKAum62N656fRM7he /N1L/0G20dKcgTWFNNj+oI/quqBSr/epUIRFMG/eGWJIzFBMEwaEUSBeEa8Ew/eINR7f vt5Q== 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=kQsQDnUmNyfVw0WdAVDTyFyUxdrYklPws9N3W0stcJI=; b=RxLpwZtG7VSO6LT7MfLhnf/RlQcuevzpAjtC0ZkXZn1bIKn7LlVb5g3MtBLsuViIDZ IPkxYescCd2aRSHpoIkUCeiRr1WudKYaUBgz15X4MFGlXE4rZgE03x2FfNkDUAhF5VEK SV7Izhl/8qFqFkGLe4iRA9QC5zlfTZSpcimNoqzKZx9/XdYLqErKdfhOl5HFERLKDnz0 ZoGnfCAyjJhzxl0DKTGf4j2Z5unADmtQomfJwsD4CaoTeDPoVnGXxzZyLDYeQhkxV2rB +7cr/7bclaey6ztVZPYUC3ZmQNF2GGy4DGDsBV7jdba/8C29OHZMyyKrXBKhM+apcZSi xJ9w== X-Gm-Message-State: AEkoouvyL5dxeXGiX81KbVFUAHAl3pqO3A9wt8e5dW5ZZgk2jnZzwQ78/S27bhvSsEmoqA== X-Received: by 10.46.0.17 with SMTP id 17mr25970781lja.54.1470740214169; Tue, 09 Aug 2016 03:56:54 -0700 (PDT) Received: from linmac2 ([188.123.252.212]) by smtp.gmail.com with ESMTPSA id d11sm6479745lfe.13.2016.08.09.03.56.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Aug 2016 03:56:53 -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> Date: Tue, 09 Aug 2016 13:56:52 +0300 In-Reply-To: (David Allsopp's message of "Mon, 8 Aug 2016 22:54:45 +0000") Message-ID: <87k2fqcirv.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: >> >> 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? > > 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? -- mailto:moosotc@gmail.com