unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* package.el can't install a circular depend and it should be able to.
@ 2013-01-04  0:24 Nic Ferrier
  2013-01-04 14:26 ` Tom Tromey
  0 siblings, 1 reply; 13+ messages in thread
From: Nic Ferrier @ 2013-01-04  0:24 UTC (permalink / raw)
  To: emacs-devel

I have a package called web which implements an HTTP client.

web has a test package called web-test that depends on web AND on elnode
(my HTTP webserver).

Elnode depends on web.

So here is the graph:

 web-test
   -> web
   -> elnode
        -> web

The trouble is package.el can't install this. It fails to install Elnode
because of the dependancy on web.

Why it does this I'm not sure. In my view it should work this way:

* satisfy the dependancy graph, keeping packages it has already
  encountered in some sort of table so it knows it has them already

* load the packages in some sensible order to satisfy the dependancy
  graph

Thoughts?



Nic Ferrier
teamchat.net, elnode, etc...



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

* Re: package.el can't install a circular depend and it should be able to.
  2013-01-04  0:24 package.el can't install a circular depend and it should be able to Nic Ferrier
@ 2013-01-04 14:26 ` Tom Tromey
  2013-01-04 17:15   ` Stephen J. Turnbull
  2013-01-12  2:43   ` Stefan Monnier
  0 siblings, 2 replies; 13+ messages in thread
From: Tom Tromey @ 2013-01-04 14:26 UTC (permalink / raw)
  To: Nic Ferrier; +Cc: emacs-devel

Nic> Why it does this I'm not sure. In my view it should work this way:

Nic> * satisfy the dependancy graph, keeping packages it has already
Nic>   encountered in some sort of table so it knows it has them already

Nic> * load the packages in some sensible order to satisfy the dependancy
Nic>   graph

Nic> Thoughts?

It was intended to do a topological sort of the graph and activate
packages from the bottom up.  If this isn't working then there is a bug.

A real circular graph isn't supported.  I guess it could be, though to
me it seems like this would have to be some kind of packaging confusion.

Tom



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

* Re: package.el can't install a circular depend and it should be able to.
  2013-01-04 14:26 ` Tom Tromey
@ 2013-01-04 17:15   ` Stephen J. Turnbull
  2013-01-11 23:27     ` Stefan Monnier
  2013-01-12  2:43   ` Stefan Monnier
  1 sibling, 1 reply; 13+ messages in thread
From: Stephen J. Turnbull @ 2013-01-04 17:15 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Nic Ferrier, emacs-devel

Tom Tromey writes:

 > A real circular graph isn't supported.  I guess it could be, though to
 > me it seems like this would have to be some kind of packaging confusion.

Why is it confusion?  Lisp environments have always supported mutual
recursion.  I'll grant that it would normally be technically possible
to refactor the packages to avoid it at the library level, but it
might be administratively inconvenient due to separate maintainership
and the like, or simply an historical artifact that the maintainers
don't want to refactor immediately.  I don't see why those cases
shouldn't be supported, although it might be appropriate to warn.

Steve




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

* Re: package.el can't install a circular depend and it should be able to.
  2013-01-04 17:15   ` Stephen J. Turnbull
@ 2013-01-11 23:27     ` Stefan Monnier
  0 siblings, 0 replies; 13+ messages in thread
From: Stefan Monnier @ 2013-01-11 23:27 UTC (permalink / raw)
  To: Stephen J. Turnbull; +Cc: Tom Tromey, Nic Ferrier, emacs-devel

>> A real circular graph isn't supported.  I guess it could be, though to
>> me it seems like this would have to be some kind of packaging confusion.
> Why is it confusion?  Lisp environments have always supported mutual
> recursion.  I'll grant that it would normally be technically possible
> to refactor the packages to avoid it at the library level, but it
> might be administratively inconvenient due to separate maintainership
> and the like, or simply an historical artifact that the maintainers
> don't want to refactor immediately.  I don't see why those cases
> shouldn't be supported, although it might be appropriate to warn.

I partly agree, but mutual recursion between ELPA packages should be
pretty damn rare (as opposed to mutual recursion between individual
Elisp files), so I don't think it's worth worrying about it.


        Stefan



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

* Re: package.el can't install a circular depend and it should be able to.
  2013-01-04 14:26 ` Tom Tromey
  2013-01-04 17:15   ` Stephen J. Turnbull
@ 2013-01-12  2:43   ` Stefan Monnier
  2013-01-12 14:14     ` Nic Ferrier
  2013-01-14 21:47     ` Tom Tromey
  1 sibling, 2 replies; 13+ messages in thread
From: Stefan Monnier @ 2013-01-12  2:43 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Nic Ferrier, emacs-devel

> It was intended to do a topological sort of the graph and activate
> packages from the bottom up.  If this isn't working then there is a bug.

Do we actually need such a topological sort?
I mean the only place where ordering might matter is when loading the
autoloads file, AFAICT (for all other steps like download, unpack, compile
the order in which packages are processed doesn't matter).


        Stefan



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

* Re: package.el can't install a circular depend and it should be able to.
  2013-01-12  2:43   ` Stefan Monnier
@ 2013-01-12 14:14     ` Nic Ferrier
  2013-01-12 15:03       ` Stefan Monnier
  2013-01-14 21:47     ` Tom Tromey
  1 sibling, 1 reply; 13+ messages in thread
From: Nic Ferrier @ 2013-01-12 14:14 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Tom Tromey, emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> It was intended to do a topological sort of the graph and activate
>> packages from the bottom up.  If this isn't working then there is a bug.
>
> Do we actually need such a topological sort?
> I mean the only place where ordering might matter is when loading the
> autoloads file, AFAICT (for all other steps like download, unpack, compile
> the order in which packages are processed doesn't matter).

That's not what I saw, as you can see from the original message?


Nic Ferrier



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

* Re: package.el can't install a circular depend and it should be able to.
  2013-01-12 14:14     ` Nic Ferrier
@ 2013-01-12 15:03       ` Stefan Monnier
  2013-01-12 16:27         ` Nic Ferrier
  0 siblings, 1 reply; 13+ messages in thread
From: Stefan Monnier @ 2013-01-12 15:03 UTC (permalink / raw)
  To: Nic Ferrier; +Cc: Tom Tromey, emacs-devel

> That's not what I saw, as you can see from the original message?

The original message doesn't make it clear what you saw (it just says
"The trouble is package.el can't install this. It fails to install
Elnode because of the dependancy on web." which doesn't say if
package.el refuses to do it, or tries to do it and signals an error at
some point, or does it but the result misbehaves in some way, ...).

But in any case, my message did not aim to describe the way package.el
works but the way it could/should work.


        Stefan



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

* Re: package.el can't install a circular depend and it should be able to.
  2013-01-12 15:03       ` Stefan Monnier
@ 2013-01-12 16:27         ` Nic Ferrier
  2013-01-13  0:02           ` Stefan Monnier
  0 siblings, 1 reply; 13+ messages in thread
From: Nic Ferrier @ 2013-01-12 16:27 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Tom Tromey, emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> That's not what I saw, as you can see from the original message?
>
> The original message doesn't make it clear what you saw (it just says
> "The trouble is package.el can't install this. It fails to install
> Elnode because of the dependancy on web." which doesn't say if
> package.el refuses to do it, or tries to do it and signals an error at
> some point, or does it but the result misbehaves in some way, ...).

Right. I thought I did describe it but I didn't include enough detail,
clearly:

- web-test begins an install of web
- web-test begins an install of elnode
- install of elnode begins an install of web

install fails because web cannot be found, even though it was requested
to be installed by web-test.


> But in any case, my message did not aim to describe the way package.el
> works but the way it could/should work.

Right, it does look like there's a bug.

Since it seems to be affecting only me atm (because only I am doing this
kind of stuff with emacs) I will try and find time to fix it.


Nic Ferrier



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

* Re: package.el can't install a circular depend and it should be able to.
  2013-01-12 16:27         ` Nic Ferrier
@ 2013-01-13  0:02           ` Stefan Monnier
  0 siblings, 0 replies; 13+ messages in thread
From: Stefan Monnier @ 2013-01-13  0:02 UTC (permalink / raw)
  To: Nic Ferrier; +Cc: Tom Tromey, emacs-devel

> Right. I thought I did describe it but I didn't include enough detail,
> clearly:
> - web-test begins an install of web
> - web-test begins an install of elnode
> - install of elnode begins an install of web

What do you mean by "begins an install of"?

> install fails because web cannot be found, even though it was requested
> to be installed by web-test.

What means "install fails"?  And why can't web be found since it
supposedly was installed already?

> Right, it does look like there's a bug.

Obviously what you describe points to a bug, yes.


        Stefan



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

* Re: package.el can't install a circular depend and it should be able to.
  2013-01-12  2:43   ` Stefan Monnier
  2013-01-12 14:14     ` Nic Ferrier
@ 2013-01-14 21:47     ` Tom Tromey
  2013-01-15  0:00       ` Xue Fuqiao
                         ` (2 more replies)
  1 sibling, 3 replies; 13+ messages in thread
From: Tom Tromey @ 2013-01-14 21:47 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Nic Ferrier, emacs-devel

>>>>> "Stefan" == Stefan Monnier <monnier@iro.umontreal.ca> writes:

Tom> It was intended to do a topological sort of the graph and activate
Tom> packages from the bottom up.  If this isn't working then there is a bug.

Stefan> Do we actually need such a topological sort?  I mean the only
Stefan> place where ordering might matter is when loading the autoloads
Stefan> file, AFAICT (for all other steps like download, unpack, compile
Stefan> the order in which packages are processed doesn't matter).

I thought byte-compiling one package could require that package's
dependencies, say via eval-when-compile.

For downloading and unpacking, I agree, order doesn't matter.

Tom



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

* Re: package.el can't install a circular depend and it should be able to.
  2013-01-14 21:47     ` Tom Tromey
@ 2013-01-15  0:00       ` Xue Fuqiao
  2013-01-15  1:24       ` Stephen J. Turnbull
  2013-01-15  2:14       ` Stefan Monnier
  2 siblings, 0 replies; 13+ messages in thread
From: Xue Fuqiao @ 2013-01-15  0:00 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Stefan Monnier, Nic Ferrier, emacs-devel

On Mon, 14 Jan 2013 14:47:08 -0700
Tom Tromey <tromey@redhat.com> wrote:

> I thought byte-compiling one package could require that package's
> dependencies, say via eval-when-compile.

I think so, too.
-- 
Best regards, Xue Fuqiao.
http://www.emacswiki.org/emacs/XueFuqiao



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

* Re: package.el can't install a circular depend and it should be able to.
  2013-01-14 21:47     ` Tom Tromey
  2013-01-15  0:00       ` Xue Fuqiao
@ 2013-01-15  1:24       ` Stephen J. Turnbull
  2013-01-15  2:14       ` Stefan Monnier
  2 siblings, 0 replies; 13+ messages in thread
From: Stephen J. Turnbull @ 2013-01-15  1:24 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Stefan Monnier, Nic Ferrier, emacs-devel

Tom Tromey writes:
 > >>>>> "Stefan" == Stefan Monnier <monnier@iro.umontreal.ca> writes:
 > 
 > Tom> It was intended to do a topological sort of the graph and activate
 > Tom> packages from the bottom up.  If this isn't working then there is a bug.
 > 
 > Stefan> Do we actually need such a topological sort?  I mean the only
 > Stefan> place where ordering might matter is when loading the autoloads
 > Stefan> file, AFAICT (for all other steps like download, unpack, compile
 > Stefan> the order in which packages are processed doesn't matter).
 > 
 > I thought byte-compiling one package could require that package's
 > dependencies, say via eval-when-compile.

Yes.  But this only matters for macros (and defsubsts).  So if you
have downloaded those dependencies and installed their (uncompiled)
Lisp where the installing Emacs can find them, you're gold.  What you
need is a list of dependencies, and to install all .els.  It's
possible to optimize a bit (eg, in most cases XEmacs is able to pre-
compile autoloads and such regardless of dependencies, which speeds up
"make World" somewhat).

15-years-of-XEmacs-experience-says-so-ly y'rs,

Steve



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

* Re: package.el can't install a circular depend and it should be able to.
  2013-01-14 21:47     ` Tom Tromey
  2013-01-15  0:00       ` Xue Fuqiao
  2013-01-15  1:24       ` Stephen J. Turnbull
@ 2013-01-15  2:14       ` Stefan Monnier
  2 siblings, 0 replies; 13+ messages in thread
From: Stefan Monnier @ 2013-01-15  2:14 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Nic Ferrier, emacs-devel

Tom> It was intended to do a topological sort of the graph and activate
Tom> packages from the bottom up.  If this isn't working then there is a bug.
Stefan> Do we actually need such a topological sort?  I mean the only
Stefan> place where ordering might matter is when loading the autoloads
Stefan> file, AFAICT (for all other steps like download, unpack, compile
Stefan> the order in which packages are processed doesn't matter).
> I thought byte-compiling one package could require that package's
> dependencies, say via eval-when-compile.

Sure, but we can download, unpack, and activate all the packages first,
and only then byte-compile them (at which point, `require' and
eval-when-compile will work just fine, because the other packages are
activated, even if not yet byte-compiled).


        Stefan



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

end of thread, other threads:[~2013-01-15  2:14 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-04  0:24 package.el can't install a circular depend and it should be able to Nic Ferrier
2013-01-04 14:26 ` Tom Tromey
2013-01-04 17:15   ` Stephen J. Turnbull
2013-01-11 23:27     ` Stefan Monnier
2013-01-12  2:43   ` Stefan Monnier
2013-01-12 14:14     ` Nic Ferrier
2013-01-12 15:03       ` Stefan Monnier
2013-01-12 16:27         ` Nic Ferrier
2013-01-13  0:02           ` Stefan Monnier
2013-01-14 21:47     ` Tom Tromey
2013-01-15  0:00       ` Xue Fuqiao
2013-01-15  1:24       ` Stephen J. Turnbull
2013-01-15  2:14       ` 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).