From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#53596: 29.0.50; comp-trampoline-compile: Cannot find suitable directory for output in `native-comp-eln-load-path' Date: Fri, 28 Jan 2022 15:03:28 +0100 Message-ID: <87lez0gdov.fsf@gnus.org> References: <92bc3ddb-26b8-e373-2819-be095d1ba580@inventati.org> <1dfc7af5-7fba-1147-982a-a9fe688a40d6@inventati.org> <1a1c0d6c-1ec4-6283-053e-e9190a57316c@inventati.org> <74292753-93b6-abb1-4a3c-7e1d1f50724b@inventati.org> <5045943a-9d77-c7f9-b0cf-6c8feb68d39d@inventati.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="39479"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Andrea Corallo , 53596@debbugs.gnu.org To: Manuel Uberti Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jan 28 15:59:13 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 1nDSiW-000A3u-OE for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 28 Jan 2022 15:59:12 +0100 Original-Received: from localhost ([::1]:42710 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nDSiV-0002fw-OS for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 28 Jan 2022 09:59:11 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:59396) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nDRrG-0001im-5B for bug-gnu-emacs@gnu.org; Fri, 28 Jan 2022 09:04:10 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36610) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nDRr8-0008ET-3N for bug-gnu-emacs@gnu.org; Fri, 28 Jan 2022 09:04:09 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nDRr7-0003jQ-Qj for bug-gnu-emacs@gnu.org; Fri, 28 Jan 2022 09:04:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 28 Jan 2022 14:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53596 X-GNU-PR-Package: emacs Original-Received: via spool by 53596-submit@debbugs.gnu.org id=B53596.164337862114310 (code B ref 53596); Fri, 28 Jan 2022 14:04:01 +0000 Original-Received: (at 53596) by debbugs.gnu.org; 28 Jan 2022 14:03:41 +0000 Original-Received: from localhost ([127.0.0.1]:57746 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nDRqm-0003ik-MN for submit@debbugs.gnu.org; Fri, 28 Jan 2022 09:03:41 -0500 Original-Received: from quimby.gnus.org ([95.216.78.240]:42070) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nDRqk-0003iU-Q3 for 53596@debbugs.gnu.org; Fri, 28 Jan 2022 09:03:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=0Vr8xY/SW2cQpdZjBzD9Ix8CxrZTxxyL0HHs7NsIUF0=; b=TV8WjKg4SxMK2pxNfzPtgFTedS yjxm1L4ADQ7l+GSPP+1QBO+4/AFoa2pt7fJiek937TkX7f74dj3LQNC5AGWLAuEkXwuykdEwPHLHc MkiRFFfcj0oeZU8p2jBRwWnWmZ5SUXYvZMqvyHC4oU3DBzLg4D4aJ5NMhFDV6z3oP7Ko=; Original-Received: from [84.212.220.105] (helo=giant) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nDRqb-000334-6g; Fri, 28 Jan 2022 15:03:31 +0100 X-Now-Playing: Joe Jackson's _Big World_: "The Jet Set" In-Reply-To: <5045943a-9d77-c7f9-b0cf-6c8feb68d39d@inventati.org> (Manuel Uberti's message of "Fri, 28 Jan 2022 14:49:51 +0100") 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:225458 Archived-At: Manuel Uberti writes: > It works as expected without those changes. Could you see whether the following patch fixes the problem? diff --git a/lisp/startup.el b/lisp/startup.el index 60aaa76002..66dd726ae9 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -693,6 +693,47 @@ normal-top-level (let ((old-face-font-rescale-alist face-font-rescale-alist)) (unwind-protect (command-line) + + ;; Do this after `command-line', since it may alter + ;; `user-emacs-directory'. + (when (featurep 'native-compile) + ;; Form `native-comp-eln-load-path'. + (let ((path-env (getenv "EMACSNATIVELOADPATH"))) + (when path-env + (dolist (path (split-string path-env path-separator)) + (unless (string= "" path) + (push path native-comp-eln-load-path))))) + (push (expand-file-name "eln-cache/" user-emacs-directory) + native-comp-eln-load-path) + ;; When $HOME is set to '/nonexistent' means we are running the + ;; testsuite, add a temporary folder in front to produce there + ;; new compilations. + (when (and (equal (getenv "HOME") "/nonexistent") + ;; We may be running in a chroot environment where we + ;; can't write anything. + (file-writable-p (expand-file-name + (or temporary-file-directory "")))) + (let ((tmp-dir (make-temp-file "emacs-testsuite-" t))) + (add-hook 'kill-emacs-hook + (lambda () + (delete-directory tmp-dir t))) + (push tmp-dir native-comp-eln-load-path))) + (when locale-coding-system + (let ((coding (if (eq system-type 'windows-nt) + ;; MS-Windows build converts all file names to + ;; UTF-8 during startup. + 'utf-8 + locale-coding-system)) + (npath (symbol-value 'native-comp-eln-load-path))) + (set 'native-comp-eln-load-path + (mapcar (lambda (dir) + ;; Call expand-file-name to remove all the + ;; pesky ".." from the directyory names in + ;; native-comp-eln-load-path. + (expand-file-name + (decode-coding-string dir coding t))) + npath))))) + ;; Do this again, in case .emacs defined more abbreviations. (if default-directory (setq default-directory (abbreviate-file-name default-directory))) @@ -760,44 +801,6 @@ normal-top-level (unless inhibit-startup-hooks (run-hooks 'window-setup-hook)))) - ;; Do this after `command-line', since it may alter - ;; `user-emacs-directory'. - (when (featurep 'native-compile) - ;; Form `native-comp-eln-load-path'. - (let ((path-env (getenv "EMACSNATIVELOADPATH"))) - (when path-env - (dolist (path (split-string path-env path-separator)) - (unless (string= "" path) - (push path native-comp-eln-load-path))))) - (push (expand-file-name "eln-cache/" user-emacs-directory) - native-comp-eln-load-path) - ;; When $HOME is set to '/nonexistent' means we are running the - ;; testsuite, add a temporary folder in front to produce there - ;; new compilations. - (when (and (equal (getenv "HOME") "/nonexistent") - ;; We may be running in a chroot environment where we - ;; can't write anything. - (file-writable-p (expand-file-name - (or temporary-file-directory "")))) - (let ((tmp-dir (make-temp-file "emacs-testsuite-" t))) - (add-hook 'kill-emacs-hook (lambda () (delete-directory tmp-dir t))) - (push tmp-dir native-comp-eln-load-path))) - (when locale-coding-system - (let ((coding (if (eq system-type 'windows-nt) - ;; MS-Windows build converts all file names to - ;; UTF-8 during startup. - 'utf-8 - locale-coding-system)) - (npath (symbol-value 'native-comp-eln-load-path))) - (set 'native-comp-eln-load-path - (mapcar (lambda (dir) - ;; Call expand-file-name to remove all the - ;; pesky ".." from the directyory names in - ;; native-comp-eln-load-path. - (expand-file-name - (decode-coding-string dir coding t))) - npath))))) - ;; Subprocesses of Emacs do not have direct access to the terminal, so ;; unless told otherwise they should only assume a dumb terminal. ;; We are careful to do it late (after term-setup-hook), although the -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no