[Pkg] Sake : Sake-Core-kph.106.mcz

squeak-dev-noreply at lists.squeakfoundation.org squeak-dev-noreply at lists.squeakfoundation.org
Sun Mar 8 22:54:59 UTC 2009


A new version of Sake-Core was added to project Sake :
http://www.squeaksource.com/Sake/Sake-Core-kph.106.mcz

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

Name: Sake-Core-kph.106
Author: kph
Time: 8 March 2009, 10:54:52 pm
UUID: 23a88dc2-0c34-11de-987b-000a95edb42a
Ancestors: Sake-Core-kph.105

- removed packages tasks, added them as normal code to MC
+ SakeBlock new handling of blocked tasks!

=============== Diff against Sake-Core-kph.105 ===============

Item was changed:
  ----- Method: SakeTask>>sort (in category 'as yet unclassified') -----
  sort
  
+ 	"if your top level is simply a collection of tasks we presort them"
- 	"if your top level is a collection of tasks we presort them"
  		
  	actionBlock ifNotNil: [ self error: 'no need to presort' ].
  
+ 	self dependsOn: self allPriorTasksInOrder.
- 	actionBlock := self allPriorTasksInOrder.
- 
- 	priors := nil.
  	
+ 	^ self
+ 	
+ !
- 	^ self!

Item was added:
+ ----- Method: SakeBlock class>>signalTask: (in category 'as yet unclassified') -----
+ signalTask: aTask
+ 
+ 	^ self new
+ 		 tag: aTask;
+ 		 signal!

Item was added:
+ ----- Method: SakeBlock>>task (in category 'as yet unclassified') -----
+ task
+ 	
+ 	^ tag!

Item was changed:
  ----- Method: SakeTask>>privateRun: (in category 'as yet unclassified') -----
  privateRun: setOfTasks
  
+ 	| priorTasks blocked wasBlocked |
+ 	
   	"this is the way that Rake orders tasks"
  	
  	"we ensure that we obtain the task to run from the overall set of tasks"
- 	| priorTasks |
  	
  	self hasRun ifTrue: [ ^ result ].
  		
+ 	priorTasks := self dependsOn collect: [ :prior | setOfTasks like: (self taskFrom: prior) ] thenSelect: [ :ea | ea notNil ].
+ 
+ 	"anyting it runs that is blocked is added to the block set, anything that suceeds is removed form the blocked set.
+ 	at the end, we shall have a list of blocked tasks that can be retried, if that list is the same as the list that was blocked
+ 	before stop and complain"
- 	priorTasks := self dependsOn collect: [ :prior | setOfTasks like: (self taskFrom: prior) ].
  	
+ 	blocked := Set new.	
+ 
+ 	[		
+ 		wasBlocked := blocked copy.
+ 
+ 		priorTasks do: [ :each | 
+ 			each runLevel: runLevel. 
+ 			[ 
+ 				each privateRun: setOfTasks.
+ 				blocked remove: each ifAbsent: [ ].
+ 			] on: SakeBlock do: [ :ex | blocked add: ex task ].
+ 		].
+ 
+ 		(blocked notEmpty and: [ blocked = wasBlocked ]) ifTrue: [ SakeBlock signalTask: self ].
+   
+ 	] doWhileFalse: [ blocked isEmpty ].
+ 
- 	priorTasks collect: [ :each | 
- 		each ifNotNil: [ each runLevel: runLevel. 
- 		each privateRun: setOfTasks ]].
  	
  	(self isNeeded: priorTasks) 
  		ifTrue: [ 
  			self trace. 
  			self doAction: priorTasks.
  			hasRun := true.
  			 
  			^ result.
  		].
  	
  	^ false
+  !
- !

Item was added:
+ Warning subclass: #SakeBlock
+ 	instanceVariableNames: ''
+ 	classVariableNames: ''
+ 	poolDictionaries: ''
+ 	category: 'Sake-Core'!
+ 
+ !SakeBlock commentStamp: 'kph 3/6/2009 12:58' prior: 0!
+ Raise this if for some reason you find that the task you are doing is blocked. This might occur in a multi builder build system where two building threads decide to build the same item.
+ 
+ (implementation idea - not implemented yet)
+ 
+ When a Block is detected, Sake, looks for any following dependent task that is not dependant upon the blocked task.
+ 
+ Alternatively, Sake could simply randomise the task order and re-sort them, tryng again.!

Item was removed:
- ----- Method: MCWorkingCopy>>taskSaveWithComment: (in category '*sake-core') -----
- taskSaveWithComment: message
-  
- 	^ (self taskAdoptHistoryFrom: self repository saveWithComment: message) defined
-  !

Item was removed:
- ----- Method: MCWorkingCopy>>taskAdoptHistoryFrom:saveWithComment: (in category '*sake-core') -----
- taskAdoptHistoryFrom: repo saveWithComment: message
-  
- 	"The repo is the one we are maintaining. If there are no changes then adopt the one in the repo as the master"
- 	
- 	| closest |
- 	^ SakeTask define: [ :task |
-  
- 		task if: [ self needsSaving ].
-  				
- 		task action: [ self repositoryGroup addRepository: repo.
- 			self setMyRepositoryFromLastAdded.
- 			closest := self repository closestAncestorVersionFor: ancestry ifNone:[nil].
- 			closest ifNotNil: [ ancestry := MCWorkingAncestry new addAncestor: closest info ].
- 			
- 		(self changesRelativeToRepository: self repository) isEmpty 
- 				ifTrue: [  
- 						 self modified: false.
- 						 ] 
- 				ifFalse: [
- 					message ifNotNil: [  
- 						self repository storeVersion: (self newVersionWithName: self uniqueVersionName message: message)]
- 				] 
- 	  	]
- 	]
-  !



More information about the Packages mailing list