[squeak-dev] The Trunk: Monticello-ct.715.mcz

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Thu Apr 9 22:33:51 UTC 2020


Hi Jakob,


Thanks for the report - and I'm sorry to hear that I broke this!


The motivation for the deferred list was that #addToOrder: (and so the constructor #items:) actually does not sort the added items, but only their dependencies. That's why you need to send #addDeferred to the sorter after adding all other items. Before now, I did not realize that #orderedItems has external users.


So there are two options:

1. Permanently change the public protocol of the dependency sorter - if you want to get all items, you need to send #addDeferred ti the sorter before retrieving the #orderedItems. In the Trunk, we would need to update four senders in three classes for this solution.

2. Change #orderedItems to lazily append the deferred items to the returned list. This is not ideal as it makes the getter more expensive, but on the other hand, we can preserve compatibility by doing so.


I'm open for your opinion on both approaches, or for any other idea! :-)


Best,

Christoph

________________________________
Von: Jakob Reschke <forums.jakob at resfarm.de>
Gesendet: Freitag, 10. April 2020 00:03:47
An: Thiede, Christoph; squeak-dev at lists.squeakfoundation.org
Betreff: Re: [squeak-dev] The Trunk: Monticello-ct.715.mcz

Forgot to mention the net result of the issue: the postscripts gets
effectively removed in the saved version.

Am Fr., 10. Apr. 2020 um 00:02 Uhr schrieb Jakob Reschke
<forums.jakob at resfarm.de>:
>
> It looks like this broke the writing of postscripts in FileTree repositories.
>
> MCFileTreePackageStructureStWriter>>acceptVisitor:forDefinitions:
> (MCDependencySorter sortItems: aCollection) does not include an
> MCPostscriptDefinition that is still present in aCollection.
>
> MCDependencySorter class>>sortItems:
> The sorter includes the MCPostscriptDefinition in the new deferred
> list, but not in the orderedItems. Therefore it is not included in the
> result of sortItems:, because it only returns the orderedItems, not
> the deferred ones.
>
> Christoph, can and must sortItems: be fixed or a different method?
>
>
> Am Do., 5. März 2020 um 21:05 Uhr schrieb <commits at source.squeak.org>:
> >
> > Nicolas Cellier uploaded a new version of Monticello to project The Trunk:
> > http://source.squeak.org/trunk/Monticello-ct.715.mcz
> >
> > ==================== Summary ====================
> >
> > Name: Monticello-ct.715
> > Author: ct
> > Time: 6 February 2020, 6:58:26.533648 pm
> > UUID: 199bf8a3-5eee-1045-a44b-89ad30fa5523
> > Ancestors: Monticello-cmm.708
> >
> > Fixes wrong load and unload order of MCScriptDefinitions
> >
> > See http://forum.world.st/Monticello-Bug-Preamble-of-removal-is-executed-too-late-tp5108401.html. Regression tests are in Tests-ct.426.
> >
> > Please review!
> >
> > =============== Diff against Monticello-cmm.708 ===============
> >
> > Item was added:
> > + ----- Method: MCDefinition>>wantsToBeOutermost (in category 'testing') -----
> > + wantsToBeOutermost
> > +
> > +       ^ false!
> >
> > Item was changed:
> >   Object subclass: #MCDependencySorter
> > +       instanceVariableNames: 'required provided deferred orderedItems'
> > -       instanceVariableNames: 'required provided orderedItems'
> >         classVariableNames: ''
> >         poolDictionaries: ''
> >         category: 'Monticello-Loading'!
> >
> > Item was changed:
> >   ----- Method: MCDependencySorter>>add: (in category 'building') -----
> >   add: anItem
> >         | requirements |
> > +       (anItem wantsToBeOutermost)
> > +               ifTrue: [^self addDeferred: anItem].
> >         requirements := self unresolvedRequirementsFor: anItem.
> >         requirements isEmpty
> >                 ifTrue: [self addToOrder: anItem]
> >                 ifFalse: [self addRequirements: requirements for: anItem].
> >         ^anItem!
> >
> > Item was added:
> > + ----- Method: MCDependencySorter>>addDeferred (in category 'building') -----
> > + addDeferred
> > +       deferred do: [:ea |
> > +               self addToOrder: ea].!
> >
> > Item was added:
> > + ----- Method: MCDependencySorter>>addDeferred: (in category 'private') -----
> > + addDeferred: anItem
> > +       ^ deferred add: anItem!
> >
> > Item was changed:
> >   ----- Method: MCDependencySorter>>initialize (in category 'initialize-release') -----
> >   initialize
> >         provided := Set new.
> >         required := Dictionary new.
> > +       orderedItems := OrderedCollection new.
> > +       deferred := OrderedCollection new.!
> > -       orderedItems := OrderedCollection new.!
> >
> > Item was changed:
> >   ----- Method: MCPackageLoader>>sorterForItems: (in category 'private') -----
> >   sorterForItems: aCollection
> >         | sorter |
> >         sorter := MCDependencySorter items: aCollection.
> >         sorter addExternalProvisions: self provisions.
> > +       sorter addDeferred.
> >         ^ sorter!
> >
> > Item was added:
> > + ----- Method: MCPostscriptDefinition>>wantsToBeOutermost (in category 'nil') -----
> > + wantsToBeOutermost
> > +
> > +       ^ true!
> >
> > Item was added:
> > + ----- Method: MCRemovalPreambleDefinition>>wantsToBeOutermost (in category 'testing') -----
> > + wantsToBeOutermost
> > +
> > +       ^ true!
> >
> >
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20200409/9c39efb1/attachment.html>


More information about the Squeak-dev mailing list