GemTalk / Rowan

a new project/package manager for Smalltalk that supports FileTree and Tonel repositories, and is independent of Monticello and Metacello
MIT License
13 stars 7 forks source link

Can create rowan audit failures by sending `_useUnicodeComparePrimitives:` #898

Open ericwinger opened 1 year ago

ericwinger commented 1 year ago

Reproduction case:

Rowan projectTools audit auditAll.  "verify audit is clean"
Unicode16 _useUnicodeComparePrimitives: true.  "This causes the audit corruption" 
Rowan projectTools audit auditAll "Run audit again and see audit failures- "

This is not the way to turn on unicode comparison mode, but if this is run and a commit is done, the audit will get failures. Probably shouldn't allow the user to mess up their audit results by sending a message.

As an aside, I did see how it might be possible to send this method through normal code. GsCurrentSession>>initialize sends Unicode16>>installUnicodeComparePrimitives which sends Unicode16>>_useUnicodeComparePrimitieves: That looks suspicious to me and may be the reason why my Jadeite unit tests would show rowan audit failures from time to time.

dalehenrich commented 1 year ago

The audit failures are all related to base image packages and it seems that we are getting three different errors:

  1. Compiled method is not identical to loaded method a. looks to be because a method got compiled without updating the loaded stuff?
  2. Mismatched method category a. looks to be because a class category was changed from a String to a Symbol?
  3. classVars changed a. looks to be because the order of classVars has changed ... but class vars should be sorted when compared? The fact that the audit failures are being caused by a switch to unicode comparison mode, with no direct edits to the affected methods and classes, implies that the audit code is sensitive to comparisons and/or sort order ...

Rowan has never been tested in an environment where the comparison mode has been changed, so it is not too surprising that this is going on ...