From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.bugs Subject: bug#60996: 29.0.60; Native compile fails to remove temp file for trampoline Date: Fri, 27 Jan 2023 09:51:04 +0000 Message-ID: References: <74d13c46-5b26-9dd8-45dc-32b7fda25421@gmail.com> <833583ks9t.fsf@gnu.org> <86tu0iwx49.fsf@gmail.com> <83a629i3aj.fsf@gnu.org> <83r0vhcf9m.fsf@gnu.org> <83mt65c9vv.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="14565"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: andrewjmoreton@gmail.com, 60996@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 27 10:52:22 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 1pLLPC-0003gQ-4t for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 27 Jan 2023 10:52:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pLLOt-00009g-T0; Fri, 27 Jan 2023 04:52: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 1pLLOs-00009Y-Vp for bug-gnu-emacs@gnu.org; Fri, 27 Jan 2023 04:52: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 1pLLOs-0005OP-Kt for bug-gnu-emacs@gnu.org; Fri, 27 Jan 2023 04:52:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pLLOs-0000oq-4t for bug-gnu-emacs@gnu.org; Fri, 27 Jan 2023 04:52:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 27 Jan 2023 09:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60996 X-GNU-PR-Package: emacs Original-Received: via spool by 60996-submit@debbugs.gnu.org id=B60996.16748130712990 (code B ref 60996); Fri, 27 Jan 2023 09:52:02 +0000 Original-Received: (at 60996) by debbugs.gnu.org; 27 Jan 2023 09:51:11 +0000 Original-Received: from localhost ([127.0.0.1]:36759 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pLLO2-0000m9-KK for submit@debbugs.gnu.org; Fri, 27 Jan 2023 04:51:10 -0500 Original-Received: from mx.sdf.org ([205.166.94.24]:62965) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pLLNy-0000lv-8G for 60996@debbugs.gnu.org; Fri, 27 Jan 2023 04:51:09 -0500 Original-Received: from ma.sdf.org (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 30R9p4oH007139 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Fri, 27 Jan 2023 09:51:04 GMT In-Reply-To: <83mt65c9vv.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 26 Jan 2023 22:35:00 +0200") 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:254252 Archived-At: Eli Zaretskii writes: >> Cc: andrewjmoreton@gmail.com, 60996@debbugs.gnu.org >> Date: Thu, 26 Jan 2023 20:38:45 +0200 >> From: Eli Zaretskii >> >> > The only case where we might do that AFAIR is when >> > `inhibit-automatic-native-compilation' is used. This was the infamous >> > mechanism that was installed by Lars where, if I'm not wrong, we are >> > supposed to compile a trampoline, load it, and remove it to pretend we >> > didn't compiled anything :x >> >> OK, this seems to be what is happening here, because we compile the >> trampoline to a temporary directory. Otherwise, I don't see why we >> would do that, and why we would delete a trampoline we just compiled. > > Actually, I don't think I see where we delete the trampoline that we > generated when inhibit-automatic-native-compilation is non-nil. Can > you point me to the code which does that? Sure, the code behind this mechanism is not straightforward and took me a bit to decipher it as well yesterday. In `comp-trampoline-compile' when `inhibit-automatic-native-compilation' is not nil we invoke `comp--native-compile' with the `output' parameter set to null. `comp--native-compile' after compiling does two things: 1- If the compilation input was a file returns the .eln filename 2- If the input was a lambda (the case for trampolines) it does return the compiled subr. To do that it preforms a load of the eln before returning. So in general what `comp--native-compile' returns is: (if (stringp function-or-file) data ;; So we return the compiled function. (native-elisp-load data))) But at the end of `comp--native-compile' this when was added (when (and (not (stringp function-or-file)) (not output) comp-ctxt (comp-ctxt-output comp-ctxt) (file-exists-p (comp-ctxt-output comp-ctxt))) (delete-file (comp-ctxt-output comp-ctxt))) Took me a while to actually realize this is the unwindform of an enormous `unwind-protect'. Anyway this is the code that when `output' is null (the case for trampolines) tries to performs the file deletetion. Best Regards Andrea