Re: Standalone compile never leaves closing open stacks
Posted: Wed Nov 18, 2020 10:33 pm
It was an intentional change so there's no reason to send a report to LC. There was a discussion on the mailing list about it, here is what I saved:
The standalone builder has always needed to close the stacks it builds for reasons pretty deeply ingrained in the code. However this causes a few problems, for example:
values in script locals become empty
behaviors are broken when the parent script is on / in a stack which closes
As an attempt to improve this situation, the code that locks messages when closing and opening stacks for standalone builds has been removed. This means that where previously mainstacks would not receive openStack and closeStack messages during standalone build, they now do.
If this causes problems for your stack, you can exit from the handler if standalone building is in progress:
on closeStack
if the environment is "development" AND there is a stack
"revStandaloneProgress" AND the mode of stack
"revStandaloneProgress" > 0 then
exit closeStack
end if
...
...
end closeStack
All stack-related messages need to use this: preOpen*, open*, close*, etc.
So you could write a function:
function isBuildingStandalone
return the environment is "development" AND \
there is a stack "revStandaloneProgress" AND \
the mode of stack "revStandaloneProgress" > 0
end isBuildingStandalone
and then in e.g. the openstack handler:
on openstack
if isBuildingStandalone() then
exit openstack
end if
..
..
end openstack
Similar in all other (pre)open*/close* messages.
Kind regards,
Panos