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 E55707F72A for ; Tue, 9 Aug 2016 20:35:23 +0200 (CEST) IronPort-PHdr: 9a23:+dqgNBPBe5l0OEnu2XMl6mtUPXoX/o7sNwtQ0KIMzox0KPvyrarrMEGX3/hxlliBBdydsKMdzbKP+Pu5ESxYuNDa4ShEKMQNHzY+yuwu1zQ6B8CEDUCpZNXLVAcdWPp4aVl+4nugOlJUEsutL3fbo3m18CJAUk6nbVk9GO35F8bogtit0KjqotuIMlwO3GP2Ouo6bE3v616A7o9O2coqA51y4yOBmmFPdeVSyDEgDnOotDG42P2N+oV++T9bofMr+p0Ie6z7e6MlUe4QV2x+YCgdrffmvhjbTAaJ+mBUEiBPykIJUED560TWV4nwvmPTsu5m3zGCdZn6V7lxXzm99I9uRQPhkzsOPD1/+2bS3J9elqVe9RemoAd434X8b4ScNf44daTYLoBSfnZIQssED38JOYi7dYZaSrNZZes= 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-f51.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.51; 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.51 as permitted sender) identity=mailfrom; client-ip=74.125.82.51; 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-f51.google.com) identity=helo; client-ip=74.125.82.51; receiver=mail2-smtp-roc.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: A0B4AgBBIapXhjNSfUpdhBt8pGeUPYF9JIV5AoFMORMBAQEBAQEBAREBAQEICwsJGS+CMgQBEwGCEwEBBAEBES4BGx0BAwELBgULAwoJHgcPAQQNAhEBBQELFxMaCId0AQMPCAQKozWBMj4xjSWCWwWGSAoZJw1Ug1gBAQEBAQEEAQEBAQEaAgYQhA+FVYEDgkOHWAWIHoZrRYk3NIYdhjKCO4I5hw6FfIgtIYYeMYEPHwGCRxALgU9rAYcrAQEB X-IPAS-Result: A0B4AgBBIapXhjNSfUpdhBt8pGeUPYF9JIV5AoFMORMBAQEBAQEBAREBAQEICwsJGS+CMgQBEwGCEwEBBAEBES4BGx0BAwELBgULAwoJHgcPAQQNAhEBBQELFxMaCId0AQMPCAQKozWBMj4xjSWCWwWGSAoZJw1Ug1gBAQEBAQEEAQEBAQEaAgYQhA+FVYEDgkOHWAWIHoZrRYk3NIYdhjKCO4I5hw6FfIgtIYYeMYEPHwGCRxALgU9rAYcrAQEB X-IronPort-AV: E=Sophos;i="5.28,495,1464645600"; d="scan'208";a="229468058" Received: from mail-wm0-f51.google.com ([74.125.82.51]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 09 Aug 2016 20:35:23 +0200 Received: by mail-wm0-f51.google.com with SMTP id q128so50045569wma.1 for ; Tue, 09 Aug 2016 11:35:23 -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=rIJikpUj0VyAu+OhO2YSpr214bLOEZkPJA2eylVq/tM=; b=0WOo3v+s8XruqLp8jaQfGTnsU2vrfFtWtt39BrLY8gHhOKnx1Zzm7lCzUVxHuLZiVw uvGH0WPfY99sTzUvlbQcUajAP2HTvBOrVBO2u4vTY9zLHmJcbe9vyZHkhsBagFsUrOQ9 C0Qv/5Pf7+wOZCqIU9i7qG6Nc8TeA75GZoRdj0cmfgMPvcH9seL45zU7zGz6sqkHdkRn UXm71q6Cg6ZVCDQGEpn+n6QY+amYLUOsSu1hKVmET7XUQVMGDjcYnePeK4g/E2JBOBuo BFgDDN1VncR15rbV13+9ClFi47k80qSU6IDFXonqbKX4B8Ij6r5c+7fmAtfa5ZGkQjbq g5JQ== 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=rIJikpUj0VyAu+OhO2YSpr214bLOEZkPJA2eylVq/tM=; b=Afhb2cIFv7S9eevlKkPibHCTkXvvsYgqDBn84LBarpCVeFaxT3T+hl70w0n7DiU8YA 55Q8jmmF4Nfmk9ovLWN0eSJYj4wqYARc/E/Uw5aUz0bdyNOZfbchyiNu1ibAOH1gIpWv nr5KqlES59XfyyHt2AbJLnDPp2c9shHQDNjAvsDFc2tWuCe5X3gMV13Bru1kcD9ndlZR m3arZs/jM40pw4tIQsz54WNxcTrNXv8cW4z1wXHIpAl/jTETdjc2hZoRmMEMlKKRg0PC CPnDhQb78RhRkbTe/WxKQmG91If6XGsVX3zRT1QwMIY0LPRbNS+lVNuxaYo02ak38SWi xPCg== X-Gm-Message-State: AEkoouuD/KlO3hVPjeNT/v+oE2yhDI5U7VK2oS0c3pu/MCZAiJ+p2/sF/BvrvmZ6RmCpdw== X-Received: by 10.25.208.203 with SMTP id h194mr31775459lfg.191.1470767723041; Tue, 09 Aug 2016 11:35:23 -0700 (PDT) Received: from linmac2 ([188.123.252.212]) by smtp.gmail.com with ESMTPSA id i5sm2728167lfe.40.2016.08.09.11.35.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 09 Aug 2016 11:35:22 -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> Date: Tue, 09 Aug 2016 21:35:21 +0300 In-Reply-To: (David Allsopp's message of "Tue, 9 Aug 2016 18:08:17 +0000") Message-ID: <87vaz9bxjq.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: >> 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. > >> > Also, consider this: >> > >> >> Better this (with safety nets in form of added -Is) >> >> [malc@linmac2 mli]$ cat repro2.sh; sh repro2.sh >> #!/bin/sh >> set -x >> rm -fr a* d o >> >> mkdir -p o d >> >> echo 'type a = int and b = int' >a.ml >> echo 'type a = int' >d/a.mli >> >> ocamlc -c -o o/a.cmi d/a.mli >> md5sum o/a.cmi >> ocamlc -I o -I d -c -o o/a.cmo a.ml >> md5sum o/a.cmi >> + rm -fr 'a*' d o >> + mkdir -p o d >> + echo 'type a = int and b = int' >> + echo 'type a = int' >> + ocamlc -c -o o/a.cmi d/a.mli >> + md5sum o/a.cmi >> dddf074fdfa94cad226485870c617116 o/a.cmi >> + ocamlc -I o -I d -c -o o/a.cmo a.ml >> + md5sum o/a.cmi >> bc44d889df40c61e43dbd94535ffd614 o/a.cmi >> >> [..snip..] > > This, again, is just the compiler acting exacting as it says it > should! When you compile o/a.ml, ocamlc looks for ./a.mli and because > it doesn't find it, it overwrites o/a.cmi (because of the -o switch). But .mli does exist in -I d and .cmi in -I o... I suppose arguing all of this is pointless, but I do stand by my assertion that his behavior is underspecified. -- mailto:moosotc@gmail.com