The Trunk: System-dtl.1233.mcz

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

The Trunk: System-dtl.1233.mcz

commits-2
David T. Lewis uploaded a new version of System to project The Trunk:
http://source.squeak.org/trunk/System-dtl.1233.mcz

==================== Summary ====================

Name: System-dtl.1233
Author: dtl
Time: 15 May 2021, 1:25:37.809444 pm
UUID: 660215fe-f151-4184-8a31-8775202baa81
Ancestors: System-nice.1232

Be permissive when filing in Cuis packages. Skip chunks that begin with known extensions that are not meaningful for Squeak, logging to Transcript to show chunks that have been ignored.

=============== Diff against System-nice.1232 ===============

Item was changed:
  ----- Method: PositionableStream>>fileInAnnouncing: (in category '*System-Changes-fileIn/Out') -----
  fileInAnnouncing: announcement
  "This is special for reading expressions from text that has been formatted
  with exclamation delimitors. The expressions are read and passed to the
  Compiler. Answer the result of compilation.  Put up a progress report with
       the given announcement as the title."
 
  | val |
  announcement
  displayProgressFrom: 0
  to: self size
  during:
  [:bar |
  [self atEnd] whileFalse:
  [bar value: self position.
  self skipSeparators.
 
  [ | chunk |
  val := (self peekFor: $!!)
+ ifTrue: [ | ch |
+ ch := self nextChunk.
+ (self shouldIgnore: ch)
+ ifTrue: [Transcript showln: 'Ignoring chunk: ', ch]
+ ifFalse: [(Compiler evaluate: ch logged: true) scanFrom: self]]
- ifTrue: [(Compiler evaluate: self nextChunk logged: true) scanFrom: self]
  ifFalse:
  [chunk := self nextChunk.
  self checkForPreamble: chunk.
  Compiler evaluate: chunk logged: true]]
  on: InMidstOfFileinNotification
  do: [:ex | ex resume: true].
  self skipStyleChunk].
  self close].
  "Note:  The main purpose of this banner is to flush the changes file."
  Smalltalk logChange: '----End fileIn of ' , self name , '----'.
  self flag: #ThisMethodShouldNotBeThere. "sd"
  ^val!

Item was added:
+ ----- Method: PositionableStream>>shouldIgnore: (in category '*System-Changes-fileIn/Out') -----
+ shouldIgnore: chunk
+ "Fileouts created on another Smalltalk may contain chunks that are
+ not meaningful for Squeak. Answer true if chunk should be ignored."
+
+ ^ ((chunk beginsWith: 'provides:') "Cuis Smalltalk extensions"
+ or: [chunk beginsWith: 'requires:'])
+ or: [chunk beginsWith: 'classDefinition:']
+ !


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: System-dtl.1233.mcz

Chris Muller-3
Does this mean that installation of software can now fail silently in
the 100% normal case, e.g., with no Error signaled?  (sorry, a line
that scrolled out of the Transcript after 100ms is not an adequate
warning at all).

Installing Cuis code is typically a "one time thing" for a port of
some app, here or there, and someone would simply hack your change in
temporarily.  I don't understand why you feel this should be a regular
part of trunk.  Making things less-strict willy-nilly invites future
issues...


On Sat, May 15, 2021 at 12:25 PM <[hidden email]> wrote:

>
> David T. Lewis uploaded a new version of System to project The Trunk:
> http://source.squeak.org/trunk/System-dtl.1233.mcz
>
> ==================== Summary ====================
>
> Name: System-dtl.1233
> Author: dtl
> Time: 15 May 2021, 1:25:37.809444 pm
> UUID: 660215fe-f151-4184-8a31-8775202baa81
> Ancestors: System-nice.1232
>
> Be permissive when filing in Cuis packages. Skip chunks that begin with known extensions that are not meaningful for Squeak, logging to Transcript to show chunks that have been ignored.
>
> =============== Diff against System-nice.1232 ===============
>
> Item was changed:
>   ----- Method: PositionableStream>>fileInAnnouncing: (in category '*System-Changes-fileIn/Out') -----
>   fileInAnnouncing: announcement
>         "This is special for reading expressions from text that has been formatted
>         with exclamation delimitors. The expressions are read and passed to the
>         Compiler. Answer the result of compilation.  Put up a progress report with
>        the given announcement as the title."
>
>         | val |
>         announcement
>                 displayProgressFrom: 0
>                 to: self size
>                 during:
>                         [:bar |
>                         [self atEnd] whileFalse:
>                                         [bar value: self position.
>                                         self skipSeparators.
>
>                                         [ | chunk |
>                                         val := (self peekFor: $!!)
> +                                                               ifTrue: [ | ch |
> +                                                                       ch := self nextChunk.
> +                                                                       (self shouldIgnore: ch)
> +                                                                               ifTrue: [Transcript showln: 'Ignoring chunk: ', ch]
> +                                                                               ifFalse: [(Compiler evaluate: ch logged: true) scanFrom: self]]
> -                                                               ifTrue: [(Compiler evaluate: self nextChunk logged: true) scanFrom: self]
>                                                                 ifFalse:
>                                                                         [chunk := self nextChunk.
>                                                                         self checkForPreamble: chunk.
>                                                                         Compiler evaluate: chunk logged: true]]
>                                                         on: InMidstOfFileinNotification
>                                                         do: [:ex | ex resume: true].
>                                         self skipStyleChunk].
>                         self close].
>         "Note:  The main purpose of this banner is to flush the changes file."
>         Smalltalk logChange: '----End fileIn of ' , self name , '----'.
>         self flag: #ThisMethodShouldNotBeThere. "sd"
>         ^val!
>
> Item was added:
> + ----- Method: PositionableStream>>shouldIgnore: (in category '*System-Changes-fileIn/Out') -----
> + shouldIgnore: chunk
> +       "Fileouts created on another Smalltalk may contain chunks that are
> +       not meaningful for Squeak. Answer true if chunk should be ignored."
> +
> +       ^ ((chunk beginsWith: 'provides:') "Cuis Smalltalk extensions"
> +               or: [chunk beginsWith: 'requires:'])
> +                       or: [chunk beginsWith: 'classDefinition:']
> + !
>
>

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: System-dtl.1233.mcz

David T. Lewis
On Mon, May 17, 2021 at 04:13:09PM -0500, Chris Muller wrote:
> Does this mean that installation of software can now fail silently in
> the 100% normal case, e.g., with no Error signaled?  (sorry, a line
> that scrolled out of the Transcript after 100ms is not an adequate
> warning at all).
>

No, that is not what it means. It means that the installation should
succeed gracefully, rather than failing unnecessarily.


> Installing Cuis code is typically a "one time thing" for a port of
> some app, here or there, and someone would simply hack your change in
> temporarily.  I don't understand why you feel this should be a regular
> part of trunk.  Making things less-strict willy-nilly invites future
> issues...
>

No, it does not invite future issues. See the PositionableStream>>shouldIgnore:
method comment:

  Fileouts created on another Smalltalk may contain chunks that are
  not meaningful for Squeak. Answer true if chunk should be ignored.

And as explained in the commit comment:

  Skip chunks that begin with known extensions that are not meaningful
  for Squeak, logging to Transcript to show chunks that have been ignored.

With respect to the Cuis reference, my use case was installing
VectorEnginePlugin in Squeak. The upstream repository for this plugin
is on GitHub, which stores the portable Smalltalk code in chunk format
with some Cuis extensions:

  https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev/blob/master/Packages/Features/VectorEnginePlugin.pck.st

The plugin code is well-written and portable for at least Squeak and Cuis.
The Cuis-specific chunks are not relevant to Squeak, so they can and
should be ignored when filing in to Squeak.
 
Dave


>
> On Sat, May 15, 2021 at 12:25 PM <[hidden email]> wrote:
> >
> > David T. Lewis uploaded a new version of System to project The Trunk:
> > http://source.squeak.org/trunk/System-dtl.1233.mcz
> >
> > ==================== Summary ====================
> >
> > Name: System-dtl.1233
> > Author: dtl
> > Time: 15 May 2021, 1:25:37.809444 pm
> > UUID: 660215fe-f151-4184-8a31-8775202baa81
> > Ancestors: System-nice.1232
> >
> > Be permissive when filing in Cuis packages. Skip chunks that begin with known extensions that are not meaningful for Squeak, logging to Transcript to show chunks that have been ignored.
> >
> > =============== Diff against System-nice.1232 ===============
> >
> > Item was changed:
> >   ----- Method: PositionableStream>>fileInAnnouncing: (in category '*System-Changes-fileIn/Out') -----
> >   fileInAnnouncing: announcement
> >         "This is special for reading expressions from text that has been formatted
> >         with exclamation delimitors. The expressions are read and passed to the
> >         Compiler. Answer the result of compilation.  Put up a progress report with
> >        the given announcement as the title."
> >
> >         | val |
> >         announcement
> >                 displayProgressFrom: 0
> >                 to: self size
> >                 during:
> >                         [:bar |
> >                         [self atEnd] whileFalse:
> >                                         [bar value: self position.
> >                                         self skipSeparators.
> >
> >                                         [ | chunk |
> >                                         val := (self peekFor: $!!)
> > +                                                               ifTrue: [ | ch |
> > +                                                                       ch := self nextChunk.
> > +                                                                       (self shouldIgnore: ch)
> > +                                                                               ifTrue: [Transcript showln: 'Ignoring chunk: ', ch]
> > +                                                                               ifFalse: [(Compiler evaluate: ch logged: true) scanFrom: self]]
> > -                                                               ifTrue: [(Compiler evaluate: self nextChunk logged: true) scanFrom: self]
> >                                                                 ifFalse:
> >                                                                         [chunk := self nextChunk.
> >                                                                         self checkForPreamble: chunk.
> >                                                                         Compiler evaluate: chunk logged: true]]
> >                                                         on: InMidstOfFileinNotification
> >                                                         do: [:ex | ex resume: true].
> >                                         self skipStyleChunk].
> >                         self close].
> >         "Note:  The main purpose of this banner is to flush the changes file."
> >         Smalltalk logChange: '----End fileIn of ' , self name , '----'.
> >         self flag: #ThisMethodShouldNotBeThere. "sd"
> >         ^val!
> >
> > + ----- Method: PositionableStream>>shouldIgnore: (in category '*System-Changes-fileIn/Out') -----
> > + shouldIgnore: chunk
> > +       "Fileouts created on another Smalltalk may contain chunks that are
> > +       not meaningful for Squeak. Answer true if chunk should be ignored."
> > +
> > +       ^ ((chunk beginsWith: 'provides:') "Cuis Smalltalk extensions"
> > +               or: [chunk beginsWith: 'requires:'])
> > +                       or: [chunk beginsWith: 'classDefinition:']
> > + !
> >
> >
>
> > Item was added:

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: System-dtl.1233.mcz

Chris Muller-4
And as explained in the commit comment:

  Skip chunks that begin with known extensions that are not meaningful
  for Squeak, logging to Transcript to show chunks that have been ignored.

Magma implements a method called #classDefinition:.  I wanted to make sure this wouldn't cause it to get skipped.  My test of filing out a single method and also the whole class, seemed to work okay.
 
With respect to the Cuis reference, my use case was installing
VectorEnginePlugin in Squeak. The upstream repository for this plugin
is on GitHub, which stores the portable Smalltalk code in chunk format
with some Cuis extensions:

  https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev/blob/master/Packages/Features/VectorEnginePlugin.pck.st

The plugin code is well-written and portable for at least Squeak and Cuis.
The Cuis-specific chunks are not relevant to Squeak, so they can and
should be ignored when filing in to Squeak.

Does this mean we can generally load Cuis code into Squeak now?  That almost seems [ANN]-worthy.   :)

 - Chris


Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: System-dtl.1233.mcz

Nicolas Cellier
Ah, here are some related hack for ChangeList

https://source.squeak.org/trunk/Tools-nice.725.diff

Does this Cuis change file opens correctly in a Change List, or do we
have to unify efforts?

Le mer. 19 mai 2021 à 04:22, Chris Muller <[hidden email]> a écrit :

>>
>> And as explained in the commit comment:
>>
>>   Skip chunks that begin with known extensions that are not meaningful
>>   for Squeak, logging to Transcript to show chunks that have been ignored.
>
>
> Magma implements a method called #classDefinition:.  I wanted to make sure this wouldn't cause it to get skipped.  My test of filing out a single method and also the whole class, seemed to work okay.
>
>>
>> With respect to the Cuis reference, my use case was installing
>> VectorEnginePlugin in Squeak. The upstream repository for this plugin
>> is on GitHub, which stores the portable Smalltalk code in chunk format
>> with some Cuis extensions:
>>
>>   https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev/blob/master/Packages/Features/VectorEnginePlugin.pck.st
>>
>> The plugin code is well-written and portable for at least Squeak and Cuis.
>> The Cuis-specific chunks are not relevant to Squeak, so they can and
>> should be ignored when filing in to Squeak.
>
>
> Does this mean we can generally load Cuis code into Squeak now?  That almost seems [ANN]-worthy.   :)
>
>  - Chris
>

Reply | Threaded
Open this post in threaded view
|

Re: The Trunk: System-dtl.1233.mcz

David T. Lewis
On Wed, May 19, 2021 at 09:38:45AM +0200, Nicolas Cellier wrote:
> Ah, here are some related hack for ChangeList
>
> https://source.squeak.org/trunk/Tools-nice.725.diff
>

Thanks I had not noticed that.

> Does this Cuis change file opens correctly in a Change List, or do we
> have to unify efforts?
>

I am not sure, but I will try to look at it soon. I just did the minimal
change to support loading a pck file without error.

It is good to support Cuis, we are all part of the Squeak family :-)

Dave


> Le mer. 19 mai 2021 ?? 04:22, Chris Muller <[hidden email]> a ??crit :
> >>
> >> And as explained in the commit comment:
> >>
> >>   Skip chunks that begin with known extensions that are not meaningful
> >>   for Squeak, logging to Transcript to show chunks that have been ignored.
> >
> >
> > Magma implements a method called #classDefinition:.  I wanted to make sure this wouldn't cause it to get skipped.  My test of filing out a single method and also the whole class, seemed to work okay.
> >
> >>
> >> With respect to the Cuis reference, my use case was installing
> >> VectorEnginePlugin in Squeak. The upstream repository for this plugin
> >> is on GitHub, which stores the portable Smalltalk code in chunk format
> >> with some Cuis extensions:
> >>
> >>   https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev/blob/master/Packages/Features/VectorEnginePlugin.pck.st
> >>
> >> The plugin code is well-written and portable for at least Squeak and Cuis.
> >> The Cuis-specific chunks are not relevant to Squeak, so they can and
> >> should be ignored when filing in to Squeak.
> >
> >
> > Does this mean we can generally load Cuis code into Squeak now?  That almost seems [ANN]-worthy.   :)
> >
> >  - Chris
> >
>