Deferred dependencies prevent loading of packages
Closed this issue · 17 comments
Sometimes if a requirement cannot be satisfied, req-package will simply fail silently.
It would be very neat if at least it would show which package was failing (and even better why).
Is this a known issue? Would you require a test case?
Hi. Do you have any messages in req-package log?
req-package designed not to fail, but load as many packages as possible. all errors must be logged.
No messages in neither messages nor the req-package log. It simply
silently refuses to load the package. I will give you a minimal init.el
that replicates the issue when I get back.
On Sep 24, 2015 3:14 PM, "Edward Knyshov" notifications@github.com wrote:
Hi. Do you have any messages in req-package log?
—
Reply to this email directly or view it on GitHub
#26 (comment).
Try running /usr/bin/emacs -Q -l init.el
with this init.el:
(require 'package)
(setq req-package-log-level 'debug
use-package-verbose t)
(setq package-enable-at-startup nil
package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
("marmalade" . "https://marmalade-repo.org/packages/")
("melpa" . "https://melpa.org/packages/")
("melpa-stable" . "https://stable.melpa.org/packages/"))
package-pinned-packages
'((git-commit . "melpa-stable")
(magit . "melpa-stable")))
(package-initialize)
(require 'req-package)
;; (req-package git-commit :defer t)
(req-package magit
:require (git-commit)
:init (message "XXX: magit init")
:config (message "XXX: magit config"))
(req-package-finish)
(req-package--log-open-log)
Now try uncommenting the (req-package git-commit :defer t)
part. Now neither git-commit nor magit are loaded and there are no errors anywhere
I may be doing something wrong with the git-commit part (I know it's redundant in this case), but the issue of no errors messages is still valid.
I have noticed this issue several other package combinations - not just these 2.
Thank you a lot for the details, I will investigate it asap. Now I can say, that the idea was to require git-commit implicitly in this case. Something is broken now, so it's a bug.
Thanks. Further to this, I noticed that :require some-package
always loads it immediately instead of deferring it.
As an example, if I add this to the magit configuration:
:bind ("C-c v s" . magit-status)
Then magit is lazy loaded properly, but git-commit is loaded immediately.
17:55:26 [DEBUG] package requested: magit
17:55:26 [DEBUG] package requests finished: 2 packages are waiting
17:55:26 [DEBUG] installing package git-commit
17:55:26 [DEBUG] installing package magit
17:55:27 [INFO ] package loaded: git-commit
I can't figure out if that's by design or there would be any downside to always lazy loading any :require
d package.
A brief update - with use-package-20150926.846 is still present in req-package.
Hi, i tried this config on current req-package and it works. Which version of req-package do you use?
Also the issue about defer is known. Package x dependency y defers packages loading x after y.
It rather complicated issue, which will be solved in release 1.0
Hi, with the latest version of req-package (updated just now), the problem persists. If I remove the comments in front of the (req-package git-commit :defer t)
line, I do not see see the XXX messages in Messages.
Could you please try parametrized :defer, :defer 10s
, for example?
I tried :defer 10
and that works!
Ok. I have an idea. Referrring to use-package readme, :defer t is used when you have some autoloading (like (autoload ... ...)
) code inside your :init
section. You can use :defer t
to make use-package not load package now. So as I mentioned if one package is deferred, all requiring packages wil also be deferred. So that's why your packages do no load at all. This issue will be partialy but not fully solved in next release for that simple cases. Let's leave this issue opened for some time.
Am I correct in assuming that the intended behaviour is still for :defer t
to work on a require
d package and to lazy-load it? If not, it kind of defeats the purpose of req-package.
Yes, :defer t
, currently defeats req-package, I have to figure out, how to fix it. If some dependencies are deferred, I need to somehow load them if dependent package is about to be loaded.
Currently I have some packages that quite common dependency for others: chord, helm, flycheck. I load this packages immediately and load dependent packages deferring to bindings, chords and commands.
I tried changing (req-package git-commit :defer t)
to this instead:
(req-package git-commit
:commands (global-git-commit-mode))
Just to see if forcing :defer t
is different from when a package is deferred implicitly by defining the commands.
It doesn't however, make a difference.
Another issue with require
of a deferred package, is that the key binding for magit isn't set up either.
With regular use-package
it works.