From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 F1E2A80198 for ; Sun, 9 Jul 2017 11:48:09 +0200 (CEST) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=dra-news@metastack.com; spf=Pass smtp.mailfrom=dra-news@metastack.com; spf=None smtp.helo=postmaster@outmail148095.authsmtp.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of dra-news@metastack.com) identity=pra; client-ip=62.13.148.95; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="dra-news@metastack.com"; x-sender="dra-news@metastack.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of dra-news@metastack.com designates 62.13.148.95 as permitted sender) identity=mailfrom; client-ip=62.13.148.95; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="dra-news@metastack.com"; x-sender="dra-news@metastack.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@outmail148095.authsmtp.com) identity=helo; client-ip=62.13.148.95; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="dra-news@metastack.com"; x-sender="postmaster@outmail148095.authsmtp.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3AFdj2cRD6LLqoFhrMyn5ZUyQJP3N1i/DPJgcQr6Af?= =?us-ascii?q?oPdwSP37p8+wAkXT6L1XgUPTWs2DsrQf2rWQ6/iocFdDyK7JiGoFfp1IWk1Nou?= =?us-ascii?q?QttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXdrXKo8DEdBAj0OxZr?= =?us-ascii?q?KeTpAI7SiNm82/yv95HJbQhFgDiwbaluIBmqsA7cqtQYjYx+J6gr1xDHuGFIe+?= =?us-ascii?q?NYxWNpIVKcgRPx7dqu8ZBg7ipdpesv+9ZPXqvmcas4S6dYDCk9PGAu+MLrrxjD?= =?us-ascii?q?QhCR6XYaT24bjwBHAwnB7BH9Q5fxri73vfdz1SWGIcH7S60/VC+85Kl3VhDnlC?= =?us-ascii?q?YHNyY48G7JjMxwkLlbqw+lqxBm3oLYfJ2ZOP94c6jAf90VWHBBU95RWSJfH428?= =?us-ascii?q?c4UBAekPPelaronyu1QAohS5BQS3GOPv0yNEimPq0aEmzegsFxzN0gw6H9IJtX?= =?us-ascii?q?TZtNv7O70MUeC00abD0CnOb/dS2Tfm74jIagghquyLUL1ta8re01AjFwXbgVSe?= =?us-ascii?q?sozoJDaV2foRs2eB9OpgSfighHIkqw1rvjevwcIsh5DPi4kIxF7E8iB5z5w0Jd?= =?us-ascii?q?2+UEN7bt+kEIdQtyGHLIR6WN8tQ2ZtuCs817YIuoa7cTALxZg53RLTdvKKf5KV?= =?us-ascii?q?7h/sV+udOzN1iXJ9dL6ihRu+71KsxvD9W8WuzFpGtDdJn9jDu3wV2Rzc9MuKRu?= =?us-ascii?q?d480qk2TuC2ALe5f1BLE06iaXWJIAtz7sumZYOrEvMBCr7l1vrg6CMaEkp/PWj?= =?us-ascii?q?5f79bbX8vJCcMpd5igHgPaQqncyyGeM4MhUSX2ie4+u81bnj8VD2TbhJkvE7lq?= =?us-ascii?q?nUvIrAKsQGuq65AxRV0oM/6xanFTupzNMYnXwfIFJEfhKIkZTpNknPLfzmF/uz?= =?us-ascii?q?nlqhnC12y/3JPbDtGJHAI3jbnLfkZ7l96kpcyAQpzdBY4pJZEqwOIOjpVUPost?= =?us-ascii?q?zXEBE4MxevzubiFtp9ypkRWXmTAqCDLKzSskWE6f4oI+mJfIMVoiryK+A55/7y?= =?us-ascii?q?in80gUMScrOs3ZsTcXy4GvVmI16FYXf3mdcAEWIKvhIkQ+DwiV2CVyRTZ3eoUK?= =?us-ascii?q?4m6DE7EpqsDZ3fSYC1nLyBwCC7E4VKZm9dDVCMDG3od4aaVPoXaSOSI8phnSce?= =?us-ascii?q?Vbe7UYMh1BeutBX7y7V9NObU9DcY5trf041J5ujUiREjvRZzEt6e3inZc2BxmX?= =?us-ascii?q?8IVnkc271lokFVy1GZ0KE+jeYOUZQZ7PpMVkI+NIXA5+18EdH7HAzbNJ/dQ1+j?= =?us-ascii?q?RpCiACotZtM32d4HJUhnTYaMlBfGigajHb4Z35WPAIcz6rqUi3TrLoN7xmnd/K?= =?us-ascii?q?wsk1A9XsJENiutgasppFubPJLAj0jMz/XiTq8bxiOYsT7blWc=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0BKAQCt+mFZfV+UDT5dHQEFAQsBGAEFA?= =?us-ascii?q?QsBgmaBLYEUB451j0QBAQEGgSiWBIIRLIVwAoNJQBcBAQEBAQEBAQEBARIBAQs?= =?us-ascii?q?UCFeCMyQBgkABAQEBAgEnE08CAQgWAQEeEDIdCAIEARIIihoFCQMBC6wrOos3A?= =?us-ascii?q?QEBAQEFAQEBAQEBAQEggyiDBYQegS6EbINBgjEBBJ8eh0iMQgySFowxiQ8hAoE?= =?us-ascii?q?+MSEjXocWdodvgQ0BAQE?= X-IPAS-Result: =?us-ascii?q?A0BKAQCt+mFZfV+UDT5dHQEFAQsBGAEFAQsBgmaBLYEUB45?= =?us-ascii?q?1j0QBAQEGgSiWBIIRLIVwAoNJQBcBAQEBAQEBAQEBARIBAQsUCFeCMyQBgkABA?= =?us-ascii?q?QEBAgEnE08CAQgWAQEeEDIdCAIEARIIihoFCQMBC6wrOos3AQEBAQEFAQEBAQE?= =?us-ascii?q?BAQEggyiDBYQegS6EbINBgjEBBJ8eh0iMQgySFowxiQ8hAoE+MSEjXocWdodvg?= =?us-ascii?q?Q0BAQE?= X-IronPort-AV: E=Sophos;i="5.40,333,1496095200"; d="scan'208";a="282672431" Received: from outmail148095.authsmtp.com ([62.13.148.95]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jul 2017 11:48:05 +0200 Received: from mail-c245.authsmtp.com (mail-c245.authsmtp.com [62.13.128.245]) by punt22.authsmtp.com (8.14.2/8.14.2/) with ESMTP id v699m2gN097010; Sun, 9 Jul 2017 10:48:02 +0100 (BST) Received: from romulus.metastack.com (114.212-105-213.static.virginmediabusiness.co.uk [213.105.212.114]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2/) with ESMTP id v699m0wn033563 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 9 Jul 2017 10:48:01 +0100 (BST) Received: from remus.metastack.local (remus.metastack.com [172.16.0.1]) by romulus.metastack.com (8.14.2/8.14.2) with ESMTP id v699m0QI013010; Sun, 9 Jul 2017 10:48:00 +0100 Received: from Remus.metastack.local ([fe80::547c:3c42:e1da:eda2]) by Remus.metastack.local ([fe80::547c:3c42:e1da:eda2%10]) with mapi id 14.03.0351.000; Sun, 9 Jul 2017 10:47:59 +0100 From: David Allsopp To: Timothy Bourke , "caml-list@inria.fr" Thread-Topic: [Caml-list] ocamlc 4.03 -> 4.04: change in meaning of -i Thread-Index: AQHS9/QVLjjGuw26bkO2YBxpo0OEm6JLPPSw Date: Sun, 9 Jul 2017 09:47:58 +0000 Message-ID: References: <20170708140810.vpglvvttlfbflus4@xocuter.home> In-Reply-To: <20170708140810.vpglvvttlfbflus4@xocuter.home> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.16.0.164] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Organization: MetaStack Solutions Ltd. X-Scanned-By: MIMEDefang 2.65 on 172.16.0.20 X-Server-Quench: b282eda7-648b-11e7-801f-9cb654bb2504 X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCd1ZAARAlZZVg1f DC4bFwdFRBksPQFF ChxFJgxfNl8UURhQ KkJXbgASJgVNAnNE X3kJW1VTQFxxU2d9 YQpQIwdcYVRPXwB0 UklLXFNTEBpqBAMA SFgYWxAvd0IYeH1z YEBhEHdbVEA0J0R1 QBsARGobY2NoOn0e URVfagtUcVVXd0wX bFV7BiEPZGUDKBgV TUcAFDk0OXBbKT9J d0kKJlsXRU1DQnhk HFhHS31zWxVZFW04 LxUgJVNUHUBZN0g7 N1onVhofPVdXC2UA X-Authentic-SMTP: 61633634383431.1039:706 X-AuthFastPath: 0 (Was 255) X-AuthSMTP-Origin: 213.105.212.114/25 X-AuthVirus-Status: No virus detected - but ensure you scan with your own anti-virus system. Subject: RE: [Caml-list] ocamlc 4.03 -> 4.04: change in meaning of -i Timothy Bourke wrote: > Sent: 08 July 2017 15:08 > To: caml-list@inria.fr > Subject: [Caml-list] ocamlc 4.03 -> 4.04: change in meaning of -i >=20 > I just noticed a change in the behaviour of ocamlc that adversely > affects a tool I maintain. >=20 > In 4.03.0 (and earlier), the -i option only applies to the .ml files > that follow it on the command line. >=20 > In 4.04.0 (and later), the -i option applies to all .ml files on the > command line. >=20 > Is this change in behaviour intentional? This behaviour is a consequence of GPR#464 (in particular https://github.co= m/ocaml/ocaml/commit/4dc3efe) and intentional. Prior to 4.04.0, at the point of processing a.ml in `ocamlc a.ml -i b.ml` t= he compiler assumes it is linking (since that is the default operation) and= so generates a.cmo and a.cmi. Once it sees the `-i` it discovers that it's= supposed to be dumping interfaces and so prints the interface of b.ml - th= is works because by fluke it compiled a.ml previously. Prior to 4.04.0, if = instead you had run `ocamlc -i a.ml b.ml` (with no a.cmi built) you would h= ave got the same error and the same output. PR#6475/GPR#464 took the decision that the command line arguments should be= fully interpreted before doing anything, hence in 4.04.0+ `ocamlc a.ml -i = b.ml` and `ocamlc -i a.ml b.ml` are the same command and interpreted as the= latter (the change is marked as breaking as a result). HTH, David >=20 > Tim. >=20 > Longer explanation > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >=20 > Given two files. >=20 > a.ml: > let f x =3D x + 1 >=20 > b.ml: > open A > let g x =3D f x >=20 > 1. In 4.03.0 (and earlier), typing either > ocamlc a.ml -i b.ml > or > ocamlc -c a.ml; ocamlc a.ml -i b.ml >=20 > prints > val g : int -> int >=20 > and generates > a.cmi > a.cmo >=20 > 2. In 4.04.0 (and later), typing > ocamlc a.ml -i b.ml >=20 > prints > val f : int -> int > File "b.ml", line 1, characters 5-6: > Error: Unbound module A >=20 > and does not generate anything. >=20 > 3. In 4.04.0 (and later), typing > ocamlc -c a.ml; ocamlc a.ml -i b.ml >=20 > prints > val f : int -> int > val g : int -> int >=20 > and generates > a.cmi > a.cmo