Monticello postscript problem

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

Monticello postscript problem

Martin Kuball
Hi all,

I have a problem with a postscript in one of my Monticello packages. It fails
to execute because a class used in the script did not had it's initialize
method run, yet. I took a look under the hood and found, that the postscript
and the initializer execs are all mixed together in one list. But the
postscript was not at the end of this list.

So is this a bug or is there for some reason no guarantee that the postscript
is run when everything else is done? I fixed this for me by running twice over
the list. First for the non-scripts and then for the scripts. Not very pretty
but seems to do the job.

Martin




Reply | Threaded
Open this post in threaded view
|

Re: Monticello postscript problem

Martin Kuball
Am Donnerstag, 7. Mai 2020, 21:45:50 CEST schrieb Martin Kuball:

> Hi all,
>
> I have a problem with a postscript in one of my Monticello packages. It
> fails to execute because a class used in the script did not had it's
> initialize method run, yet. I took a look under the hood and found, that
> the postscript and the initializer execs are all mixed together in one
> list. But the postscript was not at the end of this list.
>
> So is this a bug or is there for some reason no guarantee that the
> postscript is run when everything else is done? I fixed this for me by
> running twice over the list. First for the non-scripts and then for the
> scripts. Not very pretty but seems to do the job.
>
> Martin


I guess I should tell you that I'm using version 708 of monticello.



Reply | Threaded
Open this post in threaded view
|

Re: Monticello postscript problem

marcel.taeumel
Hi Martin,

I think that it would be better to first run all initializers and only then the package postscripts. I thought this happens anyway. :-)

Can you point me to the source code you found?

Best,
Marcel

Am 07.05.2020 21:50:28 schrieb Martin Kuball <[hidden email]>:

Am Donnerstag, 7. Mai 2020, 21:45:50 CEST schrieb Martin Kuball:
> Hi all,
>
> I have a problem with a postscript in one of my Monticello packages. It
> fails to execute because a class used in the script did not had it's
> initialize method run, yet. I took a look under the hood and found, that
> the postscript and the initializer execs are all mixed together in one
> list. But the postscript was not at the end of this list.
>
> So is this a bug or is there for some reason no guarantee that the
> postscript is run when everything else is done? I fixed this for me by
> running twice over the list. First for the non-scripts and then for the
> scripts. Not very pretty but seems to do the job.
>
> Martin


I guess I should tell you that I'm using version 708 of monticello.





Reply | Threaded
Open this post in threaded view
|

Re: Monticello postscript problem

Martin Kuball
Hi Marcel,

Am Freitag, 8. Mai 2020, 09:17:41 CEST schrieb Marcel Taeumel:
> Hi Martin,
>
> I think that it would be better to first run all initializers and only then
> the package postscripts. I thought this happens anyway. :-)
>
> Can you point me to the source code you found?

Sure.  Look at MCPackageLoader>>basicLoad. The problem is almost at the end
with this lines:

        additions do: [:ea | ea postloadOver: (self obsoletionFor: ea)]
                displayingProgress: 'Initializing ', pkgName.

The instance variable additions holds MCDefinition objects. Mostly for the
classes but although the postscript. I replaced above lines with:

        (additions select: [:ea | ea isScriptDefinition not]) do:
                [:ea | ea postloadOver: (self obsoletionFor: ea)]
                displayingProgress: 'Initializing classes ', pkgName.

        (additions select: [:ea | ea isScriptDefinition]) do:
                [:ea | ea postloadOver: (self obsoletionFor: ea)]
                displayingProgress: 'executing postscript ', pkgName.

But it would be much nicer to either have an extra variable for the postscript
(assuming there could only be one) or make sure it always stays at the end of
the list.

>
> Best,
> Marcel
> Am 07.05.2020 21:50:28 schrieb Martin Kuball <[hidden email]>:
>
> Am Donnerstag, 7. Mai 2020, 21:45:50 CEST schrieb Martin Kuball:
> > Hi all,
> >
> > I have a problem with a postscript in one of my Monticello packages. It
> > fails to execute because a class used in the script did not had it's
> > initialize method run, yet. I took a look under the hood and found, that
> > the postscript and the initializer execs are all mixed together in one
> > list. But the postscript was not at the end of this list.
> >
> > So is this a bug or is there for some reason no guarantee that the
> > postscript is run when everything else is done? I fixed this for me by
> > running twice over the list. First for the non-scripts and then for the
> > scripts. Not very pretty but seems to do the job.
> >
> > Martin
>
> I guess I should tell you that I'm using version 708 of monticello.





Reply | Threaded
Open this post in threaded view
|

Re: Monticello postscript problem

Christoph Thiede

Hi Martin,


not sure if this is related, but I changed the behavior of the dependency sorter in a recent Monticello version. Could you try out Monticello-ct.717 from the Inbox and tell us whether the problem remains?


Best,

Christoph


Von: Squeak-dev <[hidden email]> im Auftrag von Martin Kuball <[hidden email]>
Gesendet: Freitag, 8. Mai 2020 13:57:18
An: The general-purpose Squeak developers list
Betreff: Re: [squeak-dev] Monticello postscript problem
 
Hi Marcel,

Am Freitag, 8. Mai 2020, 09:17:41 CEST schrieb Marcel Taeumel:
> Hi Martin,
>
> I think that it would be better to first run all initializers and only then
> the package postscripts. I thought this happens anyway. :-)
>
> Can you point me to the source code you found?

Sure.  Look at MCPackageLoader>>basicLoad. The problem is almost at the end
with this lines:

        additions do: [:ea | ea postloadOver: (self obsoletionFor: ea)]
                displayingProgress: 'Initializing ', pkgName.

The instance variable additions holds MCDefinition objects. Mostly for the
classes but although the postscript. I replaced above lines with:

        (additions select: [:ea | ea isScriptDefinition not]) do:
                [:ea | ea postloadOver: (self obsoletionFor: ea)]
                displayingProgress: 'Initializing classes ', pkgName.

        (additions select: [:ea | ea isScriptDefinition]) do:
                [:ea | ea postloadOver: (self obsoletionFor: ea)]
                displayingProgress: 'executing postscript ', pkgName.

But it would be much nicer to either have an extra variable for the postscript
(assuming there could only be one) or make sure it always stays at the end of
the list.

>
> Best,
> Marcel
> Am 07.05.2020 21:50:28 schrieb Martin Kuball <[hidden email]>:
>
> Am Donnerstag, 7. Mai 2020, 21:45:50 CEST schrieb Martin Kuball:
> > Hi all,
> >
> > I have a problem with a postscript in one of my Monticello packages. It
> > fails to execute because a class used in the script did not had it's
> > initialize method run, yet. I took a look under the hood and found, that
> > the postscript and the initializer execs are all mixed together in one
> > list. But the postscript was not at the end of this list.
> >
> > So is this a bug or is there for some reason no guarantee that the
> > postscript is run when everything else is done? I fixed this for me by
> > running twice over the list. First for the non-scripts and then for the
> > scripts. Not very pretty but seems to do the job.
> >
> > Martin
>
> I guess I should tell you that I'm using version 708 of monticello.







Carpe Squeak!
Reply | Threaded
Open this post in threaded view
|

Re: Monticello postscript problem

Martin Kuball
Hi Christoph,

sorry for the late answer. I tried version Monticello-jr.718. And it worked.
So far so good. So I was curious what exactly changed. I opened the history
and asked for the changes from 716 to 717.  But I got an exception instead.
This worked with version 708.

10 May 2020 3:52:06.942302 pm

VM: unix - Smalltalk
Image: Squeak5.3 [latest update: #19438]

SecurityManager state:
Restricted: false
FileAccess: true
SocketAccess: true
Working Dir /home/kuball/SMT/s-5.3/test
Trusted Dir /home/kuball/SMT/s-5.3/test/secure
Untrusted Dir /home/kuball/SMT/s-5.3/test/My Squeak

UndefinedObject(Object)>>doesNotUnderstand: #snapshot
        Receiver: nil
        Arguments and temporary variables:
                aMessage: snapshot
                exception: MessageNotUnderstood: UndefinedObject>>snapshot
                resumeValue: nil
        Receiver's instance variables:
nil

MCVersionHistoryBrowser>>snapshotForInfo:
        Receiver: a MCVersionHistoryBrowser
        Arguments and temporary variables:
                aVersionInfo: a MCVersionInfo(Monticello-nice.716)
        Receiver's instance variables:
                dependents: a DependentsArray(a
PluggableSystemWindow<Monticello-eem.717 Histor...etc...
                morph: nil
                label: nil
                modalProcess: nil
                modalValue: nil
                ancestry: a MCVersionInfo(Monticello-eem.717)
                index: 2
                repositoryGroup: nil
                package: nil
                infos: {a MCVersionInfo(Monticello-eem.717) . a
MCVersionInfo(Monticello-nice.716...etc...

MCVersionHistoryBrowser>>selectedSnapshot
        Receiver: a MCVersionHistoryBrowser
        Arguments and temporary variables:

        Receiver's instance variables:
                dependents: a DependentsArray(a
PluggableSystemWindow<Monticello-eem.717 Histor...etc...
                morph: nil
                label: nil
                modalProcess: nil
                modalValue: nil
                ancestry: a MCVersionInfo(Monticello-eem.717)
                index: 2
                repositoryGroup: nil
                package: nil
                infos: {a MCVersionInfo(Monticello-eem.717) . a
MCVersionInfo(Monticello-nice.716...etc...

MCVersionHistoryBrowser>>viewChanges
        Receiver: a MCVersionHistoryBrowser
        Arguments and temporary variables:

        Receiver's instance variables:
                dependents: a DependentsArray(a
PluggableSystemWindow<Monticello-eem.717 Histor...etc...
                morph: nil
                label: nil
                modalProcess: nil
                modalValue: nil
                ancestry: a MCVersionInfo(Monticello-eem.717)
                index: 2
                repositoryGroup: nil
                package: nil
                infos: {a MCVersionInfo(Monticello-eem.717) . a
MCVersionInfo(Monticello-nice.716...etc...

MCVersionHistoryBrowser(MCTool)>>perform:orSendTo:
        Receiver: a MCVersionHistoryBrowser
        Arguments and temporary variables:
                selector: #viewChanges
                otherTarget: a PluggableListMorphPlus(1058352)
        Receiver's instance variables:
                dependents: a DependentsArray(a
PluggableSystemWindow<Monticello-eem.717 Histor...etc...
                morph: nil
                label: nil
                modalProcess: nil
                modalValue: nil
                ancestry: a MCVersionInfo(Monticello-eem.717)
                index: 2
                repositoryGroup: nil
                package: nil
                infos: {a MCVersionInfo(Monticello-eem.717) . a
MCVersionInfo(Monticello-nice.716...etc...

[] in MenuItemMorph>>invokeWithEvent:
        Receiver: a MenuItemMorph(2941004)'view changes to Monticello-eem.717'
        Arguments and temporary variables:
<<error during printing>
        Receiver's instance variables:
                bounds: 920@238 corner: 1302@262
                owner: a MenuMorph(3302562)
                submorphs: #()
                fullBounds: 920@238 corner: 1302@262
                color: Color black
                extension: a MorphExtension (960164) [other:
(layoutProperties -> a LayoutProp...etc...
                font: a StrikeFont(Bitmap DejaVu Sans 14 22)
                emphasis: 0
                contents: 'view changes to Monticello-eem.717'
                hasFocus: false
                isEnabled: true
                subMenu: nil
                isSelected: false
                target: a MCVersionHistoryBrowser
                selector: #perform:orSendTo:
                arguments: {#viewChanges . a
PluggableListMorphPlus(1058352)}
                icon: nil

BlockClosure>>ensure:
        Receiver: [closure] in MenuItemMorph>>invokeWithEvent:
        Arguments and temporary variables:
                aBlock: [closure] in CursorWithMask(Cursor)>>showWhile:
                complete: nil
                returnValue: nil
        Receiver's instance variables:
                outerContext: MenuItemMorph>>invokeWithEvent:
                startpc: 248
                numArgs: 0

CursorWithMask(Cursor)>>showWhile:
        Receiver: ((CursorWithMask
        extent: 16@16
        depth: 1
        fromArray: #(
                2r0
                2r10000000000000000000000...etc...
        Arguments and temporary variables:
                aBlock: [closure] in MenuItemMorph>>invokeWithEvent:
                oldcursor: ((CursorWithMask
        extent: 16@16
        depth: 1
        fromArray: #(
                2r0
                2r1...etc...
        Receiver's instance variables:
                bits: a Bitmap of length 16
                width: 16
                height: 16
                depth: 1
                offset: -1@ -1
                maskForm: Form(16x16x1)

MenuItemMorph>>invokeWithEvent:
        Receiver: a MenuItemMorph(2941004)'view changes to Monticello-eem.717'
        Arguments and temporary variables:
                evt: [1167@246 mouseUp ( red ) 1407146]
                w: a PasteUpMorph(2434915) [world]
        Receiver's instance variables:
                bounds: 920@238 corner: 1302@262
                owner: a MenuMorph(3302562)
                submorphs: #()
                fullBounds: 920@238 corner: 1302@262
                color: Color black
                extension: a MorphExtension (960164) [other:
(layoutProperties -> a LayoutProp...etc...
                font: a StrikeFont(Bitmap DejaVu Sans 14 22)
                emphasis: 0
                contents: 'view changes to Monticello-eem.717'
                hasFocus: false
                isEnabled: true
                subMenu: nil
                isSelected: false
                target: a MCVersionHistoryBrowser
                selector: #perform:orSendTo:
                arguments: {#viewChanges . a
PluggableListMorphPlus(1058352)}
                icon: nil

MenuItemMorph>>mouseUp:
        Receiver: a MenuItemMorph(2941004)'view changes to Monticello-eem.717'
        Arguments and temporary variables:
                evt: [1167@246 mouseUp ( red ) 1407146]
        Receiver's instance variables:
                bounds: 920@238 corner: 1302@262
                owner: a MenuMorph(3302562)
                submorphs: #()
                fullBounds: 920@238 corner: 1302@262
                color: Color black
                extension: a MorphExtension (960164) [other:
(layoutProperties -> a LayoutProp...etc...
                font: a StrikeFont(Bitmap DejaVu Sans 14 22)
                emphasis: 0
                contents: 'view changes to Monticello-eem.717'
                hasFocus: false
                isEnabled: true
                subMenu: nil
                isSelected: false
                target: a MCVersionHistoryBrowser
                selector: #perform:orSendTo:
                arguments: {#viewChanges . a
PluggableListMorphPlus(1058352)}
                icon: nil

MenuItemMorph>>handleMouseUp:
        Receiver: a MenuItemMorph(2941004)'view changes to Monticello-eem.717'
        Arguments and temporary variables:
                anEvent: [1167@246 mouseUp ( red ) 1407146]
        Receiver's instance variables:
                bounds: 920@238 corner: 1302@262
                owner: a MenuMorph(3302562)
                submorphs: #()
                fullBounds: 920@238 corner: 1302@262
                color: Color black
                extension: a MorphExtension (960164) [other:
(layoutProperties -> a LayoutProp...etc...
                font: a StrikeFont(Bitmap DejaVu Sans 14 22)
                emphasis: 0
                contents: 'view changes to Monticello-eem.717'
                hasFocus: false
                isEnabled: true
                subMenu: nil
                isSelected: false
                target: a MCVersionHistoryBrowser
                selector: #perform:orSendTo:
                arguments: {#viewChanges . a
PluggableListMorphPlus(1058352)}
                icon: nil

MouseButtonEvent>>sentTo:
        Receiver: [1167@246 mouseUp ( red ) 1407146]
        Arguments and temporary variables:
                anObject: a MenuItemMorph(2941004)'view changes to
Monticello-eem.717'
        Receiver's instance variables:
                timeStamp: 1407146
                source: a HandMorph(658510)
                type: #mouseUp
                buttons: 0
                position: 1167@246
                handler: nil
                wasHandled: true
                wasIgnored: false
                whichButton: 4
                nClicks: 0

MenuItemMorph(Morph)>>handleEvent:
        Receiver: a MenuItemMorph(2941004)'view changes to Monticello-eem.717'
        Arguments and temporary variables:
                anEvent: [1167@246 mouseUp ( red ) 1407146]
                filteredEvent: [1167@246 mouseUp ( red ) 1407146]
        Receiver's instance variables:
                bounds: 920@238 corner: 1302@262
                owner: a MenuMorph(3302562)
                submorphs: #()
                fullBounds: 920@238 corner: 1302@262
                color: Color black
                extension: a MorphExtension (960164) [other:
(layoutProperties -> a LayoutProp...etc...
                font: a StrikeFont(Bitmap DejaVu Sans 14 22)
                emphasis: 0
                contents: 'view changes to Monticello-eem.717'
                hasFocus: false
                isEnabled: true
                subMenu: nil
                isSelected: false
                target: a MCVersionHistoryBrowser
                selector: #perform:orSendTo:
                arguments: {#viewChanges . a
PluggableListMorphPlus(1058352)}
                icon: nil

MorphicEventDispatcher>>dispatchEvent:withHandler:withMorph:
        Receiver: a MorphicEventDispatcher
        Arguments and temporary variables:
                anEvent: [1167@246 mouseUp ( red ) 1407146]
                aHandler: a MenuItemMorph(2941004)'view changes to
Monticello-eem.717'
                aMorph: a MenuItemMorph(2941004)'view changes to
Monticello-eem.717'
                result: #rejected
                filteredEvent: [1167@246 mouseUp ( red ) 1407146]
        Receiver's instance variables:
                lastType: #mouseUp
                lastDispatch: #dispatchDefault:with:

MorphicEventDispatcher>>dispatchDefault:with:
        Receiver: a MorphicEventDispatcher
        Arguments and temporary variables:
                anEvent: [1167@246 mouseUp ( red ) 1407146]
                aMorph: a MenuItemMorph(2941004)'view changes to
Monticello-eem.717'
        Receiver's instance variables:
                lastType: #mouseUp
                lastDispatch: #dispatchDefault:with:

MorphicEventDispatcher>>dispatchEvent:with:
        Receiver: a MorphicEventDispatcher
        Arguments and temporary variables:
                anEvent: [1167@246 mouseUp ( red ) 1407146]
                aMorph: a MenuItemMorph(2941004)'view changes to
Monticello-eem.717'
        Receiver's instance variables:
                lastType: #mouseUp
                lastDispatch: #dispatchDefault:with:

MenuItemMorph(Morph)>>processEvent:using:
        Receiver: a MenuItemMorph(2941004)'view changes to Monticello-eem.717'
        Arguments and temporary variables:
                anEvent: [1167@246 mouseUp ( red ) 1407146]
                defaultDispatcher: a MorphicEventDispatcher
                filteredEvent: [1167@246 mouseUp ( red ) 1407146]
        Receiver's instance variables:
                bounds: 920@238 corner: 1302@262
                owner: a MenuMorph(3302562)
                submorphs: #()
                fullBounds: 920@238 corner: 1302@262
                color: Color black
                extension: a MorphExtension (960164) [other:
(layoutProperties -> a LayoutProp...etc...
                font: a StrikeFont(Bitmap DejaVu Sans 14 22)
                emphasis: 0
                contents: 'view changes to Monticello-eem.717'
                hasFocus: false
                isEnabled: true
                subMenu: nil
                isSelected: false
                target: a MCVersionHistoryBrowser
                selector: #perform:orSendTo:
                arguments: {#viewChanges . a
PluggableListMorphPlus(1058352)}
                icon: nil

[] in MorphicEventDispatcher>>dispatchEvent:toSubmorphsOf:
        Receiver: a MorphicEventDispatcher
        Arguments and temporary variables:
<<error during printing>
        Receiver's instance variables:
                lastType: #mouseUp
                lastDispatch: #dispatchDefault:with:

Array(SequenceableCollection)>>do:
        Receiver: {a MenuItemMorph(2941004)'view changes to Monticello-eem.717'
. a MenuItemMorph(3786396)'v...etc...
        Arguments and temporary variables:
                aBlock: [closure] in
MorphicEventDispatcher>>dispatchEvent:toSubmorphsOf:
                index: 1
                indexLimiT: 8
        Receiver's instance variables:
{a MenuItemMorph(2941004)'view changes to Monticello-eem.717' . a
MenuItemMorph(3786396)'v...etc...


--- The full stack ---
UndefinedObject(Object)>>doesNotUnderstand: #snapshot
MCVersionHistoryBrowser>>snapshotForInfo:
MCVersionHistoryBrowser>>selectedSnapshot
MCVersionHistoryBrowser>>viewChanges
MCVersionHistoryBrowser(MCTool)>>perform:orSendTo:
[] in MenuItemMorph>>invokeWithEvent:
BlockClosure>>ensure:
CursorWithMask(Cursor)>>showWhile:
MenuItemMorph>>invokeWithEvent:
MenuItemMorph>>mouseUp:
MenuItemMorph>>handleMouseUp:
MouseButtonEvent>>sentTo:
MenuItemMorph(Morph)>>handleEvent:
MorphicEventDispatcher>>dispatchEvent:withHandler:withMorph:
MorphicEventDispatcher>>dispatchDefault:with:
MorphicEventDispatcher>>dispatchEvent:with:
MenuItemMorph(Morph)>>processEvent:using:
[] in MorphicEventDispatcher>>dispatchEvent:toSubmorphsOf:
Array(SequenceableCollection)>>do:
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MenuMorph(Morph)>>submorphsDo:
MorphicEventDispatcher>>dispatchEvent:toSubmorphsOf:
MorphicEventDispatcher>>dispatchEvent:withHandler:withMorph:
MorphicEventDispatcher>>dispatchDefault:with:
MorphicEventDispatcher>>dispatchEvent:with:
MenuMorph(Morph)>>processEvent:using:
MorphicEventDispatcher>>doProcessingForFocusEvent:with:
MorphicEventDispatcher>>dispatchFocusEventFully:with:
MenuMorph>>processFocusEvent:using:
MenuMorph(Morph)>>processFocusEvent:
[] in [] in [] in HandMorph>>sendFocusEvent:to:clear:
BlockClosure>>ensure:
MouseButtonEvent(MorphicEvent)>>becomeActiveDuring:
[] in [] in HandMorph>>sendFocusEvent:to:clear:
BlockClosure>>ensure:
HandMorph>>becomeActiveDuring:
[] in HandMorph>>sendFocusEvent:to:clear:
BlockClosure>>ensure:
PasteUpMorph>>becomeActiveDuring:
HandMorph>>sendFocusEvent:to:clear:
HandMorph>>sendEvent:focus:clear:
HandMorph>>sendMouseEvent:
HandMorph>>handleEvent:
HandMorph>>processEvents
[] in WorldState>>doOneCycleNowFor:
Array(SequenceableCollection)>>do:
WorldState>>handsDo:
WorldState>>doOneCycleNowFor:
WorldState>>doOneCycleFor:
PasteUpMorph>>doOneCycle
[] in MorphicProject>>spawnNewProcess
[] in BlockClosure>>newProcess

Am Freitag, 8. Mai 2020, 15:40:41 CEST schrieb Thiede, Christoph:

> Hi Martin,
>
>
> not sure if this is related, but I changed the behavior of the dependency
> sorter in a recent Monticello version. Could you try out Monticello-ct.717
> from the Inbox and tell us whether the problem remains?
>
>
> Best,
>
> Christoph
>
> ________________________________
> Von: Squeak-dev <[hidden email]> im Auftrag
> von Martin Kuball <[hidden email]> Gesendet: Freitag, 8. Mai 2020
> 13:57:18
> An: The general-purpose Squeak developers list
> Betreff: Re: [squeak-dev] Monticello postscript problem
>
> Hi Marcel,
>
> Am Freitag, 8. Mai 2020, 09:17:41 CEST schrieb Marcel Taeumel:
> > Hi Martin,
> >
> > I think that it would be better to first run all initializers and only
> > then
> > the package postscripts. I thought this happens anyway. :-)
> >
> > Can you point me to the source code you found?
>
> Sure.  Look at MCPackageLoader>>basicLoad. The problem is almost at the end
> with this lines:
>
>         additions do: [:ea | ea postloadOver: (self obsoletionFor: ea)]
>                 displayingProgress: 'Initializing ', pkgName.
>
> The instance variable additions holds MCDefinition objects. Mostly for the
> classes but although the postscript. I replaced above lines with:
>
>         (additions select: [:ea | ea isScriptDefinition not]) do:
>                 [:ea | ea postloadOver: (self obsoletionFor: ea)]
>                 displayingProgress: 'Initializing classes ', pkgName.
>
>         (additions select: [:ea | ea isScriptDefinition]) do:
>                 [:ea | ea postloadOver: (self obsoletionFor: ea)]
>                 displayingProgress: 'executing postscript ', pkgName.
>
> But it would be much nicer to either have an extra variable for the
> postscript (assuming there could only be one) or make sure it always stays
> at the end of the list.
>
> > Best,
> > Marcel
> > Am 07.05.2020 21:50:28 schrieb Martin Kuball <[hidden email]>:
> >
> > Am Donnerstag, 7. Mai 2020, 21:45:50 CEST schrieb Martin Kuball:
> > > Hi all,
> > >
> > > I have a problem with a postscript in one of my Monticello packages. It
> > > fails to execute because a class used in the script did not had it's
> > > initialize method run, yet. I took a look under the hood and found, that
> > > the postscript and the initializer execs are all mixed together in one
> > > list. But the postscript was not at the end of this list.
> > >
> > > So is this a bug or is there for some reason no guarantee that the
> > > postscript is run when everything else is done? I fixed this for me by
> > > running twice over the list. First for the non-scripts and then for the
> > > scripts. Not very pretty but seems to do the job.
> > >
> > > Martin
> >
> > I guess I should tell you that I'm using version 708 of monticello.





Reply | Threaded
Open this post in threaded view
|

Re: Monticello postscript problem

marcel.taeumel
Hi Martin, hi Christoph,

the problem with interference of #initialize and #postscript shoud be fixed in both Trunk and 5.3 now. However, #testLoadOrder and #testUnloadOrder are still failing. We have to look into that.

I stumbled across this issue and backported a fix to 5.3 because FFI loading would not work in 5.3 otherwise:

(Installer repository: 'http://source.squeak.org/FFI')
install: 'FFI-Pools';
install: 'FFI-Kernel'.

Best,
Marcel

Am 10.05.2020 15:53:22 schrieb Martin Kuball <[hidden email]>:

Hi Christoph,

sorry for the late answer. I tried version Monticello-jr.718. And it worked.
So far so good. So I was curious what exactly changed. I opened the history
and asked for the changes from 716 to 717. But I got an exception instead.
This worked with version 708.

10 May 2020 3:52:06.942302 pm

VM: unix - Smalltalk
Image: Squeak5.3 [latest update: #19438]

SecurityManager state:
Restricted: false
FileAccess: true
SocketAccess: true
Working Dir /home/kuball/SMT/s-5.3/test
Trusted Dir /home/kuball/SMT/s-5.3/test/secure
Untrusted Dir /home/kuball/SMT/s-5.3/test/My Squeak

UndefinedObject(Object)>>doesNotUnderstand: #snapshot
Receiver: nil
Arguments and temporary variables:
aMessage: snapshot
exception: MessageNotUnderstood: UndefinedObject>>snapshot
resumeValue: nil
Receiver's instance variables:
nil

MCVersionHistoryBrowser>>snapshotForInfo:
Receiver: a MCVersionHistoryBrowser
Arguments and temporary variables:
aVersionInfo: a MCVersionInfo(Monticello-nice.716)
Receiver's instance variables:
dependents: a DependentsArray(a
PluggableSystemWindow
morph: nil
label: nil
modalProcess: nil
modalValue: nil
ancestry: a MCVersionInfo(Monticello-eem.717)
index: 2
repositoryGroup: nil
package: nil
infos: {a MCVersionInfo(Monticello-eem.717) . a
MCVersionInfo(Monticello-nice.716...etc...

MCVersionHistoryBrowser>>selectedSnapshot
Receiver: a MCVersionHistoryBrowser
Arguments and temporary variables:

Receiver's instance variables:
dependents: a DependentsArray(a
PluggableSystemWindow
morph: nil
label: nil
modalProcess: nil
modalValue: nil
ancestry: a MCVersionInfo(Monticello-eem.717)
index: 2
repositoryGroup: nil
package: nil
infos: {a MCVersionInfo(Monticello-eem.717) . a
MCVersionInfo(Monticello-nice.716...etc...

MCVersionHistoryBrowser>>viewChanges
Receiver: a MCVersionHistoryBrowser
Arguments and temporary variables:

Receiver's instance variables:
dependents: a DependentsArray(a
PluggableSystemWindow
morph: nil
label: nil
modalProcess: nil
modalValue: nil
ancestry: a MCVersionInfo(Monticello-eem.717)
index: 2
repositoryGroup: nil
package: nil
infos: {a MCVersionInfo(Monticello-eem.717) . a
MCVersionInfo(Monticello-nice.716...etc...

MCVersionHistoryBrowser(MCTool)>>perform:orSendTo:
Receiver: a MCVersionHistoryBrowser
Arguments and temporary variables:
selector: #viewChanges
otherTarget: a PluggableListMorphPlus(1058352)
Receiver's instance variables:
dependents: a DependentsArray(a
PluggableSystemWindow
morph: nil
label: nil
modalProcess: nil
modalValue: nil
ancestry: a MCVersionInfo(Monticello-eem.717)
index: 2
repositoryGroup: nil
package: nil
infos: {a MCVersionInfo(Monticello-eem.717) . a
MCVersionInfo(Monticello-nice.716...etc...

[] in MenuItemMorph>>invokeWithEvent:
Receiver: a MenuItemMorph(2941004)'view changes to Monticello-eem.717'
Arguments and temporary variables:

Receiver's instance variables:
bounds: 920@238 corner: 1302@262
owner: a MenuMorph(3302562)
submorphs: #()
fullBounds: 920@238 corner: 1302@262
color: Color black
extension: a MorphExtension (960164) [other:
(layoutProperties -> a LayoutProp...etc...
font: a StrikeFont(Bitmap DejaVu Sans 14 22)
emphasis: 0
contents: 'view changes to Monticello-eem.717'
hasFocus: false
isEnabled: true
subMenu: nil
isSelected: false
target: a MCVersionHistoryBrowser
selector: #perform:orSendTo:
arguments: {#viewChanges . a
PluggableListMorphPlus(1058352)}
icon: nil

BlockClosure>>ensure:
Receiver: [closure] in MenuItemMorph>>invokeWithEvent:
Arguments and temporary variables:
aBlock: [closure] in CursorWithMask(Cursor)>>showWhile:
complete: nil
returnValue: nil
Receiver's instance variables:
outerContext: MenuItemMorph>>invokeWithEvent:
startpc: 248
numArgs: 0

CursorWithMask(Cursor)>>showWhile:
Receiver: ((CursorWithMask
extent: 16@16
depth: 1
fromArray: #(
2r0
2r10000000000000000000000...etc...
Arguments and temporary variables:
aBlock: [closure] in MenuItemMorph>>invokeWithEvent:
oldcursor: ((CursorWithMask
extent: 16@16
depth: 1
fromArray: #(
2r0
2r1...etc...
Receiver's instance variables:
bits: a Bitmap of length 16
width: 16
height: 16
depth: 1
offset: -1@ -1
maskForm: Form(16x16x1)

MenuItemMorph>>invokeWithEvent:
Receiver: a MenuItemMorph(2941004)'view changes to Monticello-eem.717'
Arguments and temporary variables:
evt: [1167@246 mouseUp ( red ) 1407146]
w: a PasteUpMorph(2434915) [world]
Receiver's instance variables:
bounds: 920@238 corner: 1302@262
owner: a MenuMorph(3302562)
submorphs: #()
fullBounds: 920@238 corner: 1302@262
color: Color black
extension: a MorphExtension (960164) [other:
(layoutProperties -> a LayoutProp...etc...
font: a StrikeFont(Bitmap DejaVu Sans 14 22)
emphasis: 0
contents: 'view changes to Monticello-eem.717'
hasFocus: false
isEnabled: true
subMenu: nil
isSelected: false
target: a MCVersionHistoryBrowser
selector: #perform:orSendTo:
arguments: {#viewChanges . a
PluggableListMorphPlus(1058352)}
icon: nil

MenuItemMorph>>mouseUp:
Receiver: a MenuItemMorph(2941004)'view changes to Monticello-eem.717'
Arguments and temporary variables:
evt: [1167@246 mouseUp ( red ) 1407146]
Receiver's instance variables:
bounds: 920@238 corner: 1302@262
owner: a MenuMorph(3302562)
submorphs: #()
fullBounds: 920@238 corner: 1302@262
color: Color black
extension: a MorphExtension (960164) [other:
(layoutProperties -> a LayoutProp...etc...
font: a StrikeFont(Bitmap DejaVu Sans 14 22)
emphasis: 0
contents: 'view changes to Monticello-eem.717'
hasFocus: false
isEnabled: true
subMenu: nil
isSelected: false
target: a MCVersionHistoryBrowser
selector: #perform:orSendTo:
arguments: {#viewChanges . a
PluggableListMorphPlus(1058352)}
icon: nil

MenuItemMorph>>handleMouseUp:
Receiver: a MenuItemMorph(2941004)'view changes to Monticello-eem.717'
Arguments and temporary variables:
anEvent: [1167@246 mouseUp ( red ) 1407146]
Receiver's instance variables:
bounds: 920@238 corner: 1302@262
owner: a MenuMorph(3302562)
submorphs: #()
fullBounds: 920@238 corner: 1302@262
color: Color black
extension: a MorphExtension (960164) [other:
(layoutProperties -> a LayoutProp...etc...
font: a StrikeFont(Bitmap DejaVu Sans 14 22)
emphasis: 0
contents: 'view changes to Monticello-eem.717'
hasFocus: false
isEnabled: true
subMenu: nil
isSelected: false
target: a MCVersionHistoryBrowser
selector: #perform:orSendTo:
arguments: {#viewChanges . a
PluggableListMorphPlus(1058352)}
icon: nil

MouseButtonEvent>>sentTo:
Receiver: [1167@246 mouseUp ( red ) 1407146]
Arguments and temporary variables:
anObject: a MenuItemMorph(2941004)'view changes to
Monticello-eem.717'
Receiver's instance variables:
timeStamp: 1407146
source: a HandMorph(658510)
type: #mouseUp
buttons: 0
position: 1167@246
handler: nil
wasHandled: true
wasIgnored: false
whichButton: 4
nClicks: 0

MenuItemMorph(Morph)>>handleEvent:
Receiver: a MenuItemMorph(2941004)'view changes to Monticello-eem.717'
Arguments and temporary variables:
anEvent: [1167@246 mouseUp ( red ) 1407146]
filteredEvent: [1167@246 mouseUp ( red ) 1407146]
Receiver's instance variables:
bounds: 920@238 corner: 1302@262
owner: a MenuMorph(3302562)
submorphs: #()
fullBounds: 920@238 corner: 1302@262
color: Color black
extension: a MorphExtension (960164) [other:
(layoutProperties -> a LayoutProp...etc...
font: a StrikeFont(Bitmap DejaVu Sans 14 22)
emphasis: 0
contents: 'view changes to Monticello-eem.717'
hasFocus: false
isEnabled: true
subMenu: nil
isSelected: false
target: a MCVersionHistoryBrowser
selector: #perform:orSendTo:
arguments: {#viewChanges . a
PluggableListMorphPlus(1058352)}
icon: nil

MorphicEventDispatcher>>dispatchEvent:withHandler:withMorph:
Receiver: a MorphicEventDispatcher
Arguments and temporary variables:
anEvent: [1167@246 mouseUp ( red ) 1407146]
aHandler: a MenuItemMorph(2941004)'view changes to
Monticello-eem.717'
aMorph: a MenuItemMorph(2941004)'view changes to
Monticello-eem.717'
result: #rejected
filteredEvent: [1167@246 mouseUp ( red ) 1407146]
Receiver's instance variables:
lastType: #mouseUp
lastDispatch: #dispatchDefault:with:

MorphicEventDispatcher>>dispatchDefault:with:
Receiver: a MorphicEventDispatcher
Arguments and temporary variables:
anEvent: [1167@246 mouseUp ( red ) 1407146]
aMorph: a MenuItemMorph(2941004)'view changes to
Monticello-eem.717'
Receiver's instance variables:
lastType: #mouseUp
lastDispatch: #dispatchDefault:with:

MorphicEventDispatcher>>dispatchEvent:with:
Receiver: a MorphicEventDispatcher
Arguments and temporary variables:
anEvent: [1167@246 mouseUp ( red ) 1407146]
aMorph: a MenuItemMorph(2941004)'view changes to
Monticello-eem.717'
Receiver's instance variables:
lastType: #mouseUp
lastDispatch: #dispatchDefault:with:

MenuItemMorph(Morph)>>processEvent:using:
Receiver: a MenuItemMorph(2941004)'view changes to Monticello-eem.717'
Arguments and temporary variables:
anEvent: [1167@246 mouseUp ( red ) 1407146]
defaultDispatcher: a MorphicEventDispatcher
filteredEvent: [1167@246 mouseUp ( red ) 1407146]
Receiver's instance variables:
bounds: 920@238 corner: 1302@262
owner: a MenuMorph(3302562)
submorphs: #()
fullBounds: 920@238 corner: 1302@262
color: Color black
extension: a MorphExtension (960164) [other:
(layoutProperties -> a LayoutProp...etc...
font: a StrikeFont(Bitmap DejaVu Sans 14 22)
emphasis: 0
contents: 'view changes to Monticello-eem.717'
hasFocus: false
isEnabled: true
subMenu: nil
isSelected: false
target: a MCVersionHistoryBrowser
selector: #perform:orSendTo:
arguments: {#viewChanges . a
PluggableListMorphPlus(1058352)}
icon: nil

[] in MorphicEventDispatcher>>dispatchEvent:toSubmorphsOf:
Receiver: a MorphicEventDispatcher
Arguments and temporary variables:

Receiver's instance variables:
lastType: #mouseUp
lastDispatch: #dispatchDefault:with:

Array(SequenceableCollection)>>do:
Receiver: {a MenuItemMorph(2941004)'view changes to Monticello-eem.717'
. a MenuItemMorph(3786396)'v...etc...
Arguments and temporary variables:
aBlock: [closure] in
MorphicEventDispatcher>>dispatchEvent:toSubmorphsOf:
index: 1
indexLimiT: 8
Receiver's instance variables:
{a MenuItemMorph(2941004)'view changes to Monticello-eem.717' . a
MenuItemMorph(3786396)'v...etc...


--- The full stack ---
UndefinedObject(Object)>>doesNotUnderstand: #snapshot
MCVersionHistoryBrowser>>snapshotForInfo:
MCVersionHistoryBrowser>>selectedSnapshot
MCVersionHistoryBrowser>>viewChanges
MCVersionHistoryBrowser(MCTool)>>perform:orSendTo:
[] in MenuItemMorph>>invokeWithEvent:
BlockClosure>>ensure:
CursorWithMask(Cursor)>>showWhile:
MenuItemMorph>>invokeWithEvent:
MenuItemMorph>>mouseUp:
MenuItemMorph>>handleMouseUp:
MouseButtonEvent>>sentTo:
MenuItemMorph(Morph)>>handleEvent:
MorphicEventDispatcher>>dispatchEvent:withHandler:withMorph:
MorphicEventDispatcher>>dispatchDefault:with:
MorphicEventDispatcher>>dispatchEvent:with:
MenuItemMorph(Morph)>>processEvent:using:
[] in MorphicEventDispatcher>>dispatchEvent:toSubmorphsOf:
Array(SequenceableCollection)>>do:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
MenuMorph(Morph)>>submorphsDo:
MorphicEventDispatcher>>dispatchEvent:toSubmorphsOf:
MorphicEventDispatcher>>dispatchEvent:withHandler:withMorph:
MorphicEventDispatcher>>dispatchDefault:with:
MorphicEventDispatcher>>dispatchEvent:with:
MenuMorph(Morph)>>processEvent:using:
MorphicEventDispatcher>>doProcessingForFocusEvent:with:
MorphicEventDispatcher>>dispatchFocusEventFully:with:
MenuMorph>>processFocusEvent:using:
MenuMorph(Morph)>>processFocusEvent:
[] in [] in [] in HandMorph>>sendFocusEvent:to:clear:
BlockClosure>>ensure:
MouseButtonEvent(MorphicEvent)>>becomeActiveDuring:
[] in [] in HandMorph>>sendFocusEvent:to:clear:
BlockClosure>>ensure:
HandMorph>>becomeActiveDuring:
[] in HandMorph>>sendFocusEvent:to:clear:
BlockClosure>>ensure:
PasteUpMorph>>becomeActiveDuring:
HandMorph>>sendFocusEvent:to:clear:
HandMorph>>sendEvent:focus:clear:
HandMorph>>sendMouseEvent:
HandMorph>>handleEvent:
HandMorph>>processEvents
[] in WorldState>>doOneCycleNowFor:
Array(SequenceableCollection)>>do:
WorldState>>handsDo:
WorldState>>doOneCycleNowFor:
WorldState>>doOneCycleFor:
PasteUpMorph>>doOneCycle
[] in MorphicProject>>spawnNewProcess
[] in BlockClosure>>newProcess

Am Freitag, 8. Mai 2020, 15:40:41 CEST schrieb Thiede, Christoph:

> Hi Martin,
>
>
> not sure if this is related, but I changed the behavior of the dependency
> sorter in a recent Monticello version. Could you try out Monticello-ct.717
> from the Inbox and tell us whether the problem remains?
>
>
> Best,
>
> Christoph
>
> ________________________________
> Von: Squeak-dev im Auftrag
> von Martin Kuball Gesendet: Freitag, 8. Mai 2020
> 13:57:18
> An: The general-purpose Squeak developers list
> Betreff: Re: [squeak-dev] Monticello postscript problem
>
> Hi Marcel,
>
> Am Freitag, 8. Mai 2020, 09:17:41 CEST schrieb Marcel Taeumel:
> > Hi Martin,
> >
> > I think that it would be better to first run all initializers and only
> > then
> > the package postscripts. I thought this happens anyway. :-)
> >
> > Can you point me to the source code you found?
>
> Sure. Look at MCPackageLoader>>basicLoad. The problem is almost at the end
> with this lines:
>
> additions do: [:ea | ea postloadOver: (self obsoletionFor: ea)]
> displayingProgress: 'Initializing ', pkgName.
>
> The instance variable additions holds MCDefinition objects. Mostly for the
> classes but although the postscript. I replaced above lines with:
>
> (additions select: [:ea | ea isScriptDefinition not]) do:
> [:ea | ea postloadOver: (self obsoletionFor: ea)]
> displayingProgress: 'Initializing classes ', pkgName.
>
> (additions select: [:ea | ea isScriptDefinition]) do:
> [:ea | ea postloadOver: (self obsoletionFor: ea)]
> displayingProgress: 'executing postscript ', pkgName.
>
> But it would be much nicer to either have an extra variable for the
> postscript (assuming there could only be one) or make sure it always stays
> at the end of the list.
>
> > Best,
> > Marcel
> > Am 07.05.2020 21:50:28 schrieb Martin Kuball :
> >
> > Am Donnerstag, 7. Mai 2020, 21:45:50 CEST schrieb Martin Kuball:
> > > Hi all,
> > >
> > > I have a problem with a postscript in one of my Monticello packages. It
> > > fails to execute because a class used in the script did not had it's
> > > initialize method run, yet. I took a look under the hood and found, that
> > > the postscript and the initializer execs are all mixed together in one
> > > list. But the postscript was not at the end of this list.
> > >
> > > So is this a bug or is there for some reason no guarantee that the
> > > postscript is run when everything else is done? I fixed this for me by
> > > running twice over the list. First for the non-scripts and then for the
> > > scripts. Not very pretty but seems to do the job.
> > >
> > > Martin
> >
> > I guess I should tell you that I'm using version 708 of monticello.