VM versioning

Russell Allen mail at russell-allen.com
Mon May 16 01:09:27 UTC 2016


If you startup the VM from the command line, you will get something like this as the first line:

Self Virtual Machine Version 4.1.13, Sun 15 May 16 17:34:42 Mac OS X i386 (4.5.0-101-g6e1af6f)

This version number looks like it might be some sort of semantic versioning system (semver.org) or at least a major-minor-patch type of thing.

However, it really is Major.Minor.SnapshotVersion

In universe.cpp, the versions are set up:

// increment VM_snapshot_version whenever old snapshots will break; reset
// it to zero when changing the minor or major version
smi VM_major_version    = 4;
smi VM_minor_version    = 1;
smi VM_snapshot_version = 13;

but this comment is I think wrong, because the code only ever looks at the snapshot_version when determining loading a snapshot.:

  // return for snapshots whose version matches the current snapshot version
  if (snapshot_version == VM_snapshot_version)
    return;

  // Between snapshot versions 10 and 11, a new primitive was added: CompileWithSICNames.
  // To maintain compatibility, and since there's only a minor addition, we also read
  // snapshot whose version is 10. -mabdelmalek 11/02

  bool can_read_snapshot_with_mismatched_version =
        (snapshot_version == 10  &&  VM_snapshot_version == 11)
    || ((snapshot_version == 10 || snapshot_version == 11)  &&  VM_snapshot_version == 12)
    || ((snapshot_version == 12) && VM_snapshot_version == 13);
    
  if (can_read_snapshot_with_mismatched_version)
  	warning6("\n\tThis snapshot was saved using a different version\n"
                 "\tof the Self Virtual Machine (%d.%d.%d) and may behave unexpectedly\n"
                 "\tor not work correctly with this version (%d.%d.%d).\n", 
                 read_major_version,
                 read_minor_version,
                 snapshot_version,
                 VM_major_version,
                 VM_minor_version,
                 VM_snapshot_version);

  if (!can_read_snapshot_with_mismatched_version)
    fatalNoMenu6("\n\tThis snapshot was saved using a different version\n"
                 "\tof the Self Virtual Machine (%d.%d.%d) and will not\n"
                 "\twork with this version (%d.%d.%d).\n", 
                 read_major_version,
                 read_minor_version,
                 snapshot_version,
                 VM_major_version,
                 VM_minor_version,
                 VM_snapshot_version);

So if I increment the minor_version and reset the snapshot_version to 0, then the version checking will have to start looking at all the components, not just the snapshot_version.

We should do a new release soon. This should include a newly built VM and to distinguish it there should be a new VM number. 

So what should we number it?

4.2.0 and change the version checking code?
4.2.13?
4.1.14 and make it read .13 snapshots?
2016.1/13?
2016.1/14?


:) Russell 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.selflanguage.org/pipermail/self-interest/attachments/20160516/be8a9599/attachment.html>


More information about the Self-interest mailing list