From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#45518: Ctrl-G Fails to Interrupt Hung Tramp Remote-Compile in Emacs 27.1 Date: Wed, 17 Feb 2021 16:39:43 +0100 Message-ID: <87mtw2u2io.fsf@gmx.de> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7870"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 45518@debbugs.gnu.org To: Duncan Greatwood Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 17 16:40:10 2021 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 1lCOvy-0001uz-HW for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 17 Feb 2021 16:40:10 +0100 Original-Received: from localhost ([::1]:59552 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lCOvx-0006Ny-Ir for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 17 Feb 2021 10:40:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46914) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lCOvq-0006Nq-No for bug-gnu-emacs@gnu.org; Wed, 17 Feb 2021 10:40:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33183) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lCOvq-0007sa-GT for bug-gnu-emacs@gnu.org; Wed, 17 Feb 2021 10:40:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lCOvq-00055y-DI for bug-gnu-emacs@gnu.org; Wed, 17 Feb 2021 10:40:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 Feb 2021 15:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45518 X-GNU-PR-Package: emacs Original-Received: via spool by 45518-submit@debbugs.gnu.org id=B45518.161357639319567 (code B ref 45518); Wed, 17 Feb 2021 15:40:02 +0000 Original-Received: (at 45518) by debbugs.gnu.org; 17 Feb 2021 15:39:53 +0000 Original-Received: from localhost ([127.0.0.1]:44729 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lCOvg-00055X-VD for submit@debbugs.gnu.org; Wed, 17 Feb 2021 10:39:53 -0500 Original-Received: from mout.gmx.net ([212.227.15.18]:43427) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lCOvf-00055K-Aj for 45518@debbugs.gnu.org; Wed, 17 Feb 2021 10:39:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1613576384; bh=MShLqxlGcMdEGketR7kqn4XfTp581dY2XrXT6afLV8E=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=ItDzEDADPqAoXNOQVYEOe6w5XNjdjVLYWEAkOAUxdSOt4hlBB/YZoOgmYy/G1Q71Q NWVWXWBm8gDswlXwVMhRj/zLXxJ4170Ux5YcRrg74JsYtLa0M0238ANOlEHDCbn4sP KXkqwvCFrJm03S4Hs6vT+RR9PlBzVHlZEUOLlTyw= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from gandalf.gmx.de ([213.220.145.206]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MxUnz-1m5Is50Vkv-00xpgm; Wed, 17 Feb 2021 16:39:44 +0100 In-Reply-To: (Duncan Greatwood's message of "Tue, 16 Feb 2021 21:41:39 -0800") X-Provags-ID: V03:K1:tu2O91gXd3vHznvBSyYSH6yOOC0xNe8cAVIgXN/IZ30WMPE9ERj 10U3DEH83rK0Jr2Y5n7VY72Vxg5zK78d0XMiAfHFTJgwW0o1lAK4PPWlBtELvLcQFoK+DTr EZ8XbIVB6e2zaWm7j13VV0MPDXzMOh9jV29hoKYNvoZ7i/mR+wXdWYQAFwIjoLRZbxSAgGe ghxO7+0x64mVmx0RvwcTw== X-UI-Out-Filterresults: notjunk:1;V03:K0:oiq+zWnpPyE=:vH0qNJTtSOjoGz0ZPPhk/3 qqBu1uSpjjq1G8jarZRTyKoLLzfDnm6cec5KrYdAd2Nt9s7GnUnMCRhdvKzvcFXxf0vrEyEBp Hm5tp5mVKZl4Qd1KUnfXwfb9LiZJWvCso1Px8NWCSaPwH+bda+IFFW0nz+2kQnk4kMVoPD9f0 zs3FG8dqolRE247I+GLxFrIvU1FikR+vpUeku+R53hEoH/iWYE9wofmTPia4F4O3KhFkraLr1 qQEtFPqB/GNqXypfkNd1MXz6E5a9wWWXI5hRx4NygqNqECzN8NktmzzwAlJtAy+5As6OmZHqS +ZT4bhQIxmG9oXEDPkosWCsUIFdJZtHJSCHXNACbTYlySLymvA0qEGY8NF/FoP6lSi09p4rof +sXJvo5ZytCa23aR+uTnmKM7rqXlIreAKyYH5Si+mkwTv/j61Uf1QPCmPdVnF+XdGMFFXFoCI +3C/sMPmYqiNz8YZuh63iyMyYS6Tfl2ae+stub09PHf0IIWenzTmZKaQeHj72VVqQbmklcfwE jQelW8VhOHS5QSh9XW1IQNERr9QYClR9wTSw74Lk73e1qdYeBx6I+PnTB96ZrpjeZPmCf1bF9 rnjKUTrAwbF1fHmY/f45PkWLNRJ7LtEMrM9Mm+QiWR8RoAkbdjE8aQ35b5AS/IHi9BpLfFVZ0 sqDFyQ5ga41ZiA5CYMdDByxxMRb+P8bn4fVwKz2edwcSXPa2UC9u9f3vZHlF/kRCNH2ZPYBYF eUOYLMU/4MTwOQQpk81/Kf36qYc/GXp6X3D+inI6DSL7hcLcBswrS32bkoQNkkKKPJiJkJzG 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" Xref: news.gmane.io gmane.emacs.bugs:200201 Archived-At: --=-=-= Content-Type: text/plain Duncan Greatwood writes: > Michael - Hi Duncan, > Prompted by your question, I downloaded Tramp 2.5.0.1 from GNU ELPA > and copied those .el files over the tramp files in .../lisp/net, > applied the patch in tramp-integration.el and recompiled the macos > application. I have the patched compile.el included as well, just to > be clear. I seriously recommend to use Emacs' package manager for installation, and NOT to overwrite files in Emacs' installation dir. Experience tells, that this is always good for trouble in the long run. > I checked in run time, tramp-compile-advice-add and > compilation-start-hook are defined as we'd wish. > > Unfortunately, I see no change in behaviour. If I click on a syntax > error message while compiling test.cpp in the autotools project via > tramp, the compile hangs until I ctrl-g out. > > Not sure why the difference vs. your setup, sorry. Strange. I've reworked the Tramp patch a little bit. Function names have changed, and more important, it has traces now. Could you please apply this patch instead of the previous patch in tramp-integration.el? Rerun your test with tramp-verbose set to 6, and send the Tramp debug buffer if it still doesn't work as expected. > Best regards, > Duncan. Best regards, Michael. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment Content-Transfer-Encoding: quoted-printable *** /tmp/edifffETTJu 2021-02-17 16:37:56.993381450 +0100 =2D-- /home/albinus/src/tramp/lisp/tramp-integration.el 2021-02-17 14:12:3= 6.736224836 +0100 *************** *** 41,46 **** =2D-- 41,47 ---- (declare-function recentf-cleanup "recentf") (declare-function tramp-dissect-file-name "tramp") (declare-function tramp-file-name-equal-p "tramp") + (declare-function tramp-message "tramp") (declare-function tramp-tramp-file-p "tramp") (defvar eshell-path-env) (defvar ido-read-file-name-non-ido) *************** *** 261,266 **** =2D-- 262,303 ---- (delete (info-lookup->mode-cache 'symbol ',mode) (info-lookup->topic-cache 'symbol)))))))) + ;;; Integration of compile.el: + + ;; Compilation processes use `accept-process-output' such a way that + ;; Tramp's parallel `accept-process-output' blocks. See last part of + ;; Bug#45518. So we forbid them to run in parallel. There must be a + ;; better solution, though. + (defun tramp-compile-disable-goto-error (proc) + "Don't allow remote file operations while compiling." + (with-current-buffer (process-buffer proc) + (when (file-remote-p default-directory) + (advice-add 'ignore :override 'compile-goto-error) + (tramp-message + (tramp-dissect-file-name default-directory) 4 + "Disable `compile-goto-error'")))) + + (defun tramp-compile-enable-goto-error (buffer _message) + "Reenable remote file operations." + (with-current-buffer buffer + (when (file-remote-p default-directory) + (advice-remove 'ignore 'compile-goto-error) + (tramp-message + (tramp-dissect-file-name default-directory) 4 + "Enable `compile-goto-error'")))) + + (with-eval-after-load 'compile + (add-hook 'compilation-start-hook + #'tramp-compile-disable-goto-error) + (add-hook 'compilation-finish-functions + #'tramp-compile-enable-goto-error) + (add-hook 'tramp-integration-unload-hook + (lambda () + (remove-hook 'compilation-start-hook + #'tramp-compile-disable-goto-error) + (remove-hook 'compilation-finish-functions + #'tramp-compile-enable-goto-error)))) + ;;; Default connection-local variables for Tramp: ;; `connection-local-set-profile-variables' and ;; `connection-local-set-profiles' exists since Emacs 26.1. --=-=-=--