From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sergio Durigan Junior Newsgroups: gmane.emacs.bugs Subject: bug#61880: Native compilation fails to generate trampolines on certain scenarios Date: Thu, 02 Mar 2023 18:54:33 -0500 Message-ID: <875ybiemkm.fsf@sergiodj.net> References: <877cw1l455.fsf@sergiodj.net> <83sfeofyi6.fsf@gnu.org> <87edq8hxom.fsf@sergiodj.net> <83v8jjeiq0.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37443"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 61880@debbugs.gnu.org, akrl@sdf.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 03 00:55:25 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXslg-0009YI-S0 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 03 Mar 2023 00:55:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pXslM-0002gq-Ob; Thu, 02 Mar 2023 18:55:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pXslK-0002gL-U3 for bug-gnu-emacs@gnu.org; Thu, 02 Mar 2023 18:55:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pXslK-0003z4-K6 for bug-gnu-emacs@gnu.org; Thu, 02 Mar 2023 18:55:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pXslK-0006kJ-Fy for bug-gnu-emacs@gnu.org; Thu, 02 Mar 2023 18:55:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Sergio Durigan Junior Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 Mar 2023 23:55:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61880 X-GNU-PR-Package: emacs Original-Received: via spool by 61880-submit@debbugs.gnu.org id=B61880.167780128225898 (code B ref 61880); Thu, 02 Mar 2023 23:55:02 +0000 Original-Received: (at 61880) by debbugs.gnu.org; 2 Mar 2023 23:54:42 +0000 Original-Received: from localhost ([127.0.0.1]:59231 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pXskz-0006je-Qj for submit@debbugs.gnu.org; Thu, 02 Mar 2023 18:54:42 -0500 Original-Received: from mail.sergiodj.net ([167.114.15.217]:47034) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pXskx-0006jL-TV for 61880@debbugs.gnu.org; Thu, 02 Mar 2023 18:54:40 -0500 Original-Received: from localhost (unknown [IPv6:2607:f2c0:ed84:d00:694f:48a1:de49:29be]) by mail.sergiodj.net (Postfix) with ESMTPSA id B1E9BA019D; Thu, 2 Mar 2023 18:54:33 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=sergiodj.net; s=20160602; t=1677801273; bh=T8KL1GyzWm6G9us0f/kbRcBqCz2YC7k444IDRQHyhCs=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Xb0t/K+uheiQ08C9nvYpzG8MaLy+/MElYo1k1qkshQHf1lRmOPf6yfYjJq/cfsiye pM5Pa4xLMyRIZQqxN8uq0kI0/PBBpenEBq5HuLy6I8X9SpaF96EesBXH8e8AEpioub rvBZoFQ+tGgbQPnntzsb9uPefuF6maTv7kCGdWL4= In-Reply-To: <83v8jjeiq0.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 02 Mar 2023 09:05:27 +0200") X-URL: http://blog.sergiodj.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:257185 Archived-At: On Thursday, March 02 2023, Eli Zaretskii wrote: >> From: Sergio Durigan Junior >> Cc: Eli Zaretskii , 61880@debbugs.gnu.org >> Date: Wed, 01 Mar 2023 18:14:01 -0500 >> >> > Fact is, Emacs can't be robust against the redefinition of all >> > primitives (actually never was), the programmer that redefines >> > primitives should be ready to understand the underlying Emacs machinery, >> > and with native compilation this machinery changed a bit. >> >> I understand where you're coming from, but it's also important to note >> that this behaviour was accepted without problems until the native >> compilation feature came about, so it is understandable that we are >> getting a lot of confusing people wondering why their tests started >> failing now. I believe there should be more emphasis in the >> documentation that this problem can creep in, especially for those who >> are relying on redefinitions for testing purposes. >> >> > So two options: >> > >> > * The redefinition of `file-exists-p' is tipically done for test >> > purposes only, we accept that and for this case we suggest to run >> > these specific tests setting `native-comp-enable-subr-trampolines' to >> > nil >> >> This is what I'm currently doing in Debian/Ubuntu, and will start >> suggesting upstream maintainers to do the same. > > I can come up with documentation of this subtlety, including a list of > primitives whose redefinition could trigger these issues, if this is > an acceptable solution. Yes, this would be a great first step. I wonder if there's some warning Emacs can print when it detects that a primitive is being redefined and native compilation is enabled. On the one hand, Emacs would be a bit more verbose than perhaps desirable; on the other, I think this scenario is particular enough that having a warning is OK-ish. -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible https://sergiodj.net/