emacs-devel
[Top][All Lists]
Advanced

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

Elpa packages and macro dependencies.


From: bruce . connor . am
Subject: Elpa packages and macro dependencies.
Date: Thu, 16 Oct 2014 17:06:15 +0100

I'm running into a problem, but I'm not sure it's actually a bug, so I'm bringing it here.

Say a user has an Elpa package installed, called A (version 1.0) and would like to install package B.
Package B has a (require 'A) statement, because it uses one of A's macros. However, B lists (A "1.1") in its PackageRequires, because it uses some new feature of this macro which was added in version 1.1.

1. Our innocent user then launches `list-packages', and selects to install B.
2. Package.el knows that B depends on A-1.1, so it upgrades A first.
3. However, _if I understand things correctly_, package.el doesn't reload A after upgrading it, which means that the old definitions are still active!
4. Once it proceeds to byte-compile the newly installed B, the (require 'A) statement won't load anything because the old A is already loaded. And the byte-compilation of B will use the old macro definition, despite B specifically listing A-1.1 as a dependency!
5. Restarting Emacs won't fix it because B was already compiled wrong. The user has to restart Emacs, AND reinstall (or recompile) B.

Am I correct in my understanding?
I believe this would be avoided by using (load "A") instead of (require 'A). Is this advisable?
Would this problem go away if B used (eval-when-compile (require 'A))?

Best and Thanks,
Artur

reply via email to

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