Hi,
In VisualGST when playing with packages, I've seen a strange behavior: The source code of methods was not correctly displayed. It can happens when you've re-installed a package but not reload it. Because the source code position (FileSegment) is not correctly set and no more correct (the method is maybe removed). I've made a small fix, when installing a package I decompress it in a temporary directory (in ~\.st\...) and when leaving the vm I remove all the files. The idea is for all gst create a session directory where all the packages will be loaded. Thus I've added a new primitive which call tempnam for creating a temporary dir. After I create a session directory for the current GST. And when we leave the vm it's destroyed (when calling update:) #aboutToQuit all the files and the directory are removed too. Gwen _______________________________________________ help-smalltalk mailing list [hidden email] https://lists.gnu.org/mailman/listinfo/help-smalltalk Session-Package.patch (8K) Download Attachment |
On 07/06/2011 11:45 PM, Gwenael Casaccio wrote:
> > In VisualGST when playing with packages, I've seen a strange behavior: > The source code of methods was not correctly displayed. It can happens > when you've re-installed a package but not reload it. Because the source > code position (FileSegment) is not correctly set and no more correct > (the method is maybe removed). I've made a small fix, when installing a > package I decompress it in a temporary directory (in ~\.st\...) and when > leaving the vm I remove all the files. That cannot work. If you load a package with gst-load, the image exits and there is no source code anymore. Much worse than the case you are solving. A possible solution could be to add a version tag to the packages, and storing source under /var/lib/smalltalk/sources/PACKAGE/VERSION. Or under /var/lib/smalltalk/sources/SHA1-OF-STAR-FILE perhaps. And also, if you move the image to another computer, right now all that is needed to see the source is a download of the package (I think); with this additional tweak, you would need to expand the package sources. All this can be done automatically using VFS, but it is not so easy. You have the problem of GCing the sources too. If extraction is done automatically, however, that's not a problem as you can just rm -rf /var/lib/smalltalk/sources/*. > The idea is for all gst create a session directory where all the > packages will be loaded. Thus I've added a new primitive which call > tempnam for creating a temporary dir. After I create a session directory > for the current GST. And when we leave the vm it's destroyed (when > calling update:) #aboutToQuit all the files and the directory are > removed too. There is already Directory class>>#createTemporary:. Paolo _______________________________________________ help-smalltalk mailing list [hidden email] https://lists.gnu.org/mailman/listinfo/help-smalltalk |
On Thu, Jul 7, 2011 at 8:37 AM, Paolo Bonzini <[hidden email]> wrote:
> On 07/06/2011 11:45 PM, Gwenael Casaccio wrote: >> >> In VisualGST when playing with packages, I've seen a strange behavior: >> The source code of methods was not correctly displayed. It can happens >> when you've re-installed a package but not reload it. Because the source >> code position (FileSegment) is not correctly set and no more correct >> (the method is maybe removed). I've made a small fix, when installing a >> package I decompress it in a temporary directory (in ~\.st\...) and when >> leaving the vm I remove all the files. > > That cannot work. If you load a package with gst-load, the image exits and > there is no source code anymore. Much worse than the case you are solving. > I've never used gst-load and forget it :s. > A possible solution could be to add a version tag to the packages, and > storing source under /var/lib/smalltalk/sources/PACKAGE/VERSION. Or under > /var/lib/smalltalk/sources/SHA1-OF-STAR-FILE perhaps. And also, if you move > the image to another computer, right now all that is needed to see the > source is a download of the package (I think); with this additional tweak, > you would need to expand the package sources. All this can be done > automatically using VFS, but it is not so easy. > > You have the problem of GCing the sources too. If extraction is done > automatically, however, that's not a problem as you can just rm -rf > /var/lib/smalltalk/sources/*. > Yes I was thinking at the versioned approach too. But isn't a kind of "session" directory useful when working with VisualGST. If it crashes all the work/changes could be inside? >> The idea is for all gst create a session directory where all the >> packages will be loaded. Thus I've added a new primitive which call >> tempnam for creating a temporary dir. After I create a session directory >> for the current GST. And when we leave the vm it's destroyed (when >> calling update:) #aboutToQuit all the files and the directory are >> removed too. > > There is already Directory class>>#createTemporary:. > > Paolo > _______________________________________________ help-smalltalk mailing list [hidden email] https://lists.gnu.org/mailman/listinfo/help-smalltalk |
Free forum by Nabble | Edit this page |