* bug#14082: 24.3; Package dependences calculated in reverse
@ 2013-03-28 20:38 Donald Curtis
2013-04-04 2:46 ` Stefan Monnier
0 siblings, 1 reply; 4+ messages in thread
From: Donald Curtis @ 2013-03-28 20:38 UTC (permalink / raw)
To: 14082
When `package.el' calculates package dependencies, they are installed in
the incorrect order.
Consider the rinari third-party package,
* rinari requires: ruby-mode, inf-ruby, ruby-compilation, jump
* jump requires: findr, inflections
* ruby-compilation requires: inf-ruby
Yet, the order of compilation appears to be:
1. inflections
2. findr
3. jump
4. ruby-compilation *fails missing inf-ruby*
5. inf-ruby
6. rinary *fails missing ruby-compilation*
It seems to be that the `jump' dependency of `rinari' is being installed
first, and even it's dependencies are being installed in a reverse
order.
The way that I have personally fixed this problem was to add advice to
the `package-compute-transaction' function:
(defadvice package-compute-transaction
(before
package-compute-transaction-reverse (package-list requirements)
activate compile)
"reverse the requirements"
(setq requirements (reverse requirements))
(print requirements))
It seems like there must be something in the way the requirements is
being built that means that when they are read they are done in reverse
order.
In GNU Emacs 24.3.1 (x86_64-apple-darwin12.3.0, NS apple-appkit-1187.37)
of 2013-03-28 on hendrix.local
Windowing system distributor `Apple', version 10.3.1187
Configured using:
`configure '--prefix=/usr/local/Cellar/emacs/24.3' '--without-dbus'
'--enable-locallisppath=/usr/local/share/emacs/site-lisp'
'--infodir=/usr/local/Cellar/emacs/24.3/share/info/emacs' '--with-ns'
'--disable-ns-self-contained' 'CC=cc''
Important settings:
locale-coding-system: utf-8
default enable-multibyte-characters: t
Major mode: Info
Minor modes in effect:
which-function-mode: t
ido-everywhere: t
delete-selection-mode: t
global-subword-mode: t
subword-mode: t
winner-mode: t
show-paren-mode: t
savehist-mode: t
shell-dirtrack-mode: t
global-auto-revert-mode: t
recentf-mode: t
tooltip-mode: t
mouse-wheel-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
buffer-read-only: t
column-number-mode: t
line-number-mode: t
transient-mark-mode: t
Recent input:
C-x RET p a c k <tab> l i <tab> <return> C-s r i n
a r C-a i x y C-x b C-g C-x RET b u g <tab> <tab> C-w
C-w C-w c r e s u b C-g C-s s m e x C-a i x y C-x RET
b u g C-n C-n C-n C-n C-n C-n C-n C-n <return> C-n
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n
C-n C-n C-n C-n C-n C-n C-n C-n <tab> <S-tab> <return>
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n <left> C-b
<S-tab> <S-tab> <S-tab> <tab> <tab> C-p C-p C-p C-p
C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p
C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p C-p
C-p C-p C-p C-p C-p C-p <tab> C-p C-n C-n C-n C-n C-p
C-p C-p C-p C-p M-f M-f M-f M-f M-f M-[ ESC ESC ESC
ESC C-g C-g C-x b b u g <backspace> <backspace> <backspace>
C-g C-x RET e m a c s b u g C-n <return> P a c k a
g e SPC D e p e n d e n c e s SPC C a l c u l a t e
d SPC i n SPC R e v e r s e <return> C-p C-n C-w h
e <backspace> <backspace> W h e n C-w C-w C-/ C-/ C-/
C-/ C-/ C-/ C-/ C-/ C-? C-? C-? C-c k C-x RET <ret
urn>
Recent messages:
Checking 70 files in /usr/local/Cellar/emacs/24.3/share/emacs/24.3/lisp/erc...
Checking 48 files in /usr/local/Cellar/emacs/24.3/share/emacs/24.3/lisp/emulation...
Checking 147 files in /usr/local/Cellar/emacs/24.3/share/emacs/24.3/lisp/emacs-lisp...
Checking 24 files in /usr/local/Cellar/emacs/24.3/share/emacs/24.3/lisp/cedet...
Checking 57 files in /usr/local/Cellar/emacs/24.3/share/emacs/24.3/lisp/calendar...
Checking 87 files in /usr/local/Cellar/emacs/24.3/share/emacs/24.3/lisp/calc...
Checking 77 files in /usr/local/Cellar/emacs/24.3/share/emacs/24.3/lisp/obsolete...
Checking 1 files in /usr/local/Cellar/emacs/24.3/share/emacs/24.3/leim...
Checking for load-path shadows...done
Undo! [8 times]
Load-path shadows:
~/.emacs.d/custom hides /usr/local/Cellar/emacs/24.3/share/emacs/24.3/lisp/custom
Features:
(shadow sort mail-extr emacsbug message rfc822 mml mml-sec mm-decode
mm-bodies mm-encode mailabbrev gmm-utils mailheader sendmail info smex
smex-autoloads rinari-autoloads easy-mmode inf-ruby ruby-mode
inf-ruby-autoloads ruby-compilation-autoloads inflections findr
jump-autoloads findr-autoloads compile inflections-autoloads autoload
misearch multi-isearch mule-util time-stamp vc-git mail-utils
network-stream starttls url-http tls mail-parse rfc2231 rfc2047 rfc2045
ietf-drums url-gw url-cache url-auth url url-proxy url-privacy
url-expand url-methods url-history url-cookie url-domsuf url-util
url-parse url-vars mailcap finder-inf whitespace base16-ocean-theme
which-func imenu cus-start cus-load rx ido delsel subword winner paren
savehist tramp-cache tramp-sh tramp tramp-compat auth-source eieio
gnus-util mm-util mail-prsvr password-cache tramp-loaddefs shell
pcomplete comint ansi-color ring format-spec autorevert byte-opt
warnings bytecomp byte-compile cconv edmacro kmacro windmove server
defun uniquify advice help-fns advice-preload saveplace recentf
tree-widget wid-edit misc midnight checkdoc thingatpt help-mode easymenu
package cl-macs gv cl cl-lib time-date tooltip ediff-hook vc-hooks
lisp-float-type mwheel ns-win tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment lisp-mode register page menu-bar
rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax
facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak
czech european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
make-network-process ns multi-tty emacs)
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#14082: 24.3; Package dependences calculated in reverse
2013-03-28 20:38 bug#14082: 24.3; Package dependences calculated in reverse Donald Curtis
@ 2013-04-04 2:46 ` Stefan Monnier
2013-04-05 15:27 ` Donald Curtis
0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2013-04-04 2:46 UTC (permalink / raw)
To: Donald Curtis; +Cc: 14082-done
> * rinari requires: ruby-mode, inf-ruby, ruby-compilation, jump
> * jump requires: findr, inflections
> * ruby-compilation requires: inf-ruby
> Yet, the order of compilation appears to be:
> 1. inflections
> 2. findr
> 3. jump
> 4. ruby-compilation *fails missing inf-ruby*
Indeed, thanks. I installed the patch below which should fix
this problem. Note that a better fix would be to first download packages,
the unpack packages, then autoload packages, then compile packages.
This way, ordering won't matter (including circular dependencies).
Stefan
=== modified file 'lisp/emacs-lisp/package.el'
--- lisp/emacs-lisp/package.el 2013-04-04 01:51:33 +0000
+++ lisp/emacs-lisp/package.el 2013-04-04 02:42:31 +0000
@@ -811,7 +811,10 @@
(package-version-join (package-desc-vers (cdr pkg-desc)))))
;; Only add to the transaction if we don't already have it.
(unless (memq next-pkg package-list)
- (push next-pkg package-list))
+ (setq package-list
+ ;; Move to front, so it gets installed early enough
+ ;; (bug#14082).
+ (cons next-pkg (delq next-pkg package-list))))
(setq package-list
(package-compute-transaction package-list
(package-desc-reqs
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#14082: 24.3; Package dependences calculated in reverse
2013-04-04 2:46 ` Stefan Monnier
@ 2013-04-05 15:27 ` Donald Curtis
2013-04-05 18:48 ` Stefan Monnier
0 siblings, 1 reply; 4+ messages in thread
From: Donald Curtis @ 2013-04-05 15:27 UTC (permalink / raw)
To: Stefan Monnier; +Cc: 14082-done
It appears the bug is still happening because if the package already exists then the new code will not get called because it is wrapped in the `unless'. The following patch works perfectly for me. It just always adds the package to the front.
diff --git a/package.el.orig b/package.el
index ab17ec1..064e1db 100644
--- a/package.el.orig
+++ b/package.el
@@ -810,11 +810,10 @@ but version %s required"
(symbol-name next-pkg) (package-version-join next-version)
(package-version-join (package-desc-vers (cdr pkg-desc)))))
;; Only add to the transaction if we don't already have it.
- (unless (memq next-pkg package-list)
- (setq package-list
- ;; Move to front, so it gets installed early enough
- ;; (bug#14082).
- (cons next-pkg (delq next-pkg package-list))))
+ (setq package-list
+ ;; Move to front, so it gets installed early enough
+ ;; (bug#14082).
+ (cons next-pkg (delq next-pkg package-list)))
(setq package-list
(package-compute-transaction package-list
(package-desc-reqs
Donald
On Apr 3, 2013, at 21:46, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>> * rinari requires: ruby-mode, inf-ruby, ruby-compilation, jump
>> * jump requires: findr, inflections
>> * ruby-compilation requires: inf-ruby
>
>> Yet, the order of compilation appears to be:
>
>> 1. inflections
>> 2. findr
>> 3. jump
>> 4. ruby-compilation *fails missing inf-ruby*
>
> Indeed, thanks. I installed the patch below which should fix
> this problem. Note that a better fix would be to first download packages,
> the unpack packages, then autoload packages, then compile packages.
> This way, ordering won't matter (including circular dependencies).
>
>
> Stefan
>
>
> === modified file 'lisp/emacs-lisp/package.el'
> --- lisp/emacs-lisp/package.el 2013-04-04 01:51:33 +0000
> +++ lisp/emacs-lisp/package.el 2013-04-04 02:42:31 +0000
> @@ -811,7 +811,10 @@
> (package-version-join (package-desc-vers (cdr pkg-desc)))))
> ;; Only add to the transaction if we don't already have it.
> (unless (memq next-pkg package-list)
> - (push next-pkg package-list))
> + (setq package-list
> + ;; Move to front, so it gets installed early enough
> + ;; (bug#14082).
> + (cons next-pkg (delq next-pkg package-list))))
> (setq package-list
> (package-compute-transaction package-list
> (package-desc-reqs
>
^ permalink raw reply related [flat|nested] 4+ messages in thread
* bug#14082: 24.3; Package dependences calculated in reverse
2013-04-05 15:27 ` Donald Curtis
@ 2013-04-05 18:48 ` Stefan Monnier
0 siblings, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2013-04-05 18:48 UTC (permalink / raw)
To: Donald Curtis; +Cc: 14082-done
> - (unless (memq next-pkg package-list)
> - (setq package-list
> - ;; Move to front, so it gets installed early enough
> - ;; (bug#14082).
> - (cons next-pkg (delq next-pkg package-list))))
> + (setq package-list
> + ;; Move to front, so it gets installed early enough
> + ;; (bug#14082).
> + (cons next-pkg (delq next-pkg package-list)))
Duh! Of course, you're right, sorry about that.
Should be fixed now,
Stefan
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-04-05 18:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-28 20:38 bug#14082: 24.3; Package dependences calculated in reverse Donald Curtis
2013-04-04 2:46 ` Stefan Monnier
2013-04-05 15:27 ` Donald Curtis
2013-04-05 18:48 ` Stefan Monnier
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).