Constructing a patched Monticello package without installing it

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Constructing a patched Monticello package without installing it

Eliot Miranda-2
Hi All,

    I'm trying to deploy Spur in our Newspeak bootstrap at Cadence.  The starting point for the Newspeak bootstrap) is a Squeak4.3 image.

I have a Squeak4.3 image transformed by the Spur bootstrap to Spur format, which means it has a few method modifications to three packages:

Collections (changed Character methods now that Characters are immediate)
Kernel (changed Behavior & ClassBuilder changes now that a class's format has changed, and instantiation interacts with the garbage collector differently)
System (changed SystemDictionary/SmalltalkImage methods now that there's a generation scavenger)

The Newspeak bootstrap loads versions of these packages that support Newspeak.  So the problem is to load the Newspeak versions of these packages without undoing the Spur bootstrap modifications.  As a quick hack I could patch the Monticello loader to avoid the modifications (they're marked by not having a source pointer but could be marked in some other way, e.g. a pragma).  That's a fine simple approach. But...

I just stumbled across Monticello's MCPatcher and the Backport button which claims to apply a partial delta to the ancestor of a package.  Does anyone who understands this code know if the code supports loading a package, without installing it, applying a partial set of changes (i.e. the relevant changes form the bootstrap) and saving the package as an mcz?  If it does then I could construct patched versions of the three packages and substitute them in the bootstrap instead of using the hack.
--
best,
Eliot


Reply | Threaded
Open this post in threaded view
|

Re: Constructing a patched Monticello package without installing it

Colin Putney-3



On Wed, Jan 15, 2014 at 1:41 PM, Eliot Miranda <[hidden email]> wrote:
 
I just stumbled across Monticello's MCPatcher and the Backport button which claims to apply a partial delta to the ancestor of a package.  Does anyone who understands this code know if the code supports loading a package, without installing it, applying a partial set of changes (i.e. the relevant changes form the bootstrap) and saving the package as an mcz?  If it does then I could construct patched versions of the three packages and substitute them in the bootstrap instead of using the hack.

 Yeah, that ought to work fine. There's no way to do it through the GUI, but a bit of workspace hackery should do the trick.



Reply | Threaded
Open this post in threaded view
|

Re: Constructing a patched Monticello package without installing it

Eliot Miranda-2
Thanks Colin!

On Wed, Jan 15, 2014 at 12:06 PM, Colin Putney <[hidden email]> wrote:



On Wed, Jan 15, 2014 at 1:41 PM, Eliot Miranda <[hidden email]> wrote:
 
I just stumbled across Monticello's MCPatcher and the Backport button which claims to apply a partial delta to the ancestor of a package.  Does anyone who understands this code know if the code supports loading a package, without installing it, applying a partial set of changes (i.e. the relevant changes form the bootstrap) and saving the package as an mcz?  If it does then I could construct patched versions of the three packages and substitute them in the bootstrap instead of using the hack.

 Yeah, that ought to work fine. There's no way to do it through the GUI, but a bit of workspace hackery should do the trick.

Here's a working example that patches a single method:

| fn fs version method patch ancestry newVersion |
fn := '/Users/eliot/Glue/repositories/spurnsboot/smalltalk/Kernel.newspeak-bwesterg.682.mcz'.
fs := FileStream readOnlyFileNamed: fn.
version := [((MCVersionReader readerClassForFileNamed: fn) on: fs fileName: fn) version] ensure: [fs close].
method := SpurBootstrap class >> #ProtoObjectPROTOTYPEscaledIdentityHash.
patch := MCPatch operations: {MCAddition of: (MCMethodDefinition
className: #ProtoObject
classIsMeta: false
selector: #scaledIdentityHash
category: #comparing
timeStamp: method timeStamp
source: (method getSourceFromFile asString allButFirst: 20))}.
ancestry := MCWorkingAncestry new addAncestor: version info.
newVersion := MCVersion
package: version package
info: (ancestry
infoWithName: 'Kernel.newspeak.spur-bwesterg.682.mcz'
message: 'Kernel.newspeak-bwesterg.682.mcz patched for Spur')
snapshot: (MCPatcher apply: patch to: version snapshot)
dependencies: {}.
(MCDirectoryRepository new directory: fs directory) storeVersion: newVersion 

--
best,
Eliot