syntax error in StartupLoader script

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

syntax error in StartupLoader script

Ben Coman
When using the following StartupLoader script

    StartupLoader default executeAtomicItems: {
        StartupAction name: 'Shared Package Cache' code: [
MCCacheRepository default directory setPathName:
'C:\Apps\Smalltalk\!Shared-Package-Cache'.].
    }.

I was getting a "syntax error in startup" that I could not identify (is
it obvious to others?)
This was due to the debugger not opening at the point of error since
SmalltalkImage>>executeDeferredStartupActions catches the errors.  So I
hacked this as follows...
    deferredStartupActions do: [:each |
        [ each cull: resuming ] value.
            "btcdebug
            on: Halt
            do: [ :err|
                Smalltalk
                    logError: '==== Startup Error: ', err description
                    inContext: err signalerContext.
                 errors add: err]"].

and then after a quit and restart the dialog "Syntax error: Unmatched
string quote" appeared with...
    StartupLoader default executeAtomicItems: {
        StartupAction name: 'Shared Package Cache' code: [
MCCacheRepository default directory setPathName: _Unmatched string
quote_ -> 'C:\Apps\Smalltalk\

So after removing "!" from the folder name the syntax error went away.

So now a few questions...

1. Is there a simpler way to debug the startup scripts that I have missed?
If not, can a StartupLoader>>test or similar be implemented which runs
the same as at image start time but without the error catching in
executeDeferredStartupActions, rather than needing to hack
executeDeferredStartupActions as I did.

2. Is it reasonable to set a shared package cache in the startup like I
have?
Or are there some obvious problems with this that I don't see?
I would like to avoid downloading all packages every time unzip a fresh
image for testing.

3. Is the invalid "!" fixable (though of course I've worked around it)?

I'll open any required bug entries.
This was with Pharo-14333 / cogwin_r2522.zip / Windows 7.

cheers, -ben



Reply | Threaded
Open this post in threaded view
|

Re: syntax error in StartupLoader script

Benjamin Van Ryseghem (Pharo)
You can evaluate:

StartupLoader default errors

And you get the error kept when scripts are executed :)


Ben


On Feb 18, 2012, at 12:19 AM, Ben Coman wrote:

> When using the following StartupLoader script
>
>   StartupLoader default executeAtomicItems: {
>       StartupAction name: 'Shared Package Cache' code: [ MCCacheRepository default directory setPathName: 'C:\Apps\Smalltalk\!Shared-Package-Cache'.].
>   }.
>
> I was getting a "syntax error in startup" that I could not identify (is it obvious to others?)
> This was due to the debugger not opening at the point of error since SmalltalkImage>>executeDeferredStartupActions catches the errors.  So I hacked this as follows...
>   deferredStartupActions do: [:each |
>       [ each cull: resuming ] value.
>           "btcdebug
>           on: Halt
>           do: [ :err|
>               Smalltalk
>                   logError: '==== Startup Error: ', err description
>                   inContext: err signalerContext.
>                errors add: err]"].
>
> and then after a quit and restart the dialog "Syntax error: Unmatched string quote" appeared with...
>   StartupLoader default executeAtomicItems: {
>       StartupAction name: 'Shared Package Cache' code: [ MCCacheRepository default directory setPathName: _Unmatched string quote_ -> 'C:\Apps\Smalltalk\
>
> So after removing "!" from the folder name the syntax error went away.
>
> So now a few questions...
>
> 1. Is there a simpler way to debug the startup scripts that I have missed?
> If not, can a StartupLoader>>test or similar be implemented which runs the same as at image start time but without the error catching in executeDeferredStartupActions, rather than needing to hack executeDeferredStartupActions as I did.
>
> 2. Is it reasonable to set a shared package cache in the startup like I have? Or are there some obvious problems with this that I don't see?
> I would like to avoid downloading all packages every time unzip a fresh image for testing.
>
> 3. Is the invalid "!" fixable (though of course I've worked around it)?
>
> I'll open any required bug entries. This was with Pharo-14333 / cogwin_r2522.zip / Windows 7.
>
> cheers, -ben
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: syntax error in StartupLoader script

Ben Coman
Benjamin wrote:
> You can evaluate:
>
> StartupLoader default errors
>
> And you get the error kept when scripts are executed :)
>
>
> Ben
>  
Thanks Ben, but I only get an empty OrderedCollection
    array:     #(nil nil nil nil nil nil nil nil nil nil)
    firstIndex:     1
    lastIndex:     0

btw, I can see three different things that might return and was
wondering whether:

a. it would be only the names of the error?  I already had the name of
the error  "SyntaxErrorNotification"  from the _startupErrors_ temporary
variable in  "SmalltalkImage>>snapshot:andQuit:"   but that was of no
use to me since the syntax error in...  
    MCCacheRepository default directory setPathName:
'C:\Apps\Smalltalk\!Shared-Package-Cache'
...is not obvious to me and was unsolvable without stepping through with
the debugger

b. it would include the context of the error that can be used to step
through with the debugger?

c. it would be...
     MCCacheRepository default directory setPathName: _Unmatched string
quote_ -> 'C:\Apps\Smalltalk\

cheers, -ben

>
> On Feb 18, 2012, at 12:19 AM, Ben Coman wrote:
>
>  
>> When using the following StartupLoader script [1]
>>
>>   StartupLoader default executeAtomicItems: {
>>       StartupAction name: 'Shared Package Cache' code: [ MCCacheRepository default directory setPathName: 'C:\Apps\Smalltalk\!Shared-Package-Cache'.].
>>   }.
>>
>> I was getting a "syntax error in startup" that I could not identify (is it obvious to others?)
>> This was due to the debugger not opening at the point of error since SmalltalkImage>>executeDeferredStartupActions catches the errors.  So I hacked this as follows...
>>   deferredStartupActions do: [:each |
>>       [ each cull: resuming ] value.
>>           "btcdebug
>>           on: Halt
>>           do: [ :err|
>>               Smalltalk
>>                   logError: '==== Startup Error: ', err description
>>                   inContext: err signalerContext.
>>                errors add: err]"].
>>
>> and then after a quit and restart the dialog "Syntax error: Unmatched string quote" appeared with...
>>   StartupLoader default executeAtomicItems: {
>>       StartupAction name: 'Shared Package Cache' code: [ MCCacheRepository default directory setPathName: _Unmatched string quote_ -> 'C:\Apps\Smalltalk\
>>
>> So after removing "!" from the folder name the syntax error went away.
>>
>> So now a few questions...
>>
>> 1. Is there a simpler way to debug the startup scripts that I have missed?
>> If not, can a StartupLoader>>test or similar be implemented which runs the same as at image start time but without the error catching in executeDeferredStartupActions, rather than needing to hack executeDeferredStartupActions as I did.
>>
>> 2. Is it reasonable to set a shared package cache in the startup like I have? Or are there some obvious problems with this that I don't see?
>> I would like to avoid downloading all packages every time unzip a fresh image for testing.
>>
>> 3. Is the invalid "!" fixable (though of course I've worked around it)?
>>
>> I'll open any required bug entries. This was with Pharo-14333 / cogwin_r2522.zip / Windows 7.
>>
>> cheers, -ben
>>
>>
>>
>>    
>
>
>
>  




Reply | Threaded
Open this post in threaded view
|

Re: syntax error in StartupLoader script

Camillo Bruni-3
In reply to this post by Ben Coman
you can try to load

SLICE-Issue-5290-Cleanup-Startup-Error-Handling-CamilloBruni.2

from the pharoInbox which will significantly improve the error responses during startup.

best
cami


On 2012-02-18, at 00:19, Ben Coman wrote:

> When using the following StartupLoader script
>
>   StartupLoader default executeAtomicItems: {
>       StartupAction name: 'Shared Package Cache' code: [ MCCacheRepository default directory setPathName: 'C:\Apps\Smalltalk\!Shared-Package-Cache'.].
>   }.
>
> I was getting a "syntax error in startup" that I could not identify (is it obvious to others?)
> This was due to the debugger not opening at the point of error since SmalltalkImage>>executeDeferredStartupActions catches the errors.  So I hacked this as follows...
>   deferredStartupActions do: [:each |
>       [ each cull: resuming ] value.
>           "btcdebug
>           on: Halt
>           do: [ :err|
>               Smalltalk
>                   logError: '==== Startup Error: ', err description
>                   inContext: err signalerContext.
>                errors add: err]"].
>
> and then after a quit and restart the dialog "Syntax error: Unmatched string quote" appeared with...
>   StartupLoader default executeAtomicItems: {
>       StartupAction name: 'Shared Package Cache' code: [ MCCacheRepository default directory setPathName: _Unmatched string quote_ -> 'C:\Apps\Smalltalk\
>
> So after removing "!" from the folder name the syntax error went away.
>
> So now a few questions...
>
> 1. Is there a simpler way to debug the startup scripts that I have missed?
> If not, can a StartupLoader>>test or similar be implemented which runs the same as at image start time but without the error catching in executeDeferredStartupActions, rather than needing to hack executeDeferredStartupActions as I did.
>
> 2. Is it reasonable to set a shared package cache in the startup like I have? Or are there some obvious problems with this that I don't see?
> I would like to avoid downloading all packages every time unzip a fresh image for testing.
>
> 3. Is the invalid "!" fixable (though of course I've worked around it)?
>
> I'll open any required bug entries. This was with Pharo-14333 / cogwin_r2522.zip / Windows 7.
>
> cheers, -ben
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: syntax error in StartupLoader script

Ben Coman

I loaded SLICE-Issue-5290 onto a freshly unzipped Pharo-1.4-14341 +
cogwin_r2522.zip
This caused a problem with the debugger as follows.   In workspace I
execute...
    self halt.
    x := 1.
    y := 2.
    z := x+y.

I click the second line of the stack "UndefinedObject>>DoIt"   which now
shows "halt" highlighted.
I click <Into> and " := 1" is now highlighted.
I click <Into> again and nothing happens.  There is no further response
from any of the debugger buttons, although <Full Stack> causes the
window to flash once.

I can temporarily fix this misbehaviour by forcing #isPostMortem to
always return false.


Camillo Bruni wrote:

> you can try to load
>
> SLICE-Issue-5290-Cleanup-Startup-Error-Handling-CamilloBruni.2
>
> from the pharoInbox which will significantly improve the error responses during startup.
>
> best
> cami
>
>
> On 2012-02-18, at 00:19, Ben Coman wrote:
>
>  
>> When using the following StartupLoader script
>>
>>   StartupLoader default executeAtomicItems: {
>>       StartupAction name: 'Shared Package Cache' code: [ MCCacheRepository default directory setPathName: 'C:\Apps\Smalltalk\!Shared-Package-Cache'.].
>>   }.
>>
>> I was getting a "syntax error in startup" that I could not identify (is it obvious to others?)
>> This was due to the debugger not opening at the point of error since SmalltalkImage>>executeDeferredStartupActions catches the errors.  So I hacked this as follows...
>>   deferredStartupActions do: [:each |
>>       [ each cull: resuming ] value.
>>           "btcdebug
>>           on: Halt
>>           do: [ :err|
>>               Smalltalk
>>                   logError: '==== Startup Error: ', err description
>>                   inContext: err signalerContext.
>>                errors add: err]"].
>>
>> and then after a quit and restart the dialog "Syntax error: Unmatched string quote" appeared with...
>>   StartupLoader default executeAtomicItems: {
>>       StartupAction name: 'Shared Package Cache' code: [ MCCacheRepository default directory setPathName: _Unmatched string quote_ -> 'C:\Apps\Smalltalk\
>>
>> So after removing "!" from the folder name the syntax error went away.
>>
>> So now a few questions...
>>
>> 1. Is there a simpler way to debug the startup scripts that I have missed?
>> If not, can a StartupLoader>>test or similar be implemented which runs the same as at image start time but without the error catching in executeDeferredStartupActions, rather than needing to hack executeDeferredStartupActions as I did.
>>
>> 2. Is it reasonable to set a shared package cache in the startup like I have? Or are there some obvious problems with this that I don't see?
>> I would like to avoid downloading all packages every time unzip a fresh image for testing.
>>
>> 3. Is the invalid "!" fixable (though of course I've worked around it)?
>>
>> I'll open any required bug entries. This was with Pharo-14333 / cogwin_r2522.zip / Windows 7.
>>
>> cheers, -ben
>>
>>
>>
>>    
>
>
>
>  


Reply | Threaded
Open this post in threaded view
|

Re: syntax error in StartupLoader script

Camillo Bruni-3
thanks, I will have a look at it


On 2012-02-21, at 06:10, Ben Coman wrote:

>
> I loaded SLICE-Issue-5290 onto a freshly unzipped Pharo-1.4-14341 + cogwin_r2522.zip
> This caused a problem with the debugger as follows.   In workspace I execute...
>   self halt.
>   x := 1.
>   y := 2.
>   z := x+y.
>
> I click the second line of the stack "UndefinedObject>>DoIt"   which now shows "halt" highlighted.
> I click <Into> and " := 1" is now highlighted.
> I click <Into> again and nothing happens.  There is no further response from any of the debugger buttons, although <Full Stack> causes the window to flash once.
>
> I can temporarily fix this misbehaviour by forcing #isPostMortem to always return false.
>
>
> Camillo Bruni wrote:
>> you can try to load
>> SLICE-Issue-5290-Cleanup-Startup-Error-Handling-CamilloBruni.2
>>
>> from the pharoInbox which will significantly improve the error responses during startup.
>>
>> best
>> cami
>>
>>
>> On 2012-02-18, at 00:19, Ben Coman wrote:
>>
>>  
>>> When using the following StartupLoader script
>>>
>>>  StartupLoader default executeAtomicItems: {
>>>      StartupAction name: 'Shared Package Cache' code: [ MCCacheRepository default directory setPathName: 'C:\Apps\Smalltalk\!Shared-Package-Cache'.].
>>>  }.
>>>
>>> I was getting a "syntax error in startup" that I could not identify (is it obvious to others?)
>>> This was due to the debugger not opening at the point of error since SmalltalkImage>>executeDeferredStartupActions catches the errors.  So I hacked this as follows...
>>>  deferredStartupActions do: [:each |
>>>      [ each cull: resuming ] value.
>>>          "btcdebug
>>>          on: Halt
>>>          do: [ :err|
>>>              Smalltalk
>>>                  logError: '==== Startup Error: ', err description
>>>                  inContext: err signalerContext.
>>>               errors add: err]"].
>>>
>>> and then after a quit and restart the dialog "Syntax error: Unmatched string quote" appeared with...
>>>  StartupLoader default executeAtomicItems: {
>>>      StartupAction name: 'Shared Package Cache' code: [ MCCacheRepository default directory setPathName: _Unmatched string quote_ -> 'C:\Apps\Smalltalk\
>>>
>>> So after removing "!" from the folder name the syntax error went away.
>>>
>>> So now a few questions...
>>>
>>> 1. Is there a simpler way to debug the startup scripts that I have missed?
>>> If not, can a StartupLoader>>test or similar be implemented which runs the same as at image start time but without the error catching in executeDeferredStartupActions, rather than needing to hack executeDeferredStartupActions as I did.
>>>
>>> 2. Is it reasonable to set a shared package cache in the startup like I have? Or are there some obvious problems with this that I don't see?
>>> I would like to avoid downloading all packages every time unzip a fresh image for testing.
>>>
>>> 3. Is the invalid "!" fixable (though of course I've worked around it)?
>>>
>>> I'll open any required bug entries. This was with Pharo-14333 / cogwin_r2522.zip / Windows 7.
>>>
>>> cheers, -ben
>>>
>>>
>>>
>>>    
>>
>>
>>
>>  
>
>


Reply | Threaded
Open this post in threaded view
|

Re: syntax error in StartupLoader script

Camillo Bruni-3
check the latest slice, I think I fixed the debugger issue.

SLICE-Issue-5290-Cleanup-Startup-Error-Handling-CamilloBruni.7

best
cami

On 2012-02-21, at 13:10, Camillo Bruni wrote:

> thanks, I will have a look at it
>
>
> On 2012-02-21, at 06:10, Ben Coman wrote:
>>
>> I loaded SLICE-Issue-5290 onto a freshly unzipped Pharo-1.4-14341 + cogwin_r2522.zip
>> This caused a problem with the debugger as follows.   In workspace I execute...
>>  self halt.
>>  x := 1.
>>  y := 2.
>>  z := x+y.
>>
>> I click the second line of the stack "UndefinedObject>>DoIt"   which now shows "halt" highlighted.
>> I click <Into> and " := 1" is now highlighted.
>> I click <Into> again and nothing happens.  There is no further response from any of the debugger buttons, although <Full Stack> causes the window to flash once.
>>
>> I can temporarily fix this misbehaviour by forcing #isPostMortem to always return false.
>>
>>
>> Camillo Bruni wrote:
>>> you can try to load
>>> SLICE-Issue-5290-Cleanup-Startup-Error-Handling-CamilloBruni.2
>>>
>>> from the pharoInbox which will significantly improve the error responses during startup.
>>>
>>> best
>>> cami
>>>
>>>
>>> On 2012-02-18, at 00:19, Ben Coman wrote:
>>>
>>>
>>>> When using the following StartupLoader script
>>>>
>>>> StartupLoader default executeAtomicItems: {
>>>>     StartupAction name: 'Shared Package Cache' code: [ MCCacheRepository default directory setPathName: 'C:\Apps\Smalltalk\!Shared-Package-Cache'.].
>>>> }.
>>>>
>>>> I was getting a "syntax error in startup" that I could not identify (is it obvious to others?)
>>>> This was due to the debugger not opening at the point of error since SmalltalkImage>>executeDeferredStartupActions catches the errors.  So I hacked this as follows...
>>>> deferredStartupActions do: [:each |
>>>>     [ each cull: resuming ] value.
>>>>         "btcdebug
>>>>         on: Halt
>>>>         do: [ :err|
>>>>             Smalltalk
>>>>                 logError: '==== Startup Error: ', err description
>>>>                 inContext: err signalerContext.
>>>>              errors add: err]"].
>>>>
>>>> and then after a quit and restart the dialog "Syntax error: Unmatched string quote" appeared with...
>>>> StartupLoader default executeAtomicItems: {
>>>>     StartupAction name: 'Shared Package Cache' code: [ MCCacheRepository default directory setPathName: _Unmatched string quote_ -> 'C:\Apps\Smalltalk\
>>>>
>>>> So after removing "!" from the folder name the syntax error went away.
>>>>
>>>> So now a few questions...
>>>>
>>>> 1. Is there a simpler way to debug the startup scripts that I have missed?
>>>> If not, can a StartupLoader>>test or similar be implemented which runs the same as at image start time but without the error catching in executeDeferredStartupActions, rather than needing to hack executeDeferredStartupActions as I did.
>>>>
>>>> 2. Is it reasonable to set a shared package cache in the startup like I have? Or are there some obvious problems with this that I don't see?
>>>> I would like to avoid downloading all packages every time unzip a fresh image for testing.
>>>>
>>>> 3. Is the invalid "!" fixable (though of course I've worked around it)?
>>>>
>>>> I'll open any required bug entries. This was with Pharo-14333 / cogwin_r2522.zip / Windows 7.
>>>>
>>>> cheers, -ben
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>>
>>
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: syntax error in StartupLoader script

Ben Coman
That works. Thanks Camillo.

btw, from further investigation into Q3 below, I have logged new Issue
5350 related to the invalid exclamation mark in the startup script..


Camillo Bruni wrote:

> check the latest slice, I think I fixed the debugger issue.
>
> SLICE-Issue-5290-Cleanup-Startup-Error-Handling-CamilloBruni.7
>
> best
> cami
>
> On 2012-02-21, at 13:10, Camillo Bruni wrote:
>
>  
>> thanks, I will have a look at it
>>
>>
>> On 2012-02-21, at 06:10, Ben Coman wrote:
>>    
>>> I loaded SLICE-Issue-5290 onto a freshly unzipped Pharo-1.4-14341 + cogwin_r2522.zip
>>> This caused a problem with the debugger as follows.   In workspace I execute...
>>>  self halt.
>>>  x := 1.
>>>  y := 2.
>>>  z := x+y.
>>>
>>> I click the second line of the stack "UndefinedObject>>DoIt"   which now shows "halt" highlighted.
>>> I click <Into> and " := 1" is now highlighted.
>>> I click <Into> again and nothing happens.  There is no further response from any of the debugger buttons, although <Full Stack> causes the window to flash once.
>>>
>>> I can temporarily fix this misbehaviour by forcing #isPostMortem to always return false.
>>>
>>>
>>> Camillo Bruni wrote:
>>>      
>>>> you can try to load
>>>> SLICE-Issue-5290-Cleanup-Startup-Error-Handling-CamilloBruni.2
>>>>
>>>> from the pharoInbox which will significantly improve the error responses during startup.
>>>>
>>>> best
>>>> cami
>>>>
>>>>
>>>> On 2012-02-18, at 00:19, Ben Coman wrote:
>>>>
>>>>
>>>>        
>>>>> When using the following StartupLoader script
>>>>>
>>>>> StartupLoader default executeAtomicItems: {
>>>>>     StartupAction name: 'Shared Package Cache' code: [ MCCacheRepository default directory setPathName: 'C:\Apps\Smalltalk\!Shared-Package-Cache'.].
>>>>> }.
>>>>>
>>>>> I was getting a "syntax error in startup" that I could not identify (is it obvious to others?)
>>>>> This was due to the debugger not opening at the point of error since SmalltalkImage>>executeDeferredStartupActions catches the errors.  So I hacked this as follows...
>>>>> deferredStartupActions do: [:each |
>>>>>     [ each cull: resuming ] value.
>>>>>         "btcdebug
>>>>>         on: Halt
>>>>>         do: [ :err|
>>>>>             Smalltalk
>>>>>                 logError: '==== Startup Error: ', err description
>>>>>                 inContext: err signalerContext.
>>>>>              errors add: err]"].
>>>>>
>>>>> and then after a quit and restart the dialog "Syntax error: Unmatched string quote" appeared with...
>>>>> StartupLoader default executeAtomicItems: {
>>>>>     StartupAction name: 'Shared Package Cache' code: [ MCCacheRepository default directory setPathName: _Unmatched string quote_ -> 'C:\Apps\Smalltalk\
>>>>>
>>>>> So after removing "!" from the folder name the syntax error went away.
>>>>>
>>>>> So now a few questions...
>>>>>
>>>>> 1. Is there a simpler way to debug the startup scripts that I have missed?
>>>>> If not, can a StartupLoader>>test or similar be implemented which runs the same as at image start time but without the error catching in executeDeferredStartupActions, rather than needing to hack executeDeferredStartupActions as I did.
>>>>>
>>>>> 2. Is it reasonable to set a shared package cache in the startup like I have? Or are there some obvious problems with this that I don't see?
>>>>> I would like to avoid downloading all packages every time unzip a fresh image for testing.
>>>>>
>>>>> 3. Is the invalid "!" fixable (though of course I've worked around it)?
>>>>>
>>>>> I'll open any required bug entries. This was with Pharo-14333 / cogwin_r2522.zip / Windows 7.
>>>>>
>>>>> cheers, -ben
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>          
>>>>
>>>>
>>>>        
>>>      
>
>
>
>