Subject: bug#64226: 30.0.50; emacs-lisp-native-compile-and-load permission error

From: No Wayman <[email-masked]>
Date: Thu, 22 Jun 2023 13:21:49 -0400

Eli Zaretskii <[email-masked]> writes:
 
> What is the value of native-comp-eln-load-path?

("/home/n/.emacs.d/eln-cache/" 
"/usr/lib/emacs/30.0.50/native-lisp/")

> Also, can you show the contents of the file being compiled, 
> which
> seems to be /home/n/.emacs.d/elpaca/repos/elpaca/elpaca.el ?

I can reproduce with any elisp file.
e.g. $HOME/test.el containing:

--8<---------------cut here---------------start------------->8---
;; -*- lexical-binding: t; -*-
(defun +test () (message "PASS"))
--8<---------------cut here---------------end--------------->8---

Native compiler error: "/home/n/test.el", "Compiling 
/usr/lib/emacs/30.0.50/native-lisp/30.0.50-58a66af6/test-98b414c9-ac29ecab.eln...
Creating file with prefix: Permission denied, 
/usr/lib/emacs/30.0.50/native-lisp/30.0.50-58a66af6/test-98b414c9-ac29ecab

Error: permission-denied (\"Creating file with prefix\" 
\"Permission denied\" 
\"/usr/lib/emacs/30.0.50/native-lisp/30.0.50-58a66af6/test-98b414c9-ac29ecab\")
  mapbacktrace(#f(compiled-function (evald func args flags) 
  #<bytecode 0xd45c107f3ae87e6>))
  debug-early-backtrace()
  debug-early(error (permission-denied \"Creating file with 
  prefix\" \"Permission denied\" 
  \"/usr/lib/emacs/30.0.50/native-lisp/30.0.50-58a66af6/test-98b414c9-ac29ecab\"))
  make-temp-file(\"/usr/lib/emacs/30.0.50/native-lisp/30.0.50-58a66af6/test-98b414c9-ac29ecab\" 
  nil \".eln.tmp\" nil)
  comp--compile-ctxt-to-file(\"/usr/lib/emacs/30.0.50/native-lisp/30.0.50-58a66af6/test-98b414c9-ac29ecab.eln\")
  comp-compile-ctxt-to-file(\"/usr/lib/emacs/30.0.50/native-lisp/30.0.50-58a66af6/test-98b414c9-ac29ecab.eln\")
  comp-final1()
  load-with-code-conversion(\"/tmp/emacs-int-comp-test-98b414c9-ac29ecab-my5A7o.el\" 
  \"/tmp/emacs-int-comp-test-98b414c9-ac29ecab-my5A7o.el\" nil t)
  command-line-1((\"-l\" 
  \"/tmp/emacs-int-comp-test-98b414c9-ac29ecab-my5A7o.el\"))
  command-line()
  normal-top-level()