From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#48978: 28.0.50; native-comp: Error: File error Creating file with prefix Date: Mon, 14 Jun 2021 13:04:44 +0000 Message-ID: References: <8735tm26fm.fsf@gmail.com> <83wnqy6xp9.fsf@gnu.org> <87tum1aobt.fsf@gmail.com> <83k0mx7upf.fsf@gnu.org> Reply-To: Andrea Corallo Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27383"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: eliz@gnu.org, iarchivedmywholelife@gmail.com To: 48978@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jun 14 15:05:15 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 1lsmHD-0006ss-2W for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 14 Jun 2021 15:05:15 +0200 Original-Received: from localhost ([::1]:40526 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lsmHC-0003mi-4u for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 14 Jun 2021 09:05:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48582) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lsmH0-0003ld-Pn for bug-gnu-emacs@gnu.org; Mon, 14 Jun 2021 09:05:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33748) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lsmH0-00044c-IB for bug-gnu-emacs@gnu.org; Mon, 14 Jun 2021 09:05:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lsmH0-0003Oc-ER for bug-gnu-emacs@gnu.org; Mon, 14 Jun 2021 09:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 14 Jun 2021 13:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48978 X-GNU-PR-Package: emacs X-Debbugs-Original-To: Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of text editors" X-Debbugs-Original-Cc: Eli Zaretskii , No Wayman , 48978@debbugs.gnu.org Original-Received: via spool by 48978-submit@debbugs.gnu.org id=B48978.162367588613006 (code B ref 48978); Mon, 14 Jun 2021 13:05:02 +0000 Original-Received: (at 48978) by debbugs.gnu.org; 14 Jun 2021 13:04:46 +0000 Original-Received: from localhost ([127.0.0.1]:45290 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lsmGk-0003Ni-H9 for submit@debbugs.gnu.org; Mon, 14 Jun 2021 09:04:46 -0400 Original-Received: from mx.sdf.org ([205.166.94.24]:58052) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lsmGi-0003Na-Ud for 48978@debbugs.gnu.org; Mon, 14 Jun 2021 09:04:45 -0400 Original-Received: from mab (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 15ED4iHv023715 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Mon, 14 Jun 2021 13:04:44 GMT In-Reply-To: (Andrea Corallo via's message of "Mon, 14 Jun 2021 13:01:44 +0000") 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:208484 Archived-At: Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: > Eli Zaretskii writes: > >>> From: No Wayman >>> Cc: 48978@debbugs.gnu.org >>> Date: Sun, 13 Jun 2021 08:51:09 -0400 >>> >>> > What happens if you do the following from the shell prompt: >>> > >>> > $ emacs -batch -l comp -f batch-native-compile >>> > /usr/share/emacs/28.0.50/lisp/progmodes/etags.el >>> >>> Here we get the rest of the file-error: >>> >>> Debugger entered--Lisp error: (file-error >>> "/usr/share/emacs/28.0.50/lisp/progmodes/etags.el" "Creating file >>> with prefix" "Permission denied" >>> "/usr/share/emacs/28.0.50/lisp/progmodes/etags.elc") >>> signal(file-error >>> ("/usr/share/emacs/28.0.50/lisp/progmodes/etags.el" "Creating >>> file with prefix" "Permission denied" >>> "/usr/share/emacs/28.0.50/lisp/progmodes/etags.elc")) >>> comp--native-compile("/usr/share/emacs/28.0.50/lisp/progmodes/etags.el") >>> batch-native-compile() >>> command-line-1(("-l" "comp" "-f" "batch-native-compile" >>> "/usr/share/emacs/28.0.50/lisp/progmodes/etags.el")) >>> command-line() >>> normal-top-level() >>> >>> Which is obviously a permissions error. >>> >>> > Also, is /usr/share/emacs/28.0.50/lisp/progmodes writable by >>> > your >>> > user? >>> >>> Permissions for the directory are as follows: >>> >>> drwxr-xr-x 2 root root 4.0K Jun 13 08:48 >>> /usr/share/emacs/28.0.50/lisp/progmodes/ >>> >>> ^Looks like that's the problem! >> >> Yes, that's what I thought was happening. >> >>> I'm using an AUR script to install Emacs. >>> I see now there was a recent change to that script which modifies >>> the permissions of directories: >>> >>> https://aur.archlinux.org/cgit/aur.git/commit/?h=emacs-git&id=dca21d899ec2b1390526a300c7a617a22165dbda >>> >>> Willing to bet that's the cause of the error here. >>> I'll contact the maintainer of that installation script. >>> Thanks for the response and sorry for the noise (though, I do >>> think there may be a bug with the way that file-error is being >>> reported). >> >> It isn't noise: Emacs shouldn't really try creating files in that >> directory, not when native-compiling in the background. >> >> Andrea, this happens because native-compilation calls >> byte-compilation, which then attempts to create the temporary .elc >> file in the same directory where the .el file lives. I show the >> backtrace which leads to this issue below. >> >> Do we really need that temporary file for the purposes of >> native-compilation, or could we disable its creation? > > Agree, I think we can (and should) disable its creation when > `byte+native-compile' is non-nil. > >> If the latter, >> I think we should, because in general there's no reason to assume the >> /usr/share tree is writable by unprivileged users. > > Right I pushed dc4ac39b26, it should do the job. Nick could you have a ^^^ 663fb3b774 Wasn't quick enough and had to rebase sorry :) Andrea