[Glass] recompiling a package

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

[Glass] recompiling a package

GLASS mailing list
Hi -


I've loaded a Monticello package into GemStone 3.1.0.6 using tODE and the class hierarchy is broken.  Some subclasses of some classes don't know that they're subclasses and so method lookup is broken for those subclasses.  If I put a space in the #instVarNames: portion of the class definition and save it the class hierarchy is restored.  


Is there a way to do that for all classes in the package from a script?


thanks

Paul
_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: [Glass] recompiling a package

GLASS mailing list
Hi Paul, 

Just to track down the problem...let me ask you..when you loaded the code via MC, did it warn about one of the classes of that hierarchy saying there could be a problem but that it might work in a second pass or something?
Because it happened the same to me a couple of times..subclasses got kind broken and like if the superclass were duplicated.. and I had to do exactly the same as you...I forced the recompilation in the subclass. I am not sure if it was this..but I remember some syntax error somewhere (maybe an empty statement or something).

So what your scenario similar?



On Wed, Feb 18, 2015 at 3:15 PM, Paul DeBruicker via Glass <[hidden email]> wrote:
Hi -


I've loaded a Monticello package into GemStone 3.1.0.6 using tODE and the class hierarchy is broken.  Some subclasses of some classes don't know that they're subclasses and so method lookup is broken for those subclasses.  If I put a space in the #instVarNames: portion of the class definition and save it the class hierarchy is restored.


Is there a way to do that for all classes in the package from a script?


thanks

Paul
_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass



--

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: [Glass] recompiling a package

GLASS mailing list
In reply to this post by GLASS mailing list
Paul,

Here's a tODE shell script (`touch sh repairClasses`) that takes a list
of classes and should do the moral equivalent of "add a space to iv list":

[ :topez :objIn :tokens :command :commandNode |
   | opts args |
   "for help: ./repairClasses -h"
   command
     getOptsMixedLongShort:
       {#('help' $h #'none').
       #('classes' nil #'required')}
     optionsAndArguments: [ :options :operands |
       opts := options.
       args := operands ].
   opts
     at: 'help'
     ifAbsent: [
       opts
         at: 'classes'
         ifPresent: [ :classNameList |
           | classes |
           classes := Set new.
           (classNameList findTokens: '')
             do: [ :className | (Smalltalk at: className) ifNotNil: [
:cl | classes add: cl ] ].
           GsDeployer
             deploy: [ classes do: [ :cls | cls asClassDefinition
createClass ] ] ] ]
     ifPresent: [ :ignored |
       TDManPage
         viewManPage:
           'NAME
   repairClasses - repairClasses sript utility template
SYNOPSIS
   repairClasses [-h|--help]
                 --classes=`<class-name-list>`
DESCRIPTION
EXAMPLES
   ./repairClasses -h
   ./repairClasses --classes=`TDClassDefinitionClient TDMcClassDefinition`
'
         topez: topez ] ]

Just run the following with your list of class names:

   ./repairClasses --classes=`TDClassDefinitionClient TDMcClassDefinition`

This happened because GLASS/GsDevKit didn't create the classes correctly
in the first place ... presumably there were some errors during the
load? I'd like to find out if possible.

Dale

On 2/18/15 10:15 AM, Paul DeBruicker via Glass wrote:

> Hi -
>
>
> I've loaded a Monticello package into GemStone 3.1.0.6 using tODE and the class hierarchy is broken.  Some subclasses of some classes don't know that they're subclasses and so method lookup is broken for those subclasses.  If I put a space in the #instVarNames: portion of the class definition and save it the class hierarchy is restored.
>
>
> Is there a way to do that for all classes in the package from a script?
>
>
> thanks
>
> Paul
> _______________________________________________
> Glass mailing list
> [hidden email]
> http://lists.gemtalksystems.com/mailman/listinfo/glass

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: [Glass] recompiling a package

GLASS mailing list
In reply to this post by GLASS mailing list
Hi Richard,


Of course it would be better to track down the error and correct it rather than adding a step to the loading process.   At the moment I have other errors I'd rather track down and fix. Also it may be that in the 5-6 months since I last updated my copy of tODE/GLASS etc Dale has fixed the problem.  Who knows.  Maybe I'll get to it later and see for myself.  

Do you know if there is a way to recompile a package from a script?

Thanks


Paul




On Feb 18, 2015, at 11:03 AM, Richard Sargent <[hidden email]> wrote:

> On Wed, Feb 18, 2015 at 10:15 AM, Paul DeBruicker via Glass <[hidden email]> wrote:
> Hi -
>
>
> I've loaded a Monticello package into GemStone 3.1.0.6 using tODE and the class hierarchy is broken.  Some subclasses of some classes don't know that they're subclasses and so method lookup is broken for those subclasses.  If I put a space in the #instVarNames: portion of the class definition and save it the class hierarchy is restored.
>
>
> Is there a way to do that for all classes in the package from a script?
>
> Wouldn't it be better to track down the actual error and correct it?
>
>
>
> thanks
>
> Paul
> _______________________________________________
> Glass mailing list
> [hidden email]
> http://lists.gemtalksystems.com/mailman/listinfo/glass
>

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: [Glass] recompiling a package

GLASS mailing list
In reply to this post by GLASS mailing list
Hi Mariano,

Yeah sounds like the same/a similar problem.  I loaded a class that in Pharo 3 had a method with a reference to an inst var that I had removed from the class definition.  After proceeding through the warning the class was loaded and the class hierarchy was broken.  Removing the offensive method in Pharo 3 and reloading the package did not fix the broken hierarchy.  Recompiling the subclasses does fix it.  


Paul



On Feb 18, 2015, at 11:14 AM, Mariano Martinez Peck <[hidden email]> wrote:

> Hi Paul,
>
> Just to track down the problem...let me ask you..when you loaded the code via MC, did it warn about one of the classes of that hierarchy saying there could be a problem but that it might work in a second pass or something?
> Because it happened the same to me a couple of times..subclasses got kind broken and like if the superclass were duplicated.. and I had to do exactly the same as you...I forced the recompilation in the subclass. I am not sure if it was this..but I remember some syntax error somewhere (maybe an empty statement or something).
>
> So what your scenario similar?
>
>
>
> On Wed, Feb 18, 2015 at 3:15 PM, Paul DeBruicker via Glass <[hidden email]> wrote:
> Hi -
>
>
> I've loaded a Monticello package into GemStone 3.1.0.6 using tODE and the class hierarchy is broken.  Some subclasses of some classes don't know that they're subclasses and so method lookup is broken for those subclasses.  If I put a space in the #instVarNames: portion of the class definition and save it the class hierarchy is restored.
>
>
> Is there a way to do that for all classes in the package from a script?
>
>
> thanks
>
> Paul
> _______________________________________________
> Glass mailing list
> [hidden email]
> http://lists.gemtalksystems.com/mailman/listinfo/glass
>
>
>
> --
> Mariano
> http://marianopeck.wordpress.com

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass
Reply | Threaded
Open this post in threaded view
|

Re: [Glass] recompiling a package

GLASS mailing list
In reply to this post by GLASS mailing list
Upon further review I assume that you need a way to extract the classes
in a package? I can add that as an argument, along with an option for
getting classes in a project ... I can ship you an update to the script
if you'd like ...

The class list variant should work in an old version of tODE ...
extracting classes from packages and/or projects might cause me to use
some pretty recent code ...

Let me know, if you need further script help ... I can probably write
something at a pretty low level if needed ...

Dale

On 2/18/15 11:20 AM, Dale Henrichs wrote:

> Paul,
>
> Here's a tODE shell script (`touch sh repairClasses`) that takes a
> list of classes and should do the moral equivalent of "add a space to
> iv list":
>
> [ :topez :objIn :tokens :command :commandNode |
>   | opts args |
>   "for help: ./repairClasses -h"
>   command
>     getOptsMixedLongShort:
>       {#('help' $h #'none').
>       #('classes' nil #'required')}
>     optionsAndArguments: [ :options :operands |
>       opts := options.
>       args := operands ].
>   opts
>     at: 'help'
>     ifAbsent: [
>       opts
>         at: 'classes'
>         ifPresent: [ :classNameList |
>           | classes |
>           classes := Set new.
>           (classNameList findTokens: '')
>             do: [ :className | (Smalltalk at: className) ifNotNil: [
> :cl | classes add: cl ] ].
>           GsDeployer
>             deploy: [ classes do: [ :cls | cls asClassDefinition
> createClass ] ] ] ]
>     ifPresent: [ :ignored |
>       TDManPage
>         viewManPage:
>           'NAME
>   repairClasses - repairClasses sript utility template
> SYNOPSIS
>   repairClasses [-h|--help]
>                 --classes=`<class-name-list>`
> DESCRIPTION
> EXAMPLES
>   ./repairClasses -h
>   ./repairClasses --classes=`TDClassDefinitionClient TDMcClassDefinition`
> '
>         topez: topez ] ]
>
> Just run the following with your list of class names:
>
>   ./repairClasses --classes=`TDClassDefinitionClient TDMcClassDefinition`
>
> This happened because GLASS/GsDevKit didn't create the classes
> correctly in the first place ... presumably there were some errors
> during the load? I'd like to find out if possible.
>
> Dale
>
> On 2/18/15 10:15 AM, Paul DeBruicker via Glass wrote:
>> Hi -
>>
>>
>> I've loaded a Monticello package into GemStone 3.1.0.6 using tODE and
>> the class hierarchy is broken.  Some subclasses of some classes don't
>> know that they're subclasses and so method lookup is broken for those
>> subclasses.  If I put a space in the #instVarNames: portion of the
>> class definition and save it the class hierarchy is restored.
>>
>>
>> Is there a way to do that for all classes in the package from a script?
>>
>>
>> thanks
>>
>> Paul
>> _______________________________________________
>> Glass mailing list
>> [hidden email]
>> http://lists.gemtalksystems.com/mailman/listinfo/glass
>

_______________________________________________
Glass mailing list
[hidden email]
http://lists.gemtalksystems.com/mailman/listinfo/glass