Chris Muller uploaded a new version of System to project The Trunk: http://source.squeak.org/trunk/System-cmm.1214.mcz
==================== Summary ====================
Name: System-cmm.1214 Author: cmm Time: 5 February 2021, 10:09:05.179247 pm UUID: d6f968d9-a638-42ef-89ef-d37af0f31ffd Ancestors: System-mt.1213
Patch the patcher. Smalltalk run: permits the patching of a production system without having to resort to running a custom image, but when the patch.st file has read-only status in the OS, FileStream class>>#fileNamed:do: can't open it, because it tries to open for read/write. But rather htan signal an error, it silently does nothing (wow), leaving the system unpatched. Patch files can and should be read-only anyway, so use DirectoryEntryFile>>#readStreamDo:.
=============== Diff against System-mt.1213 ===============
Item was changed: ----- Method: SmalltalkImage>>patchSystem (in category 'command line') ----- patchSystem 'patch.st' asDirectoryEntry ifNotNil: [ : patchEntry | patchEntry modificationTime > Smalltalk imageName asDirectoryEntry modificationTime ifTrue: [ Notification signal: 'Patching system...'. + patchEntry readStreamDo: [ : stream | stream fileIn ] ] - FileStream - fileNamed: 'patch.st' - do: - [ : stream | stream fileIn ] ] ifFalse: [ self error: 'patch.st file is older than the image file. Aborting.' ] ]!
Ah, that reminds me of a related issue I've been meaning to bring up for , oy, 6 years.
Last time I tried, it was not possible to load code into a system with no changes file because of an issue to do with the method tail - the bit where we keep the source details. Has that been solved?
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Strange OpCodes: CM: Circulate Memory
On 2021-02-05, at 9:15 PM, tim Rowledge tim@rowledge.org wrote:
Ah, that reminds me of a related issue I've been meaning to bring up for , oy, 6 years.
Last time I tried, it was not possible to load code into a system with no changes file because of an issue to do with the method tail - the bit where we keep the source details. Has that been solved?
I made some time to look at this yesterday and I think we probably have a fairly simple path to solution.
It looks like the key is the ClassDescription>>#acceptsLoggingOfCompilation method and other implementors. If I make it return false it becomes possible to add code and avoid writing anything out.
Actually, I had fun testing this because I had turned off the no sources/no changes preference and the deleted the changes file; upon trying to recompile the method it of course failed because of no changes file and I used the debugger to change the value of the boolean on the stack to false, thus letting me complete the compilation of the method that lets me compile with no logging. Smalltalk is so very cool.
There are several implementors to also consider here. MorphicModel, for example does a modestly gnarly check for the class of the compilation. So thinking of making a Preference (yes, I know I've railed against too many preferences frequently) for this, I think that a) making a preference in ClassDescription>>#acceptsLoggingOfCompilation b) changing all the other implementors except the Metaclass version to add a `super acceptsLoggingOfCompilation and: [` clause ... should do the job.
An interesting benefit of having this working would be cases where we want a base image running that perhaps gets a web request to spawn a new instance to run some website or application. Currently anything that causes logging can make for an 'interesting' mess in the parent's changes file.
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim "Bother" said Pooh, as he realised Piglet was undercooked.
Plausible looking changeset for this; since it touches several packages it makes more sense to share a test version this way.
One minor oddity that might need altering is that the ClassDescription preference is on the instance side rather than the class side; this is checked for in the pragma/preference adding code and so I've ended up with class side methods for the actual preference setting & pragma but an instance side usage of the added class variable. It feels messy somehow but it does work.
If you disable 'Warn if no changes file', 'Warn if no sources file', 'Read document at startup', 'Log compilations to changes file' and load the DoItFirst package you can save an image, delete its changes and run a command like - `squeak my.image -doit DoSomething &` and have a server running that won't try to log any code being compiled.
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Science adjusts its views based on what is observed. Faith denies observation so belief can be preserved
This no-write-changes facility has proven exceedingly useful this year and I wanted to wave it's little flag in the air to see if there are any good reasons to not include it in this release. Being able to make server images that don't write changelog entries is very useful when your system frequently has to import code. My PersonalSqueakSource system is not heavily used but has still accumulated 900Mb of changes.log this year.
On 2021-02-25, at 3:27 PM, tim Rowledge tim@rowledge.org wrote:
Plausible looking changeset for this; since it touches several packages it makes more sense to share a test version this way.
<NoWriteChangeToFile.5.cs>
One minor oddity that might need altering is that the ClassDescription preference is on the instance side rather than the class side; this is checked for in the pragma/preference adding code and so I've ended up with class side methods for the actual preference setting & pragma but an instance side usage of the added class variable. It feels messy somehow but it does work.
If you disable 'Warn if no changes file', 'Warn if no sources file', 'Read document at startup', 'Log compilations to changes file' and load the DoItFirst package you can save an image, delete its changes and run a command like - `squeak my.image -doit DoSomething &` and have a server running that won't try to log any code being compiled.
tim
tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Science adjusts its views based on what is observed. Faith denies observation so belief can be preserved
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Oxymorons: Airline Food
Hi Tim --
Merged. Thanks for the pointer! And thanks for testing this. :-)
Best, Marcel Am 25.12.2021 19:59:56 schrieb tim Rowledge tim@rowledge.org: This no-write-changes facility has proven exceedingly useful this year and I wanted to wave it's little flag in the air to see if there are any good reasons to not include it in this release. Being able to make server images that don't write changelog entries is very useful when your system frequently has to import code. My PersonalSqueakSource system is not heavily used but has still accumulated 900Mb of changes.log this year.
On 2021-02-25, at 3:27 PM, tim Rowledge wrote:
Plausible looking changeset for this; since it touches several packages it makes more sense to share a test version this way.
One minor oddity that might need altering is that the ClassDescription preference is on the instance side rather than the class side; this is checked for in the pragma/preference adding code and so I've ended up with class side methods for the actual preference setting & pragma but an instance side usage of the added class variable. It feels messy somehow but it does work.
If you disable 'Warn if no changes file', 'Warn if no sources file', 'Read document at startup', 'Log compilations to changes file' and load the DoItFirst package you can save an image, delete its changes and run a command like - `squeak my.image -doit DoSomething &` and have a server running that won't try to log any code being compiled.
tim
tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Science adjusts its views based on what is observed. Faith denies observation so belief can be preserved
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Oxymorons: Airline Food
squeak-dev@lists.squeakfoundation.org