I have cobbled together a little prototype in order to describe what I am talking about. I hope this makes it clearer what I am talking about. It is also interesting that it only two two days of work to get it together. I'm not a fast coder. You simply don't need that much code to get auto-installing, if you build your tool around package universes.
The rest of this post is also available on the swiki:
"Package Universes" http://minnow.cc.gatech.edu:8080/squeak/3785
Package universes are an approach to supporting one-click installs via a package loader. See Why Packages Exist for an argument that package universes exist. This page describes how to leverage package universes in order to get one-click installs.
Trying it Out
To try it out, install universe-0.sar into a fresh Squeak 3.7 image. Then "open...Universe Browser". You'll have to press the "update list" button the first time you load the universe browser, and then after a few seconds you will see a list of packages available in the default "Wild n Woolly" universe.
Try scrolling down to the "BFAV2" package, selecting it, and then pressing the "install package" button. You will notice that the text (install) appears next to the item now -- that means that the package has been flagged for installation. If you scroll down in the list, you will see that HTTPClient has also been flagged for installation; this happened because BFAV2 depends on HTTPClient.
Next click the big "INSTALL" button at the bottom of the window, and the Universe Browser will download BFAV2 and HTTPClient and install them for you.
How to Post and Edit Packages
If you want to post or edit a package, you need to use the Universe Editor. Use the "open" menu to open a universe editor.
You will initially need to create an account. So, type in a username and password, and then press the "create account" button. You will be asked to fill in an email address; leave it blank if you prefer, but this email can be used in case your password is forgotten.
New you can press either "new package" or "new package version", depending on whether you want to add an entirely new package or you'd prefer to simply edit an existing template. A new window will pop up and you can fill in the fields that describe your package. Click "submit" when you are finished.
If you see a package that you think is yours, then go ahead and feel free to update it. If you are the first to try and edit any information about packages with a particular name, then the Wild n Woolly universe will let you do it.
What's a Package Universe?
A package universe is a set of packages plus policy on how the set is allowed to change over time. It is called a universe, because each Squeak image will exist within one such universe, and each user will operate within one such universe at a time. A universe provides answers the question "what exists?"; anything outside a user's current universe is completely ignored.
Why Bother with this Universes Stuff
The short answer is that it seems to work. Universes exist, and it seems to work well to manage them explicitly. Here are some things we can handle, if we and our software explicitly discuss package universes.
Simple Dependencies Work
By limiting the number of packages that are in the universe, simple dependency approaches are sufficient. There is no need to track which individual versions of which packages are compatible with each other, because people working in any given universe will tend to use the newest versions available within that universe.
As a result, dependencies like "A depends on B" are usually fine. If the main author of B has developed B into a form that is incompatible with A, then that package will simply not be posted into the universe. And even if the newest A and newest B are incompatible, the situation can be treated like any other bug: fix A, fix B, or reject one of the two from the universe. Once one is committed to operating within one universe at a time, dependency management can be greatly simplified.
Update Policies
It is well known that some users prefer the newest software and others prefer the most stable. The packaging approaches described so far seem to by planning to make the package-installer software customizable by the individual users in order to select these preferences. There is no specific mechanism, however, that has yet been proposed. It's always been a problem of the future.
The perspective that package universes give is the following: if you want stable packages, then you probably want all of your packages to be stable. Thus, it makes sense to define and maintain a universe of stable packages. Likewise, if you have a few new under-development packages, you probably want to go ahead and try out the new versions of most packages. Thus, it also makes sense to define a wild 'n woolly development universe.
Package universes give an easy way to organize and manage these different update policies. You can just say "this universe works like this" and "that universe works like that".
Expected Content
In addition to different policies, some universes will simply contain stuff that is different. Different universes provide a convenient way to manage different content alltogether. While I might like to put my collection of home videos on the internet and accessible to my family, the rest of the world would prefer not to even be concious of these terribly boring things (or, they'd like to see THEIR home videos). While most of the world might want to have DVD software available publically, such software can likely not be posted to any server that is in the United States.
Package universes provide a natural way to manage these different kinds of expected content. No matter how benevolent and permissive any central Squeak authority is, there is sure to be some content that is not appropriate for the general public but that would make a lot of sense to have available for those that want it.
Mixin Universes
The desire for mixin universes follows from the above desires. Much of the unusual content that people provide is relatively agnostic about Squeak version, and can be combined with other such unusual content in arbitrary combinations. A mixin universe is a set of packages that can be mixed into a large number of other universes without breaking too much. Package universes provide a simple way to think about these mixins: you create larger universes simply by taking the union of the packages in two separate universes.
Theory aside, note that Debian supports mixin repositories, and their http://www.apt-get.org meta-catalog lists hundreds of repositories that are at least mostly intended as mixins.
Shorter Names
By limiting the number of packages that are available in a universe, names can often be shorter than they would otherwise need to be. A universe provides context. In a development universe for Tweak, one doesn't need to name the package "TweakBase", but can instead just say "Base". Everyone will understand that the "Base" package of the "Tweak" universe is the base package of Tweak. On the other hand, it doesn't make sense to post a package named "Base" on SqueakMap. No one will understand what it is the "base" of.
Existing Universes
There are four "well-known" universes in the above package. Only one of them is really useful, but the others are interesting food for thought. Browse to UUniverse's class methods, and you will see the code to switch universes to one of these others. CAUTION however: mixing packages from different universes is a recipe for confusion, so you will usually want to start in a fresh image before switching universes.
* "Wild n Woolly" -- this is the currently useful one. It has a copy of most of the latest packages on SqueakMap on it. It is intended to be a development arena. Packages are inconsistent at early phases of this universe, but over time they should become more consistent or, if they remain problematic, be kicked out of the universe. The update policy on Wild n Woolly is that anyone may create a new account, package names are owned by users, and packages may only be updated by their users. Ownership is decided by: the first person to try to use a package name wins. Aside from those constraints it is free reign. Yee ha! * "Stable" -- This is a model for what a frozen universe could be like . No one is allowed to make updates to this universe except for one person or a small number of people. These people will only let through updates that are clear bug fixes. * "Home Movies" -- This is a universe that holds reams of home videos for a rather unusual family. Only the family may post to it, though they do post it on the net for anyone who wants to read from it. * "Example Compound Server" -- this universe is a union of "Wild n Woolly" and "Home Movies". "Home Movies" is pretty useless by itself, so is usually used in tandem with some other universe.
Future Directions
As of July 2004, Universes is merely a prototype to show how to build tools based on package universes. In particular, I'm afraid the UI is so ugly it will actually harm those who look upon it. Thus, I am happy whether it is used itself, or whether the ideas get incorporated into some other tool. I'm most happy of all if, in either case, someone else does the future maintenance. :)
Note, though, that "package universes" software is orthoganal to a Catalog of Everything tool. A catalog of everything has an index for every package that anyone cared to post, while a package universe holds some consistent subset of those packages. Since these are distinct purposes, it may make sense for the two tools to be separate.
Lex Spoon
squeak-dev@lists.squeakfoundation.org