From: Andrea Corallo via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: No Wayman <iarchivedmywholelife@gmail.com>, 48978@debbugs.gnu.org
Subject: bug#48978: 28.0.50; native-comp: Error: File error Creating file with prefix
Date: Mon, 14 Jun 2021 13:01:44 +0000 [thread overview]
Message-ID: <xjfy2bcha6f.fsf@sdf.org> (raw)
In-Reply-To: <83k0mx7upf.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 13 Jun 2021 16:36:12 +0300")
Eli Zaretskii <eliz@gnu.org> writes:
>> From: No Wayman <iarchivedmywholelife@gmail.com>
>> 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
next prev parent reply other threads:[~2021-06-14 13:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-12 19:48 bug#48978: 28.0.50; native-comp: Error: File error Creating file with prefix No Wayman
2021-06-13 7:16 ` Eli Zaretskii
2021-06-13 12:51 ` No Wayman
2021-06-13 13:36 ` Eli Zaretskii
2021-06-14 13:01 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2021-06-14 13:04 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-06-14 13:23 ` Eli Zaretskii
2021-06-14 16:08 ` Eli Zaretskii
2021-06-15 7:50 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-06-14 21:15 ` No Wayman
2021-06-15 7:51 ` Andrea Corallo via Bug reports for GNU Emacs, the Swiss army knife of text editors
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xjfy2bcha6f.fsf@sdf.org \
--to=bug-gnu-emacs@gnu.org \
--cc=48978@debbugs.gnu.org \
--cc=akrl@sdf.org \
--cc=eliz@gnu.org \
--cc=iarchivedmywholelife@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).