Hi,
I have the annoyance of not being able to load a saved morph from a file within squeak5.2-18229-64bit-201810190412-Linux which also applies to squeak5.1-16549-64bit-201608171728-Linux. The morph I want to load is a book morph and other morphs seem to be restorable. When I try to load it it fails with a positional stream error, with my humble debugging skills I tried to investigate it but failed in finding the cause. I attached the file which makes the problems, maybe someone with more skills can find the cause. It was originally generated within a fresh squeak5.1-18229-64bit-201810190412-Linux image. Thanks, Philip presentation.morph.gz (8K) Download Attachment |
Hi Philip,
I can confirm the error, but I also see the same error when I try to load the morph file in a freshly downloaded Squeak5.1-16553-64bit image. Are you able to load the morph file back into the same image from which it was generated? If so, perhaps there is something that has been changed or added to that image that would need to be added to the new squeak 5.2 image as well. This is only a guess, but maybe it will help. Dave On Sat, Jan 12, 2019 at 11:28:21PM +0100, Philip Bernhart wrote: > Hi, > > I have the annoyance of not being able to load a saved > morph from a file within squeak5.2-18229-64bit-201810190412-Linux > which also applies to squeak5.1-16549-64bit-201608171728-Linux. > > The morph I want to load is a book morph and other morphs seem > to be restorable. > > When I try to load it it fails with a positional stream error, > with my humble debugging skills I tried to investigate it but > failed in finding the cause. > > I attached the file which makes the problems, maybe someone > with more skills can find the cause. It was originally generated > within a fresh squeak5.1-18229-64bit-201810190412-Linux image. > > Thanks, > Philip > |
Hi David,
I tried to do an export / import again in the original squeak5.1-16549-64bit-201608171728 derived image. And it failed there too. Creating empty morphs and saving them / reloading them also fails when restoring them. Doing the same on a squeak5.2 image seems to be no problem. That's bad. As it makes it impossible? for me to migrate objects created in an image to upgrade them to a new squeak version (exporting them / reloading them). Suggestions? Thanks, Philip "David T. Lewis" <[hidden email]> writes: > I can confirm the error, but I also see the same error when I try > to load the morph file in a freshly downloaded Squeak5.1-16553-64bit > image. > > Are you able to load the morph file back into the same image from > which it was generated? > > If so, perhaps there is something that has been changed or added > to that image that would need to be added to the new squeak 5.2 > image as well. This is only a guess, but maybe it will help. |
There was some work done to the SmartRefenceStream loading and saving in 5.2. It was broken i 5.1 so I'm not quite sure how much you must do to make it work. I think it would be possible to back port the fixes if you can lokate them. Best, Karl On Sun, Jan 13, 2019 at 6:43 PM Philip Bernhart <[hidden email]> wrote: Hi David, |
It may be easier to just update the 5.1 image to the latest trunk version,
then save the morph after updating. Be sure to save a copy of your image and changes files first, then do the update as follows (it takes about 15 minutes or so): Go to Tools -> Preferences on the top menu bar to open a preference browser. In the preference browser, scroll down to "updates" Change Update URL from http://source.squeak.org/squeak51 to http://source.squeak.org/trunk (accept change) Close the preference browser Squeaky mouse -> Update Squeak (upper left corner on the menu bar) This will start the update process. You will encounter several merge dialog boxes, just accept all the merges and proceed in each of them until done: Merging Morphic-mt.1297, accept two changes, merge. Merging ST80-mt.217, accept change, merge. Merging ReleaseBuilder-mt.169, accept change, merge. Merging Morphic-tpr.1321, accept three changes, merge. ReleaseBuilder-eem.172, accept change, merge. ==> done. Dave On Sun, Jan 13, 2019 at 08:48:44PM +0100, karl ramberg wrote: > There was some work done to the SmartRefenceStream loading and saving in > 5.2. > It was broken i 5.1 so I'm not quite sure how much you must do to make it > work. > I think it would be possible to back port the fixes if you can lokate them. > > Best, > Karl > > > > > > On Sun, Jan 13, 2019 at 6:43 PM Philip Bernhart <[hidden email]> > wrote: > > > Hi David, > > > > I tried to do an export / import again in the original > > squeak5.1-16549-64bit-201608171728 derived image. > > > > And it failed there too. Creating empty morphs and > > saving them / reloading them also fails when restoring > > them. Doing the same on a squeak5.2 image seems to be > > no problem. > > > > That's bad. As it makes it impossible? for me to migrate > > objects created in an image to upgrade them to a new squeak > > version (exporting them / reloading them). > > > > Suggestions? > > > > > > Thanks, > > Philip > > > > "David T. Lewis" <[hidden email]> writes: > > > > > I can confirm the error, but I also see the same error when I try > > > to load the morph file in a freshly downloaded Squeak5.1-16553-64bit > > > image. > > > > > > Are you able to load the morph file back into the same image from > > > which it was generated? > > > > > > If so, perhaps there is something that has been changed or added > > > to that image that would need to be added to the new squeak 5.2 > > > image as well. This is only a guess, but maybe it will help. > > > > > |
Hello Philip
Dave's suggestion to update a copy of the 5.1image to the latest trunk version and then do the export is worth trying in any case. If that works out fine then that is an easy and elegant solution. If that does not work out another strategy I used successfully in the past is: 1. Create a new Morph object called 'lightBook' with property #isSlideCollection oder #isPagesCollection. The extent should be slightly larger than your original BookMorph so that you can easily grab it. 2. go through all pages of your bookmorph. 3. For each BookMorph page do 3a. Create a new Morph object with property #isSlide or #isPage 3b. Go through all submorphs of the BookMorph page and add them to the morph from 3a (Use addMorphBack: to preserve the order) 3c. Add the newly created light object (#isSlide) to the object 'lightBook' (again use addMorphBack:) 4. Save the object created under point 1. 5. Load the save morph in the target image and rebuild the bookMorph with the material in a similar way One of the reasons for this approach is that a BookMorph uses PasteUpMorph objects as pages. They may be complex and attract a lot of code material to be save out which is not easy to know about. This may cause problems. This said I did a similar exercise (Moving DATA objects represented by Morphs) from an 2018 image (5.2a) which I want to archive to a new 2019 image (5.2). I encountered a problem with recomputing the cached values for TextMorph (fix upcoming in the inbox). Also some morphs (pages) had problems because of the content involved the import procedure asked for code which was not in the target image and it was not easy to get the correct version. So I skipped these very pages, to avoid going for an in-depth analysis. HTH --Hannes On 1/13/19, David T. Lewis <[hidden email]> wrote: > It may be easier to just update the 5.1 image to the latest trunk version, > then save the morph after updating. > > Be sure to save a copy of your image and changes files first, then > do the update as follows (it takes about 15 minutes or so): > > Go to Tools -> Preferences on the top menu bar to open a preference > browser. > In the preference browser, scroll down to "updates" > Change Update URL from http://source.squeak.org/squeak51 to > http://source.squeak.org/trunk (accept change) > Close the preference browser > Squeaky mouse -> Update Squeak (upper left corner on the menu bar) > > This will start the update process. You will encounter several merge > dialog boxes, just accept all the merges and proceed in each of them > until done: > > Merging Morphic-mt.1297, accept two changes, merge. > Merging ST80-mt.217, accept change, merge. > Merging ReleaseBuilder-mt.169, accept change, merge. > Merging Morphic-tpr.1321, accept three changes, merge. > ReleaseBuilder-eem.172, accept change, merge. > > ==> done. > > Dave > > On Sun, Jan 13, 2019 at 08:48:44PM +0100, karl ramberg wrote: >> There was some work done to the SmartRefenceStream loading and saving in >> 5.2. >> It was broken i 5.1 so I'm not quite sure how much you must do to make it >> work. >> I think it would be possible to back port the fixes if you can lokate >> them. >> >> Best, >> Karl >> >> >> >> >> >> On Sun, Jan 13, 2019 at 6:43 PM Philip Bernhart >> <[hidden email]> >> wrote: >> >> > Hi David, >> > >> > I tried to do an export / import again in the original >> > squeak5.1-16549-64bit-201608171728 derived image. >> > >> > And it failed there too. Creating empty morphs and >> > saving them / reloading them also fails when restoring >> > them. Doing the same on a squeak5.2 image seems to be >> > no problem. >> > >> > That's bad. As it makes it impossible? for me to migrate >> > objects created in an image to upgrade them to a new squeak >> > version (exporting them / reloading them). >> > >> > Suggestions? >> > >> > >> > Thanks, >> > Philip >> > >> > "David T. Lewis" <[hidden email]> writes: >> > >> > > I can confirm the error, but I also see the same error when I try >> > > to load the morph file in a freshly downloaded Squeak5.1-16553-64bit >> > > image. >> > > >> > > Are you able to load the morph file back into the same image from >> > > which it was generated? >> > > >> > > If so, perhaps there is something that has been changed or added >> > > to that image that would need to be added to the new squeak 5.2 >> > > image as well. This is only a guess, but maybe it will help. >> > >> > > >> > > > |
In reply to this post by Philip Bernhart
Ma Serializer supports BookMorphs.
It's part of the "Ma Base" package available in SqueakMap. After installing, in an inspector of your BookMorph: MaObjectSerializer new fileOut: self toFileNamed: 'myBookMorph.obj' in: Directory default "do it" then, in the 5.2 image after installing "Ma Base": MaObjectSerializer fileIn: FileDirectory default / 'myBookMorph.obj' "inspect it" HTH, Chris On Sat, Jan 12, 2019 at 4:28 PM Philip Bernhart <[hidden email]> wrote: > > Hi, > > I have the annoyance of not being able to load a saved > morph from a file within squeak5.2-18229-64bit-201810190412-Linux > which also applies to squeak5.1-16549-64bit-201608171728-Linux. > > The morph I want to load is a book morph and other morphs seem > to be restorable. > > When I try to load it it fails with a positional stream error, > with my humble debugging skills I tried to investigate it but > failed in finding the cause. > > I attached the file which makes the problems, maybe someone > with more skills can find the cause. It was originally generated > within a fresh squeak5.1-18229-64bit-201810190412-Linux image. > > Thanks, > Philip > > |
Free forum by Nabble | Edit this page |