GemTalk / Rowan

a new project/package manager for Smalltalk that supports FileTree and Tonel repositories, and is independent of Monticello and Metacello
MIT License
14 stars 7 forks source link

(v3) RwProject>>reload should use #loadedLoadSpecifications as starting point to ENSURE that loaded project specifications are honored correctly #926

Closed dalehenrich closed 6 months ago

dalehenrich commented 6 months ago

The implementation of reload should use the loadedLoadSpecificaions/read:/load sequence:

bosch:RowanV3>git diff
diff --git a/upgrade/projectsHome/RowanUpgrade/rowan/src/RowanUpgrade-Core/UpgradeRowanV2.class.st b/upgrade/projectsHome/RowanUpgrade/rowan/src/RowanUpgrade-Core/UpgradeRowanV2.class.st
index 29f796a2b..dd6e35212 100644
--- a/upgrade/projectsHome/RowanUpgrade/rowan/src/RowanUpgrade-Core/UpgradeRowanV2.class.st
+++ b/upgrade/projectsHome/RowanUpgrade/rowan/src/RowanUpgrade-Core/UpgradeRowanV2.class.st
@@ -561,7 +561,7 @@ UpgradeRowanV2 >> reloadGemstoneBase [

 { #category : 'upgrade rowan' }
 UpgradeRowanV2 >> reloadRowan [
-       | project platformConditionalAttributes theProjectSet |
+       | project platformConditionalAttributes loadSpecSet projectDefinitionSet |
        self adoptRowan.
        project := Rowan projectNamed: 'Rowan'.
        platformConditionalAttributes := project platformConditionalAttributes
@@ -570,10 +570,9 @@ UpgradeRowanV2 >> reloadRowan [
                        (attribute isKindOf: RwGemStoneVersionNumber)
                                ifTrue: [ (System gemVersionReport at: 'gsVersion') asRwGemStoneVersionNumber ]
                                ifFalse: [ attribute ] ].
-       theProjectSet := project defined
-               readProjectSet: project customConditionalAttributes
-               platformConditionalAttributes: platformConditionalAttributes.
-       [ Rowan projectTools load loadProjectSetDefinition: theProjectSet ]
+      loadSpecSet := project loadedLoadSpecifications.
+       projectDefinitionSet := loadSpecSet read: platformConditionalAttributes.
+       [ projectDefinitionSet load ]
                on: CompileWarning
                do: [ :ex | ex resume ]
 ]
dalehenrich commented 6 months ago

Slight change in semantics of reload is required (not reading specs from disk) for the most common case of picking up changes from a new commit ...

Picking up specification changes from disk is way too complicated to do automatically, because we do not know what choices the developer made during the initial load (mainly involving changes to projectHomes, but custom attribute changes count as well), so the best solution is to remove the project(s) from the image and repeat the initial load expression or to replace loaded load specs with new copies read from disk or ....)

dalehenrich commented 6 months ago

battery tests passing for 3.7.2 and 0a0a7f1