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 741A77EE79 for ; Mon, 16 May 2016 04:21:17 +0200 (CEST) IronPort-PHdr: 9a23:jtN4+RIvO60+11QrHNmcpTZWNBhigK39O0sv0rFitYgUIvvxwZ3uMQTl6Ol3ixeRBMOAu6MC0bed7vGocFdDyKjCmUhKSIZLWR4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TWM5DIfUi/yKRBybrysXNWC3oLtiqvvqtX6WEZhunmUWftKNhK4rAHc5IE9oLBJDeIP8CbPuWZCYO9MxGlldhq5lhf44dqsrtY4q3wD89pozcNLUL37cqIkVvQYSW1+ayFmrPHs4DbKRxGO639UaW4WnwBFGUCR4xjwRJb8tm3hvepwwiSAFcLzRLEwHz+l6vE4ZgXvjXIYNz8l/XjKg9ZzxPZEoBO9qgViypTXSJ6VNeZzZ77UZ9BcQnBOCJUCHxddC5+xOtNcR9EKOvxV+syk/wMD Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=whitequark@whitequark.org; spf=Pass smtp.mailfrom=whitequark@whitequark.org; spf=None smtp.helo=postmaster@mail.whitequark.org Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of whitequark@whitequark.org) identity=pra; client-ip=176.58.103.125; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="whitequark@whitequark.org"; x-sender="whitequark@whitequark.org"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of whitequark@whitequark.org designates 176.58.103.125 as permitted sender) identity=mailfrom; client-ip=176.58.103.125; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="whitequark@whitequark.org"; x-sender="whitequark@whitequark.org"; 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.whitequark.org) identity=helo; client-ip=176.58.103.125; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="whitequark@whitequark.org"; x-sender="postmaster@mail.whitequark.org"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0DsBwAILjlX/31nOrBDGoQMfgGCc7h0IoVvAoFWEAEBAQEBAQEBZCeCLYIWAQEEOAI/EAQHCQ8dBgssKwYbiCsKLLx6AQEBAQYCJYYkgy+BH4oYBZgnghuDY4gZgj6MYoZ/iEI3K4IGGxaBNTwyAYgFAQEB X-IPAS-Result: A0DsBwAILjlX/31nOrBDGoQMfgGCc7h0IoVvAoFWEAEBAQEBAQEBZCeCLYIWAQEEOAI/EAQHCQ8dBgssKwYbiCsKLLx6AQEBAQYCJYYkgy+BH4oYBZgnghuDY4gZgj6MYoZ/iEI3K4IGGxaBNTwyAYgFAQEB X-IronPort-AV: E=Sophos;i="5.24,625,1454972400"; d="scan'208";a="218377473" Received: from fehu.whitequark.org (HELO mail.whitequark.org) ([176.58.103.125]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/ADH-AES256-GCM-SHA384; 16 May 2016 04:21:16 +0200 Received: by mail.whitequark.org (Postfix, from userid 33) id E859B10CA78; Mon, 16 May 2016 02:21:15 +0000 (UTC) To: Gabriel Scherer X-PHP-Originating-Script: 1000:rcube.php MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 16 May 2016 02:21:15 +0000 From: whitequark Cc: Roberto Di Cosmo , Leo White , caml users In-Reply-To: References: Message-ID: <883fd5b46c53a93a3313c091f2972af0@whitequark.org> X-Sender: whitequark@whitequark.org User-Agent: Roundcube Webmail/1.1.5 Subject: Re: [Caml-list] Justifying a breaking 4.03 change, strong dependency on modules with "external" declarations On 2016-05-16 01:09, Gabriel Scherer wrote: > As Roberto Di Cosmo points out in the thread "parmap package broken in > opam switch 4.03.0", using an "external" declaration provided by a > module A now counts as a dependency on A -- in particular, A has to be > linked in the final executable. > > This breaks some user code (such as Parmap, but I heard reports from > other breakages) in the case where A was used solely to provide such > "external" declarations, for C functions implemented in a C stub that > was linked in the application. In that case it was neither necessary > nor useful to link A, and projects did not do it. They need to do it > explicitly now, and break at linking-time otherwise. > > I realize that users may not understand why this change, which looks > like a regression, happened in 4.03. It is actually a bugfix, see > PR#4166 ( http://caml.inria.fr/mantis/view.php?id=4166 ): if A does > not only provide those external declarations, but also initializes > some state that the C functions rely on (such as exception > declarations), then forgetting to link A may result in a crash at > runtime. > > In other words, the pre-4.03 situation could result in some rare cases > of user error in a very subtle, very difficult to understand bug. I am highly fond of this change. This was a substantial problem with the LLVM OCaml bindings--I as well as other contributors have introduced a bug more than once, but even beyond that, not having the `external` declarations in the .mli unnecessarily pessimizes some hot paths. -- whitequark