On 15 April 2017 at 01:22, Ben Coman <btc@openinworld.com> wrote:
The "magic decode for image files" seems related and possibly *very* useful....
http://forum.world.st/magic-decode-for-image-files-td4941712.html#a4941837

Now traditionally the VM has been backward compatible with old Images,
but Pharo doesn't necessarily adhere to that and policy IIUC is
release specific VM/Image pairs.
So does Pharo require extra magic numbers to co-ordinate this?
And how would this interact with OpenSmalltalk policy on these magic numbers?

I would really like a copy of the script that checks the magic number and starts the right VM. David, could you share yours please?

I started writing

case file -m @share@/magic "$image" in
�� �� 'Smalltalk image V3 32b*')
�� �� �� �� vm=@pharo-vm-cog@
�� �� �� �� ;;
�� �� 'Smalltalk image Spur 32b*')
�� �� �� �� vm=@pharo-vm-spur@
�� �� �� �� ;;
�� �� 'Smalltalk image Spur 64b*')
�� �� �� �� vm=@pharo-vm-spur64@
�� �� �� �� ;;
�� �� *)
�� �� �� �� echo unrecognized image file format
�� �� �� �� ;;
esac

... but would prefer to avoid reinventing the wheel e.g. on how to find the image name in amongst the various options passed to $@.

I would quite like for my package to be able to open the pharo-launcher image and the various images that this downloads. This means supporting pre-spur images. I would ideally like to do that by building a non-spur version of the latest VM, but I am not sure if that is supported for pharo, there is no mvm script for non-spur. The alternative would be to just build an old VM release with cmake.