The Trunk: System-cmm.1214.mcz

Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: System-cmm.1214.mcz

commits-2
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.' ] ]!


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: System-cmm.1214.mcz

timrowledge
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; [hidden email]; http://www.rowledge.org/tim
Strange OpCodes: CM: Circulate Memory



Reply | Threaded
Open this post in threaded view
|

Loading code without adding to the changes file (was Re: The Trunk: System-cmm.1214.mcz)

timrowledge


> On 2021-02-05, at 9:15 PM, tim Rowledge <[hidden email]> 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; [hidden email]; http://www.rowledge.org/tim
"Bother" said Pooh, as he realised Piglet was undercooked.



Reply | Threaded
Open this post in threaded view
|

Re: Loading code without adding to the changes file (was Re: The Trunk: System-cmm.1214.mcz)

timrowledge
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; [hidden email]; http://www.rowledge.org/tim
Science adjusts its views based on what is observed. Faith denies observation so belief can be preserved




NoWriteChangeToFile.5.cs (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Loading code without adding to the changes file (was Re: The Trunk: System-cmm.1214.mcz)

timrowledge
This ability to not write out to the changes file has proven *extremely* useful for server images that have to read in code every time they start; no ever-growing chnages file to worry about. Given that the chages file on my personal squeaksource setup is exceeeding 900Mb, I'd say that might be auseful general capability.

I'd like to see it adopted for the next release but since it touches several packages it seems polite to check if anyone can spot any problems.