unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#10593: 24.0.92; package.el doesn't initialize dependencies when installing
@ 2012-01-24  7:36 Donald Ephraim Curtis
  2012-01-24 19:42 ` Donald Ephraim Curtis
  2012-01-28  8:14 ` Chong Yidong
  0 siblings, 2 replies; 3+ messages in thread
From: Donald Ephraim Curtis @ 2012-01-24  7:36 UTC (permalink / raw)
  To: 10593

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)





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#10593: 24.0.92; package.el doesn't initialize dependencies when installing
  2012-01-24  7:36 bug#10593: 24.0.92; package.el doesn't initialize dependencies when installing Donald Ephraim Curtis
@ 2012-01-24 19:42 ` Donald Ephraim Curtis
  2012-01-28  8:14 ` Chong Yidong
  1 sibling, 0 replies; 3+ messages in thread
From: Donald Ephraim Curtis @ 2012-01-24 19:42 UTC (permalink / raw)
  To: dcurtis, 10593

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.




^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#10593: 24.0.92; package.el doesn't initialize dependencies when installing
  2012-01-24  7:36 bug#10593: 24.0.92; package.el doesn't initialize dependencies when installing Donald Ephraim Curtis
  2012-01-24 19:42 ` Donald Ephraim Curtis
@ 2012-01-28  8:14 ` Chong Yidong
  1 sibling, 0 replies; 3+ messages in thread
From: Chong Yidong @ 2012-01-28  8:14 UTC (permalink / raw)
  To: Donald Ephraim Curtis; +Cc: 10593

Donald Ephraim Curtis <dcurtis@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.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-01-28  8:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-24  7:36 bug#10593: 24.0.92; package.el doesn't initialize dependencies when installing Donald Ephraim Curtis
2012-01-24 19:42 ` Donald Ephraim Curtis
2012-01-28  8:14 ` Chong Yidong

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).