[Vm-dev] VM Maker: CMakeVMMakerSqueak-tty.94.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Nov 28 17:32:11 UTC 2014


Timothy M uploaded a new version of CMakeVMMakerSqueak to project VM Maker:
http://source.squeak.org/VMMaker/CMakeVMMakerSqueak-tty.94.mcz

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

Name: CMakeVMMakerSqueak-tty.94
Author: tty
Time: 28 November 2014, 12:09:39.31 pm
UUID: 4fc8b656-4331-43c3-957d-0a89e066e187
Ancestors: CMakeVMMakerSqueak-tty.93

Modified startHere help.
made isAbstractBaseClass true and must be over-ridden

=============== Diff against CMakeVMMakerSqueak-tty.93 ===============

Item was changed:
  CMakeVMMakerSqueakHelp subclass: #CMakeVMMakerSqueakStartHereHelp
  	instanceVariableNames: ''
  	classVariableNames: ''
  	poolDictionaries: ''
  	category: 'CMakeVMMakerSqueak-Help'!
+ 
+ !CMakeVMMakerSqueakStartHereHelp commentStamp: 'tty 11/28/2014 10:27' prior: 0!
+ A CMakeVMMakerSqueakStartHereHelp provides examples of usage for newbies.
+ 
+ 
+ !

Item was changed:
  ----- Method: CMakeVMMakerSqueakStartHereHelp class>>bookName (in category 'accessing') -----
  bookName
+ 	^'Start Here'!
- 	^'CMakeVMMaker Start Here'!

Item was changed:
  ----- Method: CMakeVMMakerSqueakStartHereHelp class>>shortVersionLinuxBuild (in category 'pages') -----
  shortVersionLinuxBuild
  	^HelpTopic
  		title: 'Short  Version Linux Build'
  		contents:
+ '1. ---Query the Builder for available configurations and build types---
+ SqueakLinux32x86Builder configurationsCategory.
+ SqueakLinux32x86Builder availableBuildConfigurations.
+ SqueakLinux32x86Builder availableBuildTypesFor:(SqueakLinux32x86Builder availableBuildConfigurations at:1). "Replace at:1 as neccessary"
- 'These steps will familiarize you with the CMakeVMMaker system from a user perspective. At the end of this Help Topic you should have a working system for Linux.
- Each step is an action followed by an explanation of what you are looking at.
  
- 1. (SqueakLinux64x86w32CompatBuilder default) browseHierarchy
  
+ 2.---Direct the Builder to invoke a Configuration for a specific build type---
+ SqueakLinux32x86Builder
+ 	configureA: #Linux32x86SqueakCogV3Config forBuildType:#build;   
+ 	enableMessageTracking: false;
+ 	generateByTemplate.
-     CMakeVmMakerSqueak uses Builders to build builds. 
-     The author''s system is a 64 bit architecture with 32 bit compatability libraries installed, so he uses the SqueakLinux64x86w32CompatBuilder.
-      Builder.
  
+ 3.---Direct the Builder to ask the configuration for where it puts its build files---
+ SqueakLinux32x86Builder buildDirectory 
- 2. (SqueakLinux64x86w32CompatBuilder default) browse	
-     The Classes in the CMakeVMMakerSqueak-Builder Class Category are named with the convention "Squeak[Operating System][Architecture][Miscelaneous]Builder".
-       
-      If you are compiling on a pure 32 bit linux box, use the  (SqueakLinux32x86Builder default)    builder
-     
-       A pure 64 bit linux build would require the (SqueakLinux32x86_64Builder default)  builder.
-        
-      The same convention holds for other operating systems (mac, windows, etc) 
  
+ 4.---Open an X-terminal and cd to the above directory and kick off the cmake-build---
+ cd (some directory)/Contents/Resources/oscogvm/cmake.build.linux32.x86/squeak.cog.v3/build/
+ ./build.sh
- 2.  (SqueakLinux64x86w32CompatBuilder default) configurationsCategory  inspect
  
+ 5.---view your build---
+ cd (some directory)/Contents/Resources/oscogvm/products/(FIX ME TTY)
-      In CmakeVMMakerSqueak, Builders utilize "Configurations" to generate "builds".
-      Configurations are classes and are stored in specific class categories .
-      Open a browser and look in the "CMakeVMMakerSqueak-Linux64X86-32BitCompatibility" category and you will see the Configuration classes available for that builder.
- 
-       
-      
- 3. (SqueakLinux64x86w32CompatBuilder default) allAvailableBuildTypes
- 
- 
- do c
- 
  '!

Item was changed:
  ----- Method: CMakeVMPlugin>>initialize (in category 'initialize-release') -----
  initialize
+ "force CPlatformConfigurations to set my internal state explicitly by filling me with initial nonsense values. 
+  If you see these in your CMakeLists.txt, then your configuration needs to replace them"
- "force CPlatformConfigurations to set my internal state explicitly by filling me with initial nonsense values"
  	sources := OrderedCollection with: 'sources' with: 'paths'.
  	compilerdefinitions := OrderedCollection with:'-DCompiler' with: '-DDefinitions'.
  	compilerflags := OrderedCollection with:'-compiler' with: '-flags'.
  	externallibraries := OrderedCollection with:'cxternal'with:'library'.
  	linkerflags := OrderedCollection with:'linker' with:'flags'.
  	includedirectories := OrderedCollection with:'include' with:'directories'.!

Item was changed:
  CPlatformConfig subclass: #CPlatformConfigForSqueak
  	instanceVariableNames: 'buildType generateBuild generateBuildAssert generateBuildAssertITimerHeartbeat generateBuildDebug generateBuildDebugITimerHeartbeat generateBuildDebugMultiThreaded generateBuildIHeartbeatTimer generateBuildMultiThreaded generateBuildMultiThreadedAssert generateBuildMultiThreadedDebug templates enabledebugmessages vmplugins'
  	classVariableNames: ''
  	poolDictionaries: ''
  	category: 'CMakeVMMakerSqueak'!
  CPlatformConfigForSqueak class
  	instanceVariableNames: 'isAbstractBaseClass'!
  
+ !CPlatformConfigForSqueak commentStamp: 'tty 11/28/2014 12:08' prior: 0!
- !CPlatformConfigForSqueak commentStamp: 'tty 6/23/2014 17:02' prior: 0!
  A CPlatformConfigForSqueak acts as a compatability layer for Squeak and an Abstract Base Class for extended functionality required for the Squeak CMakeVMMaker use-case.
  
  I make (very) heavy use of a specific design pattern for configuring myself and remaining compatible with pharo's CMakeVMMaker.
  The entry point for that pattern is my method 'configureForBuildType: aSymbol' . Each method send in there detects my buildType and routes the send
  to the approriate method for that buildType.
  
  Subclasses of me 'must' configure themselves for each build type per that pattern. 
  However this can be very easy by just returning the base configuration.
  
  Tests are written to verify that this support infrastructure is in place.
  
+ I have two important methods.
- I have two important variables.
  
  excludeFromBuild and isAbstractBaseClass.
  
  excludeFromBuild 
  		is used to exclude a configuration from being built by a Builder.
  		is used to exclude a configuration from Testing.
  
  isAbstractBaseClass 
+ 		is used by configurations that exclude themselves from being built by a Builder BUT need to be included in 		Testing.
- 		is a class instance variable used by configurations that exclude themselves from being built by a Builder BUT need to be included in 		Testing.
  
  										
  excludeFromBuild  | isAbstractBaseClass  | should build  | should test
  	T					    T                            NO                  YES
        T					    F                             NO                   NO
        F					    T                            YES                  YES
        F                                 F                            YES                  YES
  
  
  The use-case is as follows.
  
  An abstract base class contains a lot of functionality that must be implemented and tested for the system to work, but it is not meant to be compiled.
  
  concrete classes of that AbstractBase class can exclude themselves from being built by builders and by doing so are not tested.
  However, once a concrete configuration is enabled to be built, it must pass all tests.
  
  Linux32x86Config is an example of an AbstractBase class that must pass all testing, but is not buildable.
  Its subclass Linux32x86SqueakCogV3Config needs testing, but a developer can toggle 'exclude from build' to hide it from Builders or make it available to them.
  
  Tests make the decision on what configurations to test. Here are some examples.
  	(o excludeFromBuild not) & (configuration isAbstractBaseClass not)  this is a concrete [Lang][VM][MemoryManager][etc] configuration that will be built. No platform classes considered
  	(o excludeFromBuild) & (configuration isAbstractBaseClass not)         This is a concrete [Lang][VM][MemoryManager][etc] configuration that will be NOT built.
  	(o excludeFromBuild not) | (configuration isAbstractBaseClass)          concrete implementation may depend on its [OS][VMWordSize][Processor] AbstractBaseClass for platform level methods. 
  																		   example: Linux32x86Config ccBuild has the '-m32' compiler flag that is common to all builds on that platform
  	(o excludeFromBuild not) & (configuration isAbstractBaseClass)       Not allowed. [OS][VMWordSize][Processor] AbstractBaseClasses should not be built. This is a useful test in its own right.
  	(o excludeFromBuild) & (configuration isAbstractBaseClass)             These are the AbstractBaseClasses. An AbstractBaseClass should always be excluded from a build
  
  tty.!
  CPlatformConfigForSqueak class
  	instanceVariableNames: 'isAbstractBaseClass'!

Item was changed:
  ----- Method: CPlatformConfigForSqueak class>>isAbstractBaseClass (in category 'as yet unclassified') -----
  isAbstractBaseClass
+ 	^true
- 	^isAbstractBaseClass ifNil:[false] ifNotNil:[isAbstractBaseClass]
  !

Item was removed:
- ----- Method: CPlatformConfigForSqueak class>>isAbstractBaseClass: (in category 'as yet unclassified') -----
- isAbstractBaseClass: aBoolean
- 	isAbstractBaseClass := aBoolean
- !

Item was added:
+ ----- Method: Linux64x86w32BitSqueakCogV3Config class>>isAbstractBaseClass (in category 'as yet unclassified') -----
+ isAbstractBaseClass
+ 	^false
+ !

Item was changed:
  ----- Method: SqueakCMakeVMMakerAbstractBuilder>>availableBuildConfigurationsFor: (in category 'queries') -----
  availableBuildConfigurationsFor: aCategoryName
  	"answer the CMakeVMakerSqueak configurations in a Smalltalk category that havenot excluded themselves from being built."
  
  "	(((self configurationDictionary:aCategoryName) keys asSortedCollection) size = 0)      
  		ifTrue:[^((self configurationDictionary:aCategoryName) keys asSortedCollection) sort]."
       ^(((self configurationDictionary:aCategoryName) select: [:info| info value excludeFromBuild not ]) keys asSortedCollection) sort
  
  !

Item was changed:
  ----- Method: SqueakCMakeVMMakerAbstractBuilder>>configurationDictionary: (in category 'queries') -----
  configurationDictionary: aCategoryName
  	| result info|
  	"return a Dictionary of CMakeMakerSqueak-XYZ platform configurations and their associated CMakeVMakerConfigurationInfo "
  	result := Dictionary new.
  	Smalltalk globals 
+ 		allClassesDo:[:c | (c class category asString withoutQuoting = aCategoryName)  "is there a faster lookup method?"
- 		allClassesDo:[:c | (c class category asString withoutQuoting = aCategoryName)    "is there a faster lookup method?"
  			ifTrue: [ 
+ 					(c isAbstractBaseClass)
+ 						ifFalse:[
+ 							info := CMakeVMakerConfigurationInfo new.
+ 							info visit: c.
+ 							result at: (c name) put:info]]].
- 					info := CMakeVMakerConfigurationInfo new.
- 					info visit: c.
- 					result at: (c name) put:info]].
  	^result
  
  !



More information about the Vm-dev mailing list