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:01: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="10783"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: No Wayman , 48978@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jun 14 15:02:13 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 1lsmEH-0002g7-61 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 14 Jun 2021 15:02:13 +0200 Original-Received: from localhost ([::1]:37362 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lsmEF-0001Z3-Ku for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 14 Jun 2021 09:02:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47604) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lsmE6-0001Yg-K9 for bug-gnu-emacs@gnu.org; Mon, 14 Jun 2021 09:02:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33730) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lsmE6-0002dU-1K for bug-gnu-emacs@gnu.org; Mon, 14 Jun 2021 09:02:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lsmE6-0003Ix-0n for bug-gnu-emacs@gnu.org; Mon, 14 Jun 2021 09:02: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:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48978 X-GNU-PR-Package: emacs Original-Received: via spool by 48978-submit@debbugs.gnu.org id=B48978.162367570912684 (code B ref 48978); Mon, 14 Jun 2021 13:02:01 +0000 Original-Received: (at 48978) by debbugs.gnu.org; 14 Jun 2021 13:01:49 +0000 Original-Received: from localhost ([127.0.0.1]:45276 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lsmDt-0003IV-52 for submit@debbugs.gnu.org; Mon, 14 Jun 2021 09:01:49 -0400 Original-Received: from mx.sdf.org ([205.166.94.24]:58486) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lsmDp-0003IL-Kp for 48978@debbugs.gnu.org; Mon, 14 Jun 2021 09:01:47 -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 15ED1iAj018389 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Mon, 14 Jun 2021 13:01:44 GMT In-Reply-To: <83k0mx7upf.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 13 Jun 2021 16:36:12 +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:208482 Archived-At: 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 look if the it solves the problem? Thanks Andrea