[racket] Should `raco pkg update <x>` presume --update-deps?

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Mon Nov 11 10:07:19 EST 2013

On Mon, Nov 11, 2013 at 7:44 AM, Greg Hendershott
<greghendershott at gmail.com> wrote:
> In response to my "I can't think of a situation" you raise with your
> own "I can't think of a situation". Well played sir. :)
>
> The updated markdown parser is more likely to handle some corner cases
> than the old one, e.g. being less finicky about requiring a blank line
> after some element.
>
> I had updated Frog to be able to use the new version and give those
> improved results, but still be compatible with the older version.
>
> I guess my thinking was, the newer parser was such a huge redesign, I
> wanted the safety net of someone being able to revert to the older
> version (at least temporarily).
>
> So that's why I bumped the ver on the markdown, but not the ver for
> frog's dep on it.
>
> Probably I over-thunk it. And the new parser seems solid so far. As a
> result, I should just bump frog's own version, and bump the version of
> markdown it requires. And then all will be well.
>
> As for the general question: I think you're saying that with the
> status quo `raco pkg update <x>`, if an installed dep is older than
> required, it will install the very latest version (perhaps newer than
> required), otherwise it will do nothing?  Whereas with --update-deps
> it does the equivalent of an individual `raco pkg update <dep>` on
> every dep transitively, so you'll end up with the very latest of
> everything?

Yes, that's correct. As you mention "update = remove + install", I
hope this result is predictable. Imagine, for a moment that someone
used your old markdown package with my unreleased super-secret Racket
Wiki server. Then, they decided that they wanted your blog engine too.
You wouldn't expect installing "frog" to update the markdown package.
Since "raco pkg update <x>" is literally just removing the package and
adding it again (with a tiny bit of a barrier in case the second
install fails), it works the same way.

I don't have a strong opinion about your suggestion of switching the
default behavior, but I'm not sure your example is the best reason to
switch it.

My attitude is that when you "raco pkg update <x>" you are planning on
getting new behavior in <x> and not "error fixes on <x> and everything
else that it uses" (where "better Markdown parsing" can be seen as a
fixing an error in the old parser). But when you use "--update-deps"
(or "-a") then you are planning on just looking for new versions of
anything. I like the feeling of stability this pattern gives.

One case where I think "--update-deps" should definitely be implied is
when a package "implies" other packages, such as 'main-distribution'
implying 'srfi', because the "implies" is transparent, so the user
doesn't necessarily know which package is really providing the feature
they want updated.

In any case, I think I will probably be able to continuing living if
"--update-deps" were the default, but I want a better example or a few
+1s.

Jay

-- 
Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University
http://faculty.cs.byu.edu/~jay

"The glory of God is Intelligence" - D&C 93

Posted on the users mailing list.