help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Invalid function error when loading elisp through native compilation


From: tpeplt
Subject: Re: Invalid function error when loading elisp through native compilation
Date: Sun, 03 Mar 2024 16:58:26 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

"picnoir" <picnoir@alternativebit.fr> writes:

> Hi,
>
> I'm facing a puzzling error that only manifests using native
> compilation.
>
> If I evaluate this particular elisp file:
> https://github.com/picnoir/my-repo-pins/blob/master/my-repo-pins.el
> using eval-buffer (ie. not natively compiled), I can run the following
> snippet just fine:
>
>   (my-repo-pins--clone-project "test/test")

Note: I am using Emacs 29.2 on GNU/Linux.  I did not get the same
results as you described and part of the reason might be due to
differing versions of Emacs.

1. The URL you provided does not give access to the file
‘my-repo-pins.el’ within Emacs.  Here is a URL that other readers should
be able to use in order to view your source file:

https://raw.githubusercontent.com/picnoir/my-repo-pins/master/my-repo-pins.el

2. After downloading your source file, I loaded it into Emacs using:

  $ emacs -Q my-repo-pins.el

3. I then byte-compiled the file and loaded it into Emacs using the
‘Emacs-Lisp’ menu entry ‘Byte compile and Load’.  (There were a number
of warnings about the use of single quotes in several functions’
docstrings due to a new syntax requirement, but those can be ignored for
this discussion.)

4. I switched to the *scratch* buffer and evaluated the following
expression using C-x C-e:

   (my-repo-pins--clone-project "test/test")

This caused the debugger to be triggered and a stack trace ("backtrace")
of function calls was generated.  That backtrace is included at the end
of this message in case you or any readers might be able to follow it to
point out some error(s).

Note that I did NOT compile the elisp file natively.  The error was
generated after byte-compiling the file only.  The positive point from
this is that backtrace might be useful for finding the source of the
problem, and eliminating it from the natively-compiled version, too.

5. Backtrace:

Debugger entered--Lisp error: (invalid-function 
(my-repo-pins--query-github-owner-repo "test" "test" (lambda (result) (let 
((new-state (if (null result) 'not-found result))) 
(my-repo-pins--update-forges-state "GitHub.com" new-state "test/test")))))
  (my-repo-pins--query-github-owner-repo "test" "test" (lambda (result) (let 
((new-state (if (null result) 'not-found result))) 
(my-repo-pins--update-forges-state "GitHub.com" new-state 
"test/test"))))(my-repo-pins--query-github-owner-repo "test" "test" (lambda 
(result) (let ((new-state (if (null result) 'not-found result))) 
(my-repo-pins--update-forges-state "GitHub.com" new-state "test/test"))))
  #f(compiled-function (forge) #<bytecode 0x823cf967506dbe8>)(("GitHub.com" 
(query-user-repo . my-repo-pins--query-github-owner-repo)))
  mapcar(#f(compiled-function (forge) #<bytecode 0x823cf967506dbe8>) 
(("GitHub.com" (query-user-repo . my-repo-pins--query-github-owner-repo)) 
("GitLab.com" (query-user-repo lambda (owner repo cb) 
(my-repo-pins--query-gitlab-owner-repo "gitlab.com" owner repo cb))) 
("git.sr.ht" (query-user-repo lambda (owner repo cb) 
(my-repo-pins--query-sourcehut-owner-repo "git.sr.ht" owner repo cb))) 
("Codeberg.org" (query-user-repo lambda (owner repo cb) 
(my-repo-pins--query-gitea-owner-repo "codeberg.org" owner repo cb)))))
  #f(compiled-function #'sequence #<bytecode 
0x1857601701b27f74>)(#f(compiled-function (forge) #<bytecode 
0x823cf967506dbe8>) (("GitHub.com" (query-user-repo . 
my-repo-pins--query-github-owner-repo)) ("GitLab.com" (query-user-repo lambda 
(owner repo cb) (my-repo-pins--query-gitlab-owner-repo "gitlab.com" owner repo 
cb))) ("git.sr.ht" (query-user-repo lambda (owner repo cb) 
(my-repo-pins--query-sourcehut-owner-repo "git.sr.ht" owner repo cb))) 
("Codeberg.org" (query-user-repo lambda (owner repo cb) 
(my-repo-pins--query-gitea-owner-repo "codeberg.org" owner repo cb)))))
  apply(#f(compiled-function #'sequence #<bytecode 0x1857601701b27f74>) 
#f(compiled-function (forge) #<bytecode 0x823cf967506dbe8>) (("GitHub.com" 
(query-user-repo . my-repo-pins--query-github-owner-repo)) ("GitLab.com" 
(query-user-repo lambda (owner repo cb) (my-repo-pins--query-gitlab-owner-repo 
"gitlab.com" owner repo cb))) ("git.sr.ht" (query-user-repo lambda (owner repo 
cb) (my-repo-pins--query-sourcehut-owner-repo "git.sr.ht" owner repo cb))) 
("Codeberg.org" (query-user-repo lambda (owner repo cb) 
(my-repo-pins--query-gitea-owner-repo "codeberg.org" owner repo cb)))) nil)
  seq-map(#f(compiled-function (forge) #<bytecode 0x823cf967506dbe8>) 
(("GitHub.com" (query-user-repo . my-repo-pins--query-github-owner-repo)) 
("GitLab.com" (query-user-repo lambda (owner repo cb) 
(my-repo-pins--query-gitlab-owner-repo "gitlab.com" owner repo cb))) 
("git.sr.ht" (query-user-repo lambda (owner repo cb) 
(my-repo-pins--query-sourcehut-owner-repo "git.sr.ht" owner repo cb))) 
("Codeberg.org" (query-user-repo lambda (owner repo cb) 
(my-repo-pins--query-gitea-owner-repo "codeberg.org" owner repo cb)))))
  my-repo-pins--query-forge-fetchers("test/test")
  my-repo-pins--clone-project("test/test")
  (progn (my-repo-pins--clone-project "test/test"))
  elisp--eval-last-sexp(nil)
  eval-last-sexp(nil)
  funcall-interactively(eval-last-sexp nil)
  command-execute(eval-last-sexp)

End of Backtrace.

--



reply via email to

[Prev in Thread] Current Thread [Next in Thread]