Eliot Miranda uploaded a new version of FFI-Kernel to project FFI:
http://source.squeak.org/FFI/FFI-Kernel-eem.228.mcz
==================== Summary ====================
Name: FFI-Kernel-eem.228
Author: eem
Time: 13 April 2023, 2:40:45.749373 pm
UUID: 77163f53-9648-49ae-904a-d16fd63af2ab
Ancestors: FFI-Kernel-eem.227
Make sure that compiledSpecs in ExternalLibraryFunctions in CompiledMethods are up-to-date after a platform change. The current FFI code invalidates these on platform change, but does nothing to update them.
Hence cache allInstances of ExternalLibraryFunction in a class var to avoid having to do an allInstancesDo: whenever the platform changes.
=============== Diff against FFI-Kernel-eem.227 ===============
Item was changed:
ExternalFunction subclass: #ExternalLibraryFunction
instanceVariableNames: 'name module errorCodeName'
+ classVariableNames: 'Instances'
- classVariableNames: ''
poolDictionaries: ''
category: 'FFI-Kernel'!
!ExternalLibraryFunction commentStamp: '' prior: 0!
An ExternalLibraryFunction specifies a fully qualified function from an external library.
Instance variables:
name <String | Integer> name or ordinal of function
module <String | nil> name of module (nil if bound in the VM).
errorCodeName <String | nil> name of temp receiving error code, if any!
Item was added:
+ ----- Method: ExternalLibraryFunction class>>instances (in category 'private') -----
+ instances
+ "Cache our instances for faster reinitialization."
+ ^Instances ifNil: [Instances := WeakSet withAll: self allInstances]!
Item was added:
+ ----- Method: ExternalLibraryFunction class>>new (in category 'instance creation') -----
+ new
+ ^self instances add: super new!
Item was added:
+ ----- Method: ExternalLibraryFunction class>>platformChangedFrom:to: (in category 'instance initialization') -----
+ platformChangedFrom: lastPlatform to: currentPlatform
+ "Byte size or byte alignment for atomic types might be different on the new platform."
+
+ "Make sure that the cache of all instances is up-to-date before using it..."
+ Instances ifNil: [self new].
+
+ "Get all instances to update their compiledSpecs so that FFI calls work."
+ self updateArgTypeSpecs!
Item was added:
+ ----- Method: ExternalLibraryFunction class>>updateArgTypeSpecs (in category 'instance initialization') -----
+ updateArgTypeSpecs
+ self instances do: [:elf| elf updateArgTypeSpecs]!
Item was added:
+ ----- Method: ExternalLibraryFunction>>updateArgTypeSpecs (in category 'instance initialization') -----
+ updateArgTypeSpecs
+ argTypes ifNotNil:
+ [:typeArray| typeArray do: [:argType| argType updateFromReferentClass]]!
Item was added:
+ ----- Method: ExternalType>>updateFromReferentClass (in category 'instance initialization') -----
+ updateFromReferentClass
+ "If I have a referentClass update my compiledSpec to reflect the new state of the system, e.g. after a platform change."
+
+ referentClass ifNotNil: [:refClass| self newReferentClass: refClass]!
Item was changed:
----- Method: FFIPlatformDescription class>>startUp: (in category 'system startup') -----
startUp: resuming
"Notify all FFI classes about platform changes."
resuming ifTrue: [
LastPlatform in: [:lastPlatform | self newCurrent in: [:currentPlatform |
lastPlatform = currentPlatform
ifTrue: [
self flag: #discuss. "mt: Maybe add #platformResuming?"
ExternalAddress allBeNull ]
ifFalse: [
LastPlatform := currentPlatform. "Update now. See #current."
+ { ExternalAddress. ExternalType. ExternalPool. ExternalLibrary. ExternalLibraryFunction }
- { ExternalAddress. ExternalType. ExternalPool. ExternalLibrary }
do: [:cls | cls
platformChangedFrom: lastPlatform
to: currentPlatform] ]]].
+ self checkFFIOnStartUp ifTrue: [self checkFFI]]!
- self checkFFIOnStartUp ifTrue: [self checkFFI]].!
Marcel Taeumel uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-mt.1197.mcz
==================== Summary ====================
Name: Tools-mt.1197
Author: mt
Time: 11 April 2023, 11:03:12.65283 am
UUID: a5846202-532b-b44e-803d-4277997b1383
Ancestors: Tools-mt.1196
For custom browsers, simplify extension point for hierarchy-browsing by letting only the Browser class know of its current HierarchyBrowser specialization. StandardToolSet and SystemBrowser (i.e., app registry) only pre-scribe class-side protocol, which is here: #fullHierarchyOnClass: and #fullHierarchyOnClass:selector:.
=============== Diff against Tools-mt.1196 ===============
Item was added:
+ ----- Method: Browser class>>fullHierarchyOnClass: (in category 'instance creation') -----
+ fullHierarchyOnClass: aClass
+
+ ^ HierarchyBrowser fullOnClass: aClass!
Item was added:
+ ----- Method: Browser class>>fullHierarchyOnClass:selector: (in category 'instance creation') -----
+ fullHierarchyOnClass: aClass selector: aSelector
+
+ ^ HierarchyBrowser fullOnClass: aClass selector: aSelector!
Item was changed:
----- Method: Model>>addItem: (in category '*Tools') -----
addItem: classAndMethod
"Open a browser directly on the given class and method
Model new addItem: 'Model addItem:'
Model new addItem: 'Model>>addItem:'
"
self flag: #mref. "classAndMethod is a String"
MessageSet
parse: classAndMethod
toClassAndSelector: [ :class :sel |
class ifNil: [^self].
sel = #Comment ifTrue: [^ SystemBrowser default fullOnClassComment: class].
sel = #Definition ifTrue: [^ SystemBrowser default newOnClass: class].
+ sel = #Hierarchy ifTrue: [^ SystemBrowser default fullHierarchyOnClass: class].
- sel = #Hierarchy ifTrue: [^ HierarchyBrowser fullOnClass: class].
sel = #Help ifTrue: [^HelpBrowser openOn: class].
SystemBrowser default newOnClass: class selector: sel
]
!
Item was changed:
----- Method: StandardToolSet class>>browseHierarchy:selector: (in category 'browsing') -----
browseHierarchy: aClass selector: aSelector
+ "Open a hierarchy browser"
+
+ ^ SystemBrowser default fullHierarchyOnClass: aClass selector: aSelector!
- "Open a browser"
-
- ^ HierarchyBrowser fullOnClass: aClass selector: aSelector.!
tim Rowledge uploaded a new version of WebClient-Help to project The Trunk:
http://source.squeak.org/trunk/WebClient-Help-tpr.12.mcz
==================== Summary ====================
Name: WebClient-Help-tpr.12
Author: tpr
Time: 9 April 2023, 6:10:02.643749 pm
UUID: 5e15f5b1-6367-4806-b2e2-28f065c2a24c
Ancestors: WebClient-Help-kfr.11
Update the WebServer help info a little. It has, after all, been the case that the SqueakSSL package is built in since Squeak 5, so we don't need to tell people to load it.
Also added info on the useful #logAction: capablilty
=============== Diff against WebClient-Help-kfr.11 ===============
Item was changed:
----- Method: WebServerHelp class>>authentication (in category 'pages') -----
authentication
"This method was automatically generated. Edit it using:"
"WebServerHelp edit: #authentication"
+ <generated>
+ ^(HelpTopic
- ^HelpTopic
title: 'Authentication'
contents:
'To add authentication you can use web server as follows:
+ WebServer default addService: ''/smalltalk'' action:
+ [:req| | action |
+ WebServer default authenticate: req realm: ''squeak'' methods: #(digest basic) do:
+ [action := (req fields at: ''get'' ifAbsent:['''']) asSymbol.
+ req send200Response: (Smalltalk perform: action) asString]].
- WebServer default addService: ''/smalltalk'' action:[:req| | action |
- WebServer default authenticate: req realm: ''squeak'' methods: #(digest basic) do:[
- action := (req fields at: ''get'' ifAbsent:['''']) asSymbol.
- req send200Response: (Smalltalk perform: action) asString.
- ].
- ].
The above supports both digest as well as basic authentication for accessing the /smalltalk service. Let''s add a user so that we can access it:
WebServer default passwordAt: ''squeak'' realm: ''squeak'' put: ''squeak''.
The server does NOT store plain text passwords, but rather hashes. To be precise, it stores the ha1 term used in digest authentication which is the same hash produced by htdigest. We can now access the /smalltalk service by providing user name ''squeak'' and password ''squeak''.
(WebClient httpGet:''http://localhost:8080/smalltalk?get=platformName'') content.
Unfortunately, digest authentication can be slow since our MD5 implementation is rather pathetic.
!!
+ ]style[(69 7 1 11 1 12 1 10 2 3 1 1 1 1 6 1 1 13 7 1 13 1 3 1 6 1 8 1 8 3 6 1 5 2 7 1 6 1 2 1 1 3 1 6 1 3 1 5 1 9 1 2 1 1 1 8 5 3 1 16 1 1 10 8 1 6 1 1 8 1 160 7 1 11 1 8 1 6 1 8 1 4 1 8 292 8 50 2 7 102),c000000126,,c000000126,,c126000126,,c000000126,,c000000126,cgray;,,cgray;,,cgray;,,cgray;,,c000000126,,c000000126,,c000000126,,c000000126,,c126000126,,c000000126,,c000000126,,c000000126,,c000000126,c000126000,cgray;,,b,,c126000126,c000000126,,c000000126,,c000000126,,c126000126,,c000000126,c126000000,c126000126,c126000000,c126000126,,c000000126,,c000000126,,c000000126,,c126000126,,c000000126,,cgray;,c126000126,,c000000126,c000126000,,c000000126,,c000000126,,c126000126,,c000000126,,c126000126,,c000000126,,c126000126,,c000000126,c126000126,,c000000126,!!' readStream nextChunkText)
+ key: #authentication;
+ shouldStyle: false;
+ yourself!
- ]style[(58 11 7 1 11 1 12 1 7 2 3 1 1 1 1 6 1 1 13 7 1 13 1 3 1 6 1 8 1 8 3 6 1 5 2 3 1 4 6 1 2 1 1 3 1 6 1 3 1 5 1 9 1 2 1 1 1 8 5 3 1 16 1 1 10 8 1 6 1 1 8 4 1 6 146 11 7 1 11 1 8 1 6 1 8 1 4 1 8 2 278 12 8 50 2 7 2 100),cblack;,c000000127,cblack;,c000000127,cblack;,c127000127,cblack;,c000000127,cblack;,c000000127,cgray;,cblack;,cgray;,cblack;,cgray;,cblack;,cgray;,cblack;,c000000127,cblack;,c000000127,cblack;,c000000127,cblack;,c000000127,cblack;,c127000127,cblack;,c000000127,cblack;,c000000127,cblack;,c000000127,cblack;,c000000127,c000127000,cblack;,cgray;,cblack;,b,cblack;,c127000127,c000000127,cblack;,c000000127,cblack;,c000000127,cblack;,c127000127,cblack;,c000000127,c127000000,c127000127,c127000000,c127000127,cblack;,c000000127,cblack;,c000000127,cblack;,c000000127,cblack;,c127000127,cblack;,c000000127,cblack;,cgray;,c127000127,cblack;,c000000127,cblack;,c000127000,cblack;,,cblack;,c000000127,cblack;,c000000127,cblack;,c127000127,cblack;,c000000127,cblack;,c127000127,cblack
;,c000000127,cblack;,c127000127,cblack;,,cblack;,c000000127,c127000127,cblack;,c000000127,cblack;,!!' readStream nextChunkText!
Item was changed:
----- Method: WebServerHelp class>>logging (in category 'pages') -----
logging
"This method was automatically generated. Edit it using:"
"WebServerHelp edit: #logging"
+ <generated>
+ ^(HelpTopic
- ^HelpTopic
title: 'Logging'
contents:
+ 'WebServer supports request logging in common log format. In order to tell WebServer where to log to you can either give it a stream:
- 'WebServer supports logging in common log format. In order to tell WebServer where to log to you can either give it a stream:
WebServer default accessLog: Transcript.
or alternatively a file name, for example:
WebServer default accessLog: ''/var/log/wsd/access_log''.
When used in the latter form, WebServer opens and closes the file for each log entry which provides additional robustness at the cost of some performance.
+
+ WebServer also logs status info and error reports. The #log: method uses the logAction instVar - a block or message send - to display or otherwise save the info. The default logAction (WebServer>>#initialize) is simply to pass the info to the Transcript, but more sophisticated usage might include sending it to the ToothPick logger package or via an MQTT connection.
!!
+ ]style[(145 7 1 10 69 7 1 10 1 25 527),c000000125,,c000000125,,c000000125,,c000000125,,c125000125,!!' readStream nextChunkText)
+ key: #logging;
+ shouldStyle: false;
+ yourself!
- ]style[(126 11 7 1 10 12 46 11 7 1 10 1 25 1 157),cblack;,c000000127,cblack;,c000000127,cblack;,,cblack;,c000000127,cblack;,c000000127,cblack;,c127000127,cblack;,!!' readStream nextChunkText!
Item was changed:
----- Method: WebServerHelp class>>sslSupport (in category 'pages') -----
sslSupport
"This method was automatically generated. Edit it using:"
"WebServerHelp edit: #sslSupport"
+ <generated>
+ ^(HelpTopic
- ^HelpTopic
title: 'SSL/TLS Support'
contents:
+ 'WebServer supports secure connections over SSL/TLS via SqueakSSL. With SqueakSSL installed, you can tell WebServer to use a particular cert which puts WebServer into secure mode.
- 'WebServer supports secure connections over SSL/TLS via SqueakSSL. To install SqueakSSL, execute the following:
- (Installer ss project: ''SqueakSSL'')
- install: ''SqueakSSL-Core'';
- install: ''SqueakSSL-Tests''.
-
- If you have SqueakSSL installed, you can tell WebServer to use a particular cert which puts WebServer into secure mode.
-
The certName itself is platform dependent. On Unix, the cert name is the path to the .pem file with BOTH the cert and the private key, for example:
WebServer default certName: ''/home/user/certs/testcert.pem''.
On Windows, the cert name is a string that is matched against the certificate subject. Usually, the certificate subject includes your host name so that you would use:
WebServer default certName: ''secure.domain.com''.
Client certificate handling is currently not supported. !!
+ ]style[(340 7 1 9 1 31 182 7 1 9 1 19 59),c000000124,,c000000124,,c124000124,,c000000124,,c000000124,,c124000124,!!' readStream nextChunkText)
+ key: #sslSupport;
+ shouldStyle: false;
+ yourself!
- ]style[(112 12 2 1 8 1 11 4 8 1 16 4 8 1 17 1 272 11 7 1 9 1 31 1 170 11 7 1 9 1 19 1 58),cblack;,c000000127,cblack;,c000000127,cblack;,c127000127,cblack;,c000000127,cblack;,c127000127,cblack;,c000000127,cblack;,c127000127,cblack;,,cblack;,c000000125,cblack;,c000000125,cblack;,c125000125,cblack;,,cblack;,c000000125,cblack;,c000000125,cblack;,c125000125,cblack;,!!' readStream nextChunkText!
tim Rowledge uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-tpr.1411.mcz
==================== Summary ====================
Name: System-tpr.1411
Author: tpr
Time: 8 April 2023, 12:40:44.232921 pm
UUID: ce793344-787e-4e47-9823-c49991f1e8c2
Ancestors: System-eem.1410
Bring in Stephane Rollandin's fix for SmartRefStream loading; it solves the .morph loading issue raised by https://lists.squeakfoundation.org/archives/list/squeak-dev@lists.squeakfou…
=============== Diff against System-eem.1410 ===============
Item was changed:
----- Method: SmartRefStream>>next (in category 'read write') -----
next
"Really write three objects: (version, class structure, object). But only when called from the outside. "
| version ss object |
^ topCall == nil
ifTrue:
[topCall := #marked.
version := super next.
version class == SmallInteger ifFalse: [^ version].
"version number, else just a regular object, not in our format, "
self checkCrLf.
ss := super next.
ss class == Array ifFalse: [^ ss]. "just a regular object"
(ss at: 1) = 'class structure' ifFalse: [^ ss].
+ structures := (ss at: 2) rehash.
- structures := ss at: 2.
superclasses := (ss size > 3 and: [(ss at: 3) = 'superclasses'])
+ ifTrue: [(ss at: 4) rehash] "class name -> superclass name"
- ifTrue: [ss at: 4] "class name -> superclass name"
ifFalse: [Dictionary new].
(self verifyStructure = 'conversion method needed') ifTrue: [^ nil].
+ object := super next rehash. "all the action here"
- object := super next. "all the action here"
self restoreClassInstVars. "for UniClasses. version 4"
topCall := nil. "reset it"
object]
ifFalse:
+ [super next rehash]
- [super next]
!