From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#55743: 28.1.50; No directory error in comp-run-async-workers Date: Tue, 31 May 2022 22:49:37 +0300 Organization: LINKOV.NET Message-ID: <86wne1trce.fsf@mail.linkov.net> References: <86y1yhsxin.fsf@mail.linkov.net> <83wne1h66x.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="6705"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: 55743@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 31 21:58:29 2022 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 1nw80a-0001ZJ-LH for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 31 May 2022 21:58:28 +0200 Original-Received: from localhost ([::1]:36428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nw80Y-0002q3-0s for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 31 May 2022 15:58:26 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33202) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nw7uN-0007s7-0L for bug-gnu-emacs@gnu.org; Tue, 31 May 2022 15:52:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55078) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nw7uM-0003cJ-OP for bug-gnu-emacs@gnu.org; Tue, 31 May 2022 15:52:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nw7uM-0000Hj-Nd for bug-gnu-emacs@gnu.org; Tue, 31 May 2022 15:52:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 31 May 2022 19:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55743 X-GNU-PR-Package: emacs Original-Received: via spool by 55743-submit@debbugs.gnu.org id=B55743.16540266921041 (code B ref 55743); Tue, 31 May 2022 19:52:02 +0000 Original-Received: (at 55743) by debbugs.gnu.org; 31 May 2022 19:51:32 +0000 Original-Received: from localhost ([127.0.0.1]:48974 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nw7ts-0000Gj-5m for submit@debbugs.gnu.org; Tue, 31 May 2022 15:51:32 -0400 Original-Received: from relay2-d.mail.gandi.net ([217.70.183.194]:65379) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nw7tq-0000GW-Jh for 55743@debbugs.gnu.org; Tue, 31 May 2022 15:51:30 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id BBF4940003; Tue, 31 May 2022 19:51:23 +0000 (UTC) In-Reply-To: <83wne1h66x.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 31 May 2022 22:07:18 +0300") 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:233461 Archived-At: >> So here are two problems: why completion sets default-directory to non-existent dir, > > That's the real problem. Oh, I see, it's a known problem. In completion-setup-function: (base-dir ;; FIXME: This is a bad hack. We try to set the default-directory ;; in the *Completions* buffer so that the relative file names ;; displayed there can be treated as valid file names, independently ;; from the completion context. But this suffers from many problems: ;; - It's not clear when the completions are file names. With some ;; completion tables (e.g. bzr revision specs), the listed ;; completions can mix file names and other things. ;; - It doesn't pay attention to possible quoting. ;; - With fancy completion styles, the code below will not always ;; find the right base directory. (if minibuffer-completing-file-name (file-name-as-directory (expand-file-name (buffer-substring (minibuffer-prompt-end) (point))))))) ... (if base-dir (setq default-directory base-dir)) >> and why comp-run-async-workers tries to run a process in such arbitrary invalid dirs. > > It is not comp-run-async-workers that does it, it's the low-level > infrastructure in subroutines of make-process: it makes sure the > directory in which the process will run is valid, and if it isn't > signals an error. Shouldn't native compilation run in the directory where the emacs source files are located instead of running in the default directory of an arbitrary buffer that might be invalid?