GNU bug report logs - #10593
24.0.92; package.el doesn't initialize dependencies when installing

Previous Next

Package: emacs;

Reported by: Donald Ephraim Curtis <dcurtis <at> milkbox.net>

Date: Tue, 24 Jan 2012 07:46:02 UTC

Severity: normal

Found in version 24.0.92

Done: Chong Yidong <cyd <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 10593 in the body.
You can then email your comments to 10593 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#10593; Package emacs. (Tue, 24 Jan 2012 07:46:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Donald Ephraim Curtis <dcurtis <at> milkbox.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 24 Jan 2012 07:46:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Donald Ephraim Curtis <dcurtis <at> milkbox.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.0.92; package.el doesn't initialize dependencies when installing
Date: Tue, 24 Jan 2012 01:36:08 -0600
I am attempting to install the package "clojurescript-mode" which
depends on "clojure-mode" using package.el.  clojurescript-mode properly
cites clojure-mode as a dependency and in the source does a (require
'clojure-mode).  However, inside `package-download-transaction' there is
never a call to `package-initialize' or any other function to actually
add the newly installed `clojure-mode' to the load-path.  It ends up in
this case that everything turns out fine, but there are other cases
where multiple levels of dependencies exist and a simple (require '...)
causes breakage.  I am able to reproduce this with the `rinari' package
that installs from packages in Marmalade and Tromey's repository.

Compiling no file at Tue Jan 24 01:34:58 2012
Leaving directory `/Users/dcurtis/.emacs.d/elpa/rinari-2.3'
Compiling file /Users/dcurtis/.emacs.d/elpa/rinari-2.3/rinari-pkg.el at Tue Jan 24 01:34:58 2012
Entering directory `/Users/dcurtis/.emacs.d/elpa/rinari-2.3/'
Compiling file /Users/dcurtis/.emacs.d/elpa/rinari-2.3/rinari.el at Tue Jan 24 01:34:58 2012
rinari.el:80:1:Error: Cannot open load file: inf-ruby

The packages continue to install, that's not a problem, but they don't get compiled,

total 104
-rw-r--r--  1 dcurtis  staff   1077 Jan 24 01:34 rinari-autoloads.el
-rw-r--r--  1 dcurtis  staff    259 Jan 24 01:34 rinari-autoloads.el~
-rw-r--r--  1 dcurtis  staff    145 Jan 24 01:34 rinari-pkg.el
-rw-r--r--  1 dcurtis  staff    665 Jan 24 01:34 rinari-pkg.elc
-rw-r--r--  1 dcurtis  staff  35503 Jan 24 01:34 rinari.el

If this is a bug in the packages, I'd be happy to trace it down, but
changing `package-download-transaction' as follows fixed my problem;
note the (package-initialize) at the bottom...


(defun package-download-transaction (package-list)
  "Download and install all the packages in PACKAGE-LIST.
PACKAGE-LIST should be a list of package names (symbols).
This function assumes that all package requirements in
PACKAGE-LIST are satisfied, i.e. that PACKAGE-LIST is computed
using `package-compute-transaction'."
  (dolist (elt package-list)
    (let* ((desc (cdr (assq elt package-archive-contents)))
	   ;; As an exception, if package is "held" in
	   ;; `package-load-list', download the held version.
	   (hold (cadr (assq elt package-load-list)))
	   (v-string (or (and (stringp hold) hold)
			 (package-version-join (package-desc-vers desc))))
	   (kind (package-desc-kind desc)))
      (cond
       ((eq kind 'tar)
	(package-download-tar elt v-string))
       ((eq kind 'single)
	(package-download-single elt v-string
				 (package-desc-doc desc)
				 (package-desc-reqs desc)))
       (t
	(error "Unknown package kind: %s" (symbol-name kind)))))
    (package-initialize)))

    


In GNU Emacs 24.0.92.1 (i386-apple-darwin11.2.0, NS apple-appkit-1138.23)
of 2012-01-23 on bird.local
Windowing system distributor `Apple', version 10.3.1138
configured using `configure  '--prefix=/usr/local/Cellar/emacs/HEAD' '--without-dbus' '--enable-locallisppath=/usr/local/share/emacs/site-lisp' '--infodir=/usr/local/Cellar/emacs/HEAD/share/info/emacs' '--with-ns' '--disable-ns-self-contained' 'CC=/usr/bin/llvm-gcc' 'CFLAGS=-O3 -w -pipe -march=core2 -msse4''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: nil
  value of $XMODIFIERS: nil
  locale-coding-system: nil
  default enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  paredit-mode: t
  hl-line-mode: t
  idle-highlight-mode: t
  whitespace-mode: t
  savehist-mode: t
  recentf-mode: t
  ido-ubiquitous: t
  ido-everywhere: t
  show-paren-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
M-: ( p a c k a g e - i n s t a l l SPC ' c l o j u 
r e s c r i p t - m o d e ) <return> C-n C-x RET r 
e p o r t <return>

Recent messages:
(No changes need to be saved)
(No files need saving)
Checking /Users/dcurtis/.emacs.d/elpa/clojurescript-mode-20120123... [2 times]
Compiling /Users/dcurtis/.emacs.d/elpa/clojurescript-mode-20120123/clojurescript-mode-pkg.el...done
Wrote /Users/dcurtis/.emacs.d/elpa/clojurescript-mode-20120123/clojurescript-mode-pkg.elc
Checking /Users/dcurtis/.emacs.d/elpa/clojurescript-mode-20120123...
Compiling /Users/dcurtis/.emacs.d/elpa/clojurescript-mode-20120123/clojurescript-mode.el...
Checking /Users/dcurtis/.emacs.d/elpa/clojurescript-mode-20120123...
Done (Total of 1 file compiled, 1 failed, 1 skipped)
t
byte-code: End of buffer

Load-path shadows:
~/.emacs.d/custom hides /usr/local/Cellar/emacs/HEAD/share/emacs/24.0.92/lisp/custom
/Users/dcurtis/.emacs.d/elpa/magit-20120122/.dir-locals hides /usr/local/Cellar/emacs/HEAD/share/emacs/24.0.92/lisp/gnus/.dir-locals

Features:
(shadow sort flyspell ispell mail-extr message format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mailabbrev gmm-utils mailheader
emacsbug clojurescript-mode-autoloads clojure-mode-autoloads rx compile
comint ring time-stamp vc-git regexp-opt autoload mail-utils url-cache
network-stream starttls url-http tls mail-parse rfc2231 rfc2047 rfc2045
ietf-drums url-gw url-auth url url-proxy url-privacy url-expand
url-methods url-history url-cookie url-util url-parse auth-source eieio
assoc gnus-util password-cache url-vars mm-util mail-prsvr mailcap
finder-inf paredit hl-line saveplace idle-highlight-mode thingatpt
whitespace molokai-theme savehist recentf tree-widget wid-edit easymenu
autorevert cua-base cus-start cus-load byte-opt warnings bytecomp
byte-compile cconv macroexp server misc midnight
starter-kit-bindings-autoloads windmove starter-kit-autoloads edmacro
kmacro smex starter-kit-misc ffap ido-ubiquitous ido paren
starter-kit-defuns uniquify advice help-fns advice-preload
magit-autoloads ido-ubiquitous-autoloads smex-autoloads
find-file-in-project-autoloads idle-highlight-mode-autoloads
paredit-autoloads package tabulated-list defun cl time-date tooltip
ediff-hook vc-hooks lisp-float-type mwheel ns-win tool-bar dnd fontset
image fringe 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 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)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10593; Package emacs. (Tue, 24 Jan 2012 20:56:01 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Donald Ephraim Curtis <dcurtis <at> coe.edu>
To: Donald Ephraim Curtis <dcurtis <at> milkbox.net>,
 bug-gnu-emacs <at> gnu.org
Subject: bug#10593: 24.0.92;
	package.el doesn't initialize dependencies when installing
Date: Tue, 24 Jan 2012 13:42:37 -0600
I have fixed my problems with advice,  hopefully this can help with a patch to package.el,

(defadvice package-download-tar (after package-download-tar-initialize activate compile)
  "initialize the package after compilation"
  (package-initialize))

(defadvice package-download-single (after package-download-single-initialize activate compile)
  "initialize the package after compilation"
  (package-initialize))


(defadvice package-compute-transaction (before
                                        package-compute-transaction-reverse (package-list requirements)
                                        activate compile)
  "reverse the requirements"
  (setq requirements (reverse requirements)))


The first two just make sure that packages get initialized after they get installed.  However, this was not enough.  It turns out package A has,

;; Package-Requires: ((ruby-mode "1.1") (inf-ruby "2.2.1") (ruby-compilation "0.8") (jump "2.0"))

ruby-compilation requires ruby-mode and inf-ruby, 

;; Package-Requires: ((ruby-mode "1.1") (inf-ruby "2.2.1"))


However, when I'd actually install the first package, it would first install "jump", then install "ruby-compilation" -- which would fail to compile because "inf-ruby" and "ruby-mode" weren't installed.  So the third set of advice was just to make sure that the requirements are installed in the proper order (which is reverse of what they are generated.

This is not necessarily ideal.  It seems like somehow there needs to be some proper ordering done by package.el, but I haven't had time or knowledge to try to get this working.  I thought I would send this to bugs first.



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#10593; Package emacs. (Sat, 28 Jan 2012 08:16:02 GMT) Full text and rfc822 format available.

Message #11 received at 10593 <at> debbugs.gnu.org (full text, mbox):

From: Chong Yidong <cyd <at> gnu.org>
To: Donald Ephraim Curtis <dcurtis <at> milkbox.net>
Cc: 10593 <at> debbugs.gnu.org
Subject: Re: bug#10593: 24.0.92;
	package.el doesn't initialize dependencies when installing
Date: Sat, 28 Jan 2012 16:14:23 +0800
Donald Ephraim Curtis <dcurtis <at> milkbox.net> writes:

> I am attempting to install the package "clojurescript-mode" which
> depends on "clojure-mode" using package.el.  clojurescript-mode properly
> cites clojure-mode as a dependency and in the source does a (require
> 'clojure-mode).  However, inside `package-download-transaction' there is
> never a call to `package-initialize' or any other function to actually
> add the newly installed `clojure-mode' to the load-path.  It ends up in
> this case that everything turns out fine, but there are other cases
> where multiple levels of dependencies exist and a simple (require '...)
> causes breakage.  I am able to reproduce this with the `rinari' package
> that installs from packages in Marmalade and Tromey's repository.
>
> If this is a bug in the packages, I'd be happy to trace it down, but
> changing `package-download-transaction' as follows fixed my problem

Thanks for the bug report.  I've committed a different fix to the
version of package.el in the Emacs trunk.




bug closed, send any further explanations to 10593 <at> debbugs.gnu.org and Donald Ephraim Curtis <dcurtis <at> milkbox.net> Request was from Chong Yidong <cyd <at> gnu.org> to control <at> debbugs.gnu.org. (Sat, 28 Jan 2012 08:16:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 25 Feb 2012 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 12 years and 89 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.