[plt-scheme] backwards compatibility and planet libraries

From: Jacob Matthews (jacobm at cs.uchicago.edu)
Date: Wed Mar 9 14:46:03 EST 2005

Dave Herman wrote:

>> No. If you require functionality that wasn't added until, say, 
>> version 1.6, you can specifically require that you get library 
>> version 1.6 or above:
>>
>> (require (planet "file.ss" ("somebody" "somebodys-library.plt" 1 6)))
>
>
> Does that really have the behavior of requiring 1.6 *or above*, or 
> exactly version 1.6? In other words, if at some point later on, 
> version 1.7 becomes available, will the module written as above still 
> use 1.6?

Depends. The search order is:

1) if the module doing the requiring already has associated linkage, use 
that unconditionally.
2) if some appropriate version of the specified package has already been 
installed in the local cache, use the latest appropriate version.
3) otherwise, ask the server, which will return the package with the 
latest appropriate version.

So if at some point later on 1.7 becomes available, clients who already 
have local copies of 1.6 will get that; clients that don't have 1.6 
already will get 1.7 instead.

>> Even if you've got versions 1.0 through 1.5 installed locally, planet 
>> will fetch version 1.6 to satisfy this request (though if you ask for 
>> version 1.3 or above and it has version 1.6 it'll give you the local 
>> version 1.6, of course).
>
>
> Is this only the first time the module gets invoked? I thought the 
> behavior of planet was that once it associates a client module with a 
> particular minor version of the library, it's stuck with that version 
> once and for all (see the section "Previous linkage" under "The PLaneT 
> search order" in the planet docs).

Well, unless the linkage table gets cleared (planet -U). There should be 
a way to remove any linkage that points TO a particular package (ie, 
anyone who uses this package can upgrade to the latest available on the 
system), but I haven't implemented that yet.

> I've been concurrently developing a number of planet libraries that 
> require each other, and rather than constantly having to update all 
> the clients of one library every time I post a bug fix, I've been 
> leaving out the minor version in the `require's. But I still end up 
> having to clear the linkage table and rerun setup-plt every time I 
> update a library to a newer minor version. I confess I don't really 
> understand the "magic upgrade" comment in the docs.

Clear the linkage table and you should be okay. Why do you need to rerun 
setup-plt?

A "magic upgrade" is when you install package A and suddenly package B 
starts behaving differently. In the absence of a linkage table, this 
could happen if B requires package version 1.0 or above and A requires 
package version 1.1. If you install B when only package version 1.0 is 
available, you get C version 1.0. Then a new version of C comes out, and 
then you install A (which must install the new version of C because 1.0 
isn't a high enough version for A). Now you've got C versions 1.0 and 
1.1 on your system; when you run B again you'd get C version 1.1 with 
the effect that B seems to behave differently now than it did before. 
When I initially started talking about PLaneT it was a major concern of 
several people who are familiar with current packaging systems that 
these magic upgrades not happen; thus the linkage table.

-jacob



Posted on the users mailing list.