Hi All, Hi Bert, Hi Colin,

    today I was working with Ron Teitelbaum on porting the Terf client to Squeak 6.x.  The bootstrap builder creates some base MCConfigurations and then updates them from the various repositories, hence downloading the latest versions of certain packages into the package cache.

Some of the downloaded packages are for Tweak, and Tweak classes include field definitions which require special Monticello support to manage.  The special handling is provided by the TweakMC package.  Here are some of the relevant definitions:

MCStWriter>>visitTweakFieldDefinition: definition
self writeTweakFieldDefinition: definition


MCStWriter>>writeTweakFieldDefinition: definition
self chunkContents: [:s | definition printDefinitionOn: stream]

which produces output like the following in the snapshot.st file:

CCostumeGrid defineFields: '<?xml  version="1.0" ?>
<fields>
        <field toGet="origin" toSet="origin:" changeEvent="originChanged">origin</field>
        <field toGet="extent" toSet="extent:" changeEvent="extentChanged">extent</field>
        <field toGet="enabled" toSet="enabled:" changeEvent="enabledChanged">enabled</field>
        <field toGet="visible" toSet="visible:" changeEvent="visibleChanged">visible</field>
        <field toGet="color" toSet="color:" changeEvent="colorChanged">color</field>
</fields>'!

Note that no special support is needed for producing the snapshot.bin because that can save arbitrary objects.

So, (I think) because we were loading packages saved by Squeak V3 into a Squeak Spur image the binary isn't loaded and instead the source is compiled. (Am I right?)  If the update happens *before* TweakMC has been loaded then the packages that get installed into package-cache are missing all the field definitions because the support to produce them is missing.

This was exactly our situation; we're freshly bootstrapping a Terf image, which includes adding support for Tweak, and TweakMC is loaded by the bootstrap /after/ the configurations have been updated, and hence the Tweak packages in the package-cache are corrupted.

We fixed our issue by modifying the bootstrap to load TweakMC up front.  But IMO *this shouldn't be necessary*.

Why, when Monticello downloads a package from a repository, does it rewrite that package to install it in the package-cache directory?  Surely it has *no business* rewriting the contents of the package and could simply copy the file itself.  If it does the rewrite, as it is doing now, it opens up the transcription to all sorts of errors, the above being one.  Not only is the approach slow, and error prone, it is unnecessary.  The file could be copied quite simply.

Is this easy to fix?  I think it's a really bad design flaw.

_,,,^..^,,,_
best, Eliot