Hello,
I faced a bug that is related to
Alert package, but as I'm having it
in one of my Emacs config copies and not in an earlier one, that makes
it somehow not specific to Alert package. So, I debugged it till I
figured what the real cause is. It turned out that since byte compile
in child process
(#657)
commit, building Alert is not correctly handled. You can notice that by
two factors:
/straight/build/alert/alert.elc file.(defalias 'alert-log-notify' ...) is not completely compiled, not(alert "test") an error will shows up:Debugger entered--Lisp error: (invalid-function log4e:deflogger)
log4e:deflogger("alert" "%t [%l] %m" "%H:%M:%S")
alert-log-notify((:message "test" :title "*scratch*" :icon nil :severity normal :category nil :buffer #<buffer *scratch*> :mode lisp-interaction-mode :id nil :data nil))
alert("test")
(progn (alert "test"))
eval((progn (alert "test")) t)
elisp--eval-last-sexp(nil)
eval-last-sexp(nil)
funcall-interactively(eval-last-sexp nil)
call-interactively(eval-last-sexp nil nil)
command-execute(eval-last-sexp)
Here are the steps to reproduce this bug:
(setq straight-repository-branch "develop")
(setq straight-base-dir user-emacs-directory)
(defvar bootstrap-version)
(let ((bootstrap-file
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
(bootstrap-version 5))
(unless (file-exists-p bootstrap-file)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
'silent 'inhibit-cookies)
(goto-char (point-max))
(eval-print-last-sexp)))
(load bootstrap-file nil 'nomessage))
(straight-use-package 'use-package)
(use-package alert
:straight t)
*scratch* buffer and evaluate (alert "test"). An errorNo bug occur when checking out any commit before
48296ba018a37899b7766f9fb827da5f75eb8178, like this:
cd) to Straight repository directory.git checkout 8e99d311884f4983108d1d65cddb721ba43c939b./straight/build/alert directory to let Straight(alert "test"). No error occur.I don't know if this bug should be fixed in Alert or Straight; anyway,
it's already issued there: [invalid-function: log4e:deflogger
Simply let Straight with old commit, like mentioned in "No bug" section
above, compile Alert correctly. Then replace /straight/build/alert
directory with the one you compiled now.
Thank you!
Thank you for the report. I can verify the behavior with the following test:
(straight-bug-report
:user-dir "alert-byte-compile.develop"
:preserve t
:pre-bootstrap
(setq straight-repository-branch "develop")
:post-bootstrap
(straight-use-package 'alert)
(alert "test"))
2021-01-23 09:56:07gnu/linuxprerelease (HEAD -> develop, origin/develop) 47dd03d 2021-01-21GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.17.4, Xaw3d scroll bars)
of 2021-01-18Output
Bootstrapping straight.el...
Bootstrapping straight.el...done
Rebuilding all packages due to build cache schema change
Looking for gnu-elpa-mirror recipe โ Cloning melpa...
Looking for gnu-elpa-mirror recipe โ Cloning melpa...done
Looking for emacsmirror-mirror recipe โ Cloning gnu-elpa-mirror...
Looking for emacsmirror-mirror recipe โ Cloning gnu-elpa-mirror...done
Looking for emacsmirror-mirror recipe โ Cloning el-get...
Looking for emacsmirror-mirror recipe โ Cloning el-get...done
Looking for straight recipe โ Cloning emacsmirror-mirror...
Looking for straight recipe โ Cloning emacsmirror-mirror...done
Building straight...
Building straight...done
Test run with version: prerelease (HEAD -> develop, origin/develop) 47dd03d 2021-01-21
Cloning alert...
Cloning alert...done
Building alert...
Building alert โ Cloning gntp.el...
Building alert โ Cloning gntp.el...done
Building alert โ Building gntp...
Building alert โ Building gntp...done
Building alert โ Cloning log4e...
Building alert โ Cloning log4e...done
Building alert โ Building log4e...
Building alert โ Building log4e...done
Building alert...
Building alert...done
Debugger entered--Lisp error: (invalid-function log4e:deflogger)
log4e:deflogger("alert" "%t [%l] %m" "%H:%M:%S")
alert-log-notify((:message "test" :title "*scratch*" :icon nil :severity normal :category nil :buffer #<buffer *scratch*> :mode lisp-interaction-mode :id nil :data nil))
alert("test")
(let ((straight-bug-report-args '(:post-bootstrap (progn (straight-use-package 'alert) (alert "test")) :pre-bootstrap (progn (setq straight-repository-branch "develop")) :preserve t :user-dir "/tmp/alert-byte-compile.develop" :executable "/usr/bin/emacs"))) (setq user-emacs-directory "/tmp/alert-byte-compile.develop") (setq straight-repository-branch "develop") (setq debug-on-error t) (setq straight-repository-branch "develop") (defvar bootstrap-version) (let ((bootstrap-file (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) (bootstrap-version 5)) (unless (file-exists-p bootstrap-file) (with-current-buffer (url-retrieve-synchronously (concat "https://raw.githubusercontent.com/" "raxod502/straight.el/develop/install.el") 'silent 'inhibit-cookies) (goto-char (point-max)) (eval-print-last-sexp))) (load bootstrap-file nil 'nomessage)) (condition-case nil (message "Test run with version: %s" (straight-version)) (error nil)) (straight-use-package 'alert) (alert "test"))
eval((let ((straight-bug-report-args '(:post-bootstrap (progn (straight-use-package ...) (alert "test")) :pre-bootstrap (progn (setq straight-repository-branch "develop")) :preserve t :user-dir "/tmp/alert-byte-compile.develop" :executable "/usr/bin/emacs"))) (setq user-emacs-directory "/tmp/alert-byte-compile.develop") (setq straight-repository-branch "develop") (setq debug-on-error t) (setq straight-repository-branch "develop") (defvar bootstrap-version) (let ((bootstrap-file (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) (bootstrap-version 5)) (unless (file-exists-p bootstrap-file) (with-current-buffer (url-retrieve-synchronously (concat "https://raw.githubusercontent.com/" "raxod502/straight.el/develop/install.el") 'silent 'inhibit-cookies) (goto-char (point-max)) (eval-print-last-sexp))) (load bootstrap-file nil 'nomessage)) (condition-case nil (message "Test run with version: %s" (straight-version)) (error nil)) (straight-use-package 'alert) (alert "test")) t)
command-line-1(("--eval" "(let\n ((straight-bug-report-args\n '(:post-..."))
command-line()
normal-top-level()
My initial hunch is that we're not adding package dependencies to the load-path in the compilation environment.
In this case alert requires log4e and its log4e:deflogger macro.
I will look into this more tonight and report back.
I'd like to do a little more testing and work out one formatting issue before merging.
Will take care of that tomorrow.
I checked out the PR (685) and it worked with me regarding the bug I
issued.
Thank you for looking into this and for your valuable contributions to
this project.
No worries, take your time. I will leave this issue open to let you
close it when the time is right. Thanks!
I checked out the PR (685) and it worked with me regarding the bug I
issued.Thank you for looking into this and for your valuable contributions to
this project.
Thank you for catching this bug, reporting, and testing.
No worries, take your time. I will leave this issue open to let you
close it when the time is right. Thanks!
Merged into latest "develop" https://github.com/raxod502/straight.el/commit/cd10de6895800802760d67d021e65da370c801f0