GNU bug report logs -
#15108
24.3.50; Package dependency documentation
Previous Next
Reported by: Tom Willemse <tom <at> ryuslash.org>
Date: Fri, 16 Aug 2013 00:25:02 UTC
Severity: minor
Tags: patch
Found in version 24.3.50
Done: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
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 15108 in the body.
You can then email your comments to 15108 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#15108
; Package
emacs
.
(Fri, 16 Aug 2013 00:25:03 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Tom Willemse <tom <at> ryuslash.org>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Fri, 16 Aug 2013 00:25:04 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
I noticed that the "Packaging Basics" section in the Emacs Lisp manual
suggests that version numbers in `Package-Requires' headers are
optional, however the explanation of `Package-Requires' makes it clear
that the version specifier is necessary and testing confirms this.
The values `foo', `(foo)' and `((foo))' all cause an error to be
signaled by `package-buffer-info'. This seems to me that there is no
"possibly" about it.
It's only a tiny change and I hope it's OK. I have tried to follow the
guidelines found in the Emacs manual about sending patches, I didn't
find any reference about diffs of multiple files, so I hope it's OK to
send the diffs separately.
[ChangeLog.diff (text/x-diff, attachment)]
[package.diff (text/x-diff, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#15108
; Package
emacs
.
(Fri, 16 Aug 2013 03:47:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 15108 <at> debbugs.gnu.org (full text, mbox):
> The values `foo', `(foo)' and `((foo))' all cause an error to be
> signaled by `package-buffer-info'. This seems to me that there is no
> "possibly" about it.
Indeed a lot of the code assumes that there's a version number in there,
but some of the code does try to handle a nil value as well.
I think it would be desirable to make it possible to leave the version
number unspecified.
Stefan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#15108
; Package
emacs
.
(Fri, 16 Aug 2013 06:59:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 15108 <at> debbugs.gnu.org (full text, mbox):
> > The values `foo', `(foo)' and `((foo))' all cause an error to be
> > signaled by `package-buffer-info'. This seems to me that there is no
> > "possibly" about it.
>
> Indeed a lot of the code assumes that there's a version number in there,
> but some of the code does try to handle a nil value as well.
> I think it would be desirable to make it possible to leave the version
> number unspecified.
+1; a BIG +1.
You can use `Package Requires ((foo "0"))' as a workaround, but it's
silly that you have to do that. If a library is not versioned, or if
for some reason any version of it will do for the package that requires
it, it should be possible to use just `Package Requires ((foo))'.
Furthermore, if no library is required, it should be possible to omit
a `Package-Requires' altogether - that should be equivalent to
`Package-Requires ()'.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#15108
; Package
emacs
.
(Fri, 16 Aug 2013 07:37:01 GMT)
Full text and
rfc822 format available.
Message #14 received at 15108 <at> debbugs.gnu.org (full text, mbox):
Drew Adams <drew.adams <at> oracle.com> writes:
>> > The values `foo', `(foo)' and `((foo))' all cause an error to be
>> > signaled by `package-buffer-info'. This seems to me that there is no
>> > "possibly" about it.
>>
>> Indeed a lot of the code assumes that there's a version number in there,
>> but some of the code does try to handle a nil value as well.
>> I think it would be desirable to make it possible to leave the version
>> number unspecified.
>
> +1; a BIG +1.
I could look into that if you guys like. Any pointers on where to look
apart from `package-buffer-info'?
> You can use `Package Requires ((foo "0"))' as a workaround, but it's
> silly that you have to do that. If a library is not versioned, or if
> for some reason any version of it will do for the package that requires
> it, it should be possible to use just `Package Requires ((foo))'.
Would values of either `foo' for just a single package dependency, `(foo
bar)' for packages without version dependencies and `(foo (baz "1.1.0")
bar)' for mixed values be OK? That would be my preference, but perhaps
this is to complex.
> Furthermore, if no library is required, it should be possible to omit
> a `Package-Requires' altogether - that should be equivalent to
> `Package-Requires ()'.
This is already possible isn't it? Most of my packages don't require
anything and as such don't have a `Package-Requires' header.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#15108
; Package
emacs
.
(Fri, 16 Aug 2013 07:47:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 15108 <at> debbugs.gnu.org (full text, mbox):
> > You can use `Package Requires ((foo "0"))' as a workaround, but it's
> > silly that you have to do that. If a library is not versioned, or if
> > for some reason any version of it will do for the package that requires
> > it, it should be possible to use just `Package Requires ((foo))'.
>
> Would values of either `foo' for just a single package dependency, `(foo
> bar)' for packages without version dependencies and `(foo (baz "1.1.0")
> bar)' for mixed values be OK? That would be my preference, but perhaps
> this is to complex.
Are you asking to be able to use (foo (baz "1.1.0") bar) as an
alternative to ((foo) (baz "1.1.0") (bar))?
IOW, `foo' instead of `(foo)' or (foo "0")? Sounds OK to me. Maybe
someone else knows a reason why that would not work or be a good idea.
> > Furthermore, if no library is required, it should be possible to omit
> > a `Package-Requires' altogether - that should be equivalent to
> > `Package-Requires ()'.
>
> This is already possible isn't it? Most of my packages don't require
> anything and as such don't have a `Package-Requires' header.
Dunno. I ended up adding `Package-Requires' everywhere, because
it wasn't clear to me that its absence means `Package-Requires ()', in
practice.
That said, an explicit `Package-Requires ()' makes it clear that there
is no dependency, whereas if it is absent that could just mean that
no one looked at the question.
Nevertheless, optional is better, IMO. Leave it up to the programmer
to decide whether to be crystal clear by adding an explicit empty spec.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#15108
; Package
emacs
.
(Fri, 16 Aug 2013 08:07:02 GMT)
Full text and
rfc822 format available.
Message #20 received at 15108 <at> debbugs.gnu.org (full text, mbox):
Drew Adams <drew.adams <at> oracle.com> writes:
>> > You can use `Package Requires ((foo "0"))' as a workaround, but it's
>> > silly that you have to do that. If a library is not versioned, or if
>> > for some reason any version of it will do for the package that requires
>> > it, it should be possible to use just `Package Requires ((foo))'.
>>
>> Would values of either `foo' for just a single package dependency, `(foo
>> bar)' for packages without version dependencies and `(foo (baz "1.1.0")
>> bar)' for mixed values be OK? That would be my preference, but perhaps
>> this is to complex.
>
> Are you asking to be able to use (foo (baz "1.1.0") bar) as an
> alternative to ((foo) (baz "1.1.0") (bar))?
>
> IOW, `foo' instead of `(foo)' or (foo "0")? Sounds OK to me. Maybe
> someone else knows a reason why that would not work or be a good idea.
It's not that I desperately want to use that, it just seems cleaner to
me to be able to omit parentheses when they're not needed. But if
someone else knows a reason not to do it, or if everyone else just
thinks it's messy or complicated, that would be reasons not to look into
that direction. I'm asking for opinions on the idea that I had.
And yes, you seem to understand my meaning correctly. In case anyone
else didn't understand I'll try to illustrate:
;; Package-Requires: foo
Would just be a dependency on any version of `foo',
;; Package-Requires: (foo bar)
Would be a dependency on any version of both `foo' and `bar',
;; Package-Requires: (foo (baz "1.1.0") bar)
Would be a dependency on any version of both `foo' and `bar' and version
1.1.0 of `baz'.
A single package with a version could also be an option, like so:
;; Package-Requires: (baz "1.1.0")
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#15108
; Package
emacs
.
(Fri, 16 Aug 2013 20:59:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 15108 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
What would you think of the attached patch? It works for all the
examples I sent earlier. Any comments, criticisms and considerations
would be greatly appreciated.
[changelog.diff (text/x-diff, attachment)]
[package.diff (text/x-diff, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#15108
; Package
emacs
.
(Wed, 11 Dec 2013 20:31:02 GMT)
Full text and
rfc822 format available.
Message #26 received at 15108 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hey,
I've been meaning to send this for a couple of weeks, but I was unable
to. I apologize.
A while ago the patch I sent last time broke, I fixed it and now here
I'm sending it again, hoping there is still some interest in this or
need for it. I've removed the changes to the ChangeLog (or at least, I'm
not sending them again), since I've lost confidence in it being my place
to do so.
I've tested it most recently bzr trunk revision 115470. All the ways to
specify dependencies work as described before:
;; Package-Requires: foo
;; Package-Requires: (foo bar)
;; Package-Requires: (foo (baz "1.1.0") bar)
;; Package-Requires: (baz "1.1.0")
These would all be valid after this patch.
As before, any comments, criticisms and considerations would be greatly
appreciated.
[pkgdep.patch (text/x-diff, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#15108
; Package
emacs
.
(Wed, 11 Dec 2013 20:53:02 GMT)
Full text and
rfc822 format available.
Message #29 received at 15108 <at> debbugs.gnu.org (full text, mbox):
> I've tested it most recently bzr trunk revision 115470. All the ways to
> specify dependencies work as described before:
>
> ;; Package-Requires: foo
> ;; Package-Requires: (foo bar)
> ;; Package-Requires: (foo (baz "1.1.0") bar)
> ;; Package-Requires: (baz "1.1.0")
Those are not all of the ways. Most of my libraries use this way:
;; Package-Requires: ()
And most of the others (of mine) use this way (perhaps covered by
your 3rd, perhaps not, depending on your spec):
;; Package-Requires: ((fit-frame "0"))
See also bug #14941 (still unanswered, so far).
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#15108
; Package
emacs
.
(Wed, 11 Dec 2013 21:25:02 GMT)
Full text and
rfc822 format available.
Message #32 received at 15108 <at> debbugs.gnu.org (full text, mbox):
Hey Drew,
Drew Adams <drew.adams <at> oracle.com> writes:
>> I've tested it most recently bzr trunk revision 115470. All the ways to
>> specify dependencies work as described before:
>>
>> ;; Package-Requires: foo
>> ;; Package-Requires: (foo bar)
>> ;; Package-Requires: (foo (baz "1.1.0") bar)
>> ;; Package-Requires: (baz "1.1.0")
>
> Those are not all of the ways. Most of my libraries use this way:
Sorry, bad choice of words, never meant to say all the ways work, I
meant all the ways given in a previous mail.
> ;; Package-Requires: ()
This will cause a dependency on `((nil (0)))' right now, I will fix
that. May I ask why you wouldn't just leave the header out of the file
or leave it empty? Just out of curiosity, this should work the same way
as Emacs 24.3 I'm sure.
> And most of the others (of mine) use this way (perhaps covered by
> your 3rd, perhaps not, depending on your spec):
>
> ;; Package-Requires: ((fit-frame "0"))
This produces a dependency on `((fit-frame (0)))' with my patch
installed, according to `package-buffer-info'.
> See also bug #14941 (still unanswered, so far).
I will look at it, if you don't mind.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#15108
; Package
emacs
.
(Wed, 11 Dec 2013 21:58:01 GMT)
Full text and
rfc822 format available.
Message #35 received at 15108 <at> debbugs.gnu.org (full text, mbox):
> > ;; Package-Requires: ()
>
> This will cause a dependency on `((nil (0)))' right now, I will fix
> that. May I ask why you wouldn't just leave the header out of the file
> or leave it empty? Just out of curiosity, this should work the same way
> as Emacs 24.3 I'm sure.
From correspondence with people at MELPA, `Package-Requires' seems to be
required. And being present with an empty list tells human readers that
the package has no dependencies. (If absent, you don't get that explicit
info, and you might be wrong in assuming it.)
> > And most of the others (of mine) use this way (perhaps covered by
> > your 3rd, perhaps not, depending on your spec):
> >
> > ;; Package-Requires: ((fit-frame "0"))
>
> This produces a dependency on `((fit-frame (0)))' with my patch
> installed, according to `package-buffer-info'.
It should mean that the library in which it is found requires library
`fit-frame', and any version of `fit-frame' is sufficient. (Any real
version # is >= 0.)
Dunno what that syntax with 0 instead of "0" is. Is is supported?
Does it mean something different from ((fit-frame "0"))?
> > See also bug #14941 (still unanswered, so far).
>
> I will look at it, if you don't mind.
Thx.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#15108
; Package
emacs
.
(Wed, 11 Dec 2013 22:53:02 GMT)
Full text and
rfc822 format available.
Message #38 received at 15108 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hey,
Another update of my patch. Fixes two cases the last one missed or
messed up:
;; Package-Requires: ()
;; Package-Requires: ((foo))
The first is the same as not specifying any `Package-Requires' or
leaving it empty. The second is the equivalent of any one of:
;; Package-Requires: foo
;; Package-Requires: (foo)
;; Package-Requires: ((foo "0"))
Any other situations I might have to take into consideration?
[pkgdep.patch (text/x-diff, attachment)]
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#15108
; Package
emacs
.
(Thu, 12 Dec 2013 18:31:01 GMT)
Full text and
rfc822 format available.
Message #41 received at 15108 <at> debbugs.gnu.org (full text, mbox):
> I've tested it most recently bzr trunk revision 115470. All the ways to
> specify dependencies work as described before:
Looks good, just one nitpick:
> ;; Package-Requires: foo
> ;; Package-Requires: (foo bar)
> ;; Package-Requires: (foo (baz "1.1.0") bar)
> ;; Package-Requires: (baz "1.1.0")
Please don't support the first form nor the last form, since it
otherwise gives the impression that
;; Package-Requires: foo bar baz
or
;; Package-Requires: (foo "0.1") (bar "2.0")
will also work and we don't want to go that way.
Stefan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#15108
; Package
emacs
.
(Thu, 12 Dec 2013 19:25:01 GMT)
Full text and
rfc822 format available.
Message #44 received at 15108 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Stefan Monnier <monnier <at> IRO.UMontreal.CA> writes:
>> I've tested it most recently bzr trunk revision 115470. All the ways to
>> specify dependencies work as described before:
>
> Looks good, just one nitpick:
>
>> ;; Package-Requires: foo
>> ;; Package-Requires: (foo bar)
>> ;; Package-Requires: (foo (baz "1.1.0") bar)
>> ;; Package-Requires: (baz "1.1.0")
>
> Please don't support the first form nor the last form, since it
> otherwise gives the impression that
>
> ;; Package-Requires: foo bar baz
> or
> ;; Package-Requires: (foo "0.1") (bar "2.0")
>
> will also work and we don't want to go that way.
Taken care of in attached patch. I was unsure of how to deal with these
situations, so I explicitly signal a (hopefully) clear error. Just
letting it crash on trying to get the cdr of a symbol seemed messy.
Please let me know what you think.
[pkgdep.patch (text/x-diff, attachment)]
Reply sent
to
Stefan Monnier <monnier <at> IRO.UMontreal.CA>
:
You have taken responsibility.
(Sun, 15 Dec 2013 01:09:01 GMT)
Full text and
rfc822 format available.
Notification sent
to
Tom Willemse <tom <at> ryuslash.org>
:
bug acknowledged by developer.
(Sun, 15 Dec 2013 01:09:03 GMT)
Full text and
rfc822 format available.
Message #49 received at 15108-done <at> debbugs.gnu.org (full text, mbox):
> Taken care of in attached patch. I was unsure of how to deal with these
> situations, so I explicitly signal a (hopefully) clear error. Just
> letting it crash on trying to get the cdr of a symbol seemed messy.
> Please let me know what you think.
Thanks, installed in trunk with a few changes,
Stefan
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sun, 12 Jan 2014 12:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 11 years and 160 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.