Metacello / metacello

Metacello is a package management system for Smalltalk
MIT License
87 stars 43 forks source link

MetacelloAbstractVersionConstructor>>projectForVersion:copyFrom:with: not correct when applied to a project using MetacelloCypressBaselineProject project class #531

Closed dalehenrich closed 3 years ago

dalehenrich commented 3 years ago

MetacelloAbstractVersionConstructor>>projectForVersion:copyFrom:with: does not create a new project using the baseline's project class ... and it should ...

Interestingly enough, this bugs happens to have been expose when I changed the projectClass for BaselineOfSeaside.

Why this was exposed when I changed the projectClass for BaselineOfSeaside is a good question, but Seaside does happen to use:

spec project: 'Grease Core Tests'
        copyFrom: 'Grease'
        with: [ spec loads: #('Core Tests') ]

and this bug did not appear until I made the change ... More revealed as I dendeavor to fix this bug.

Here's the stack:

UserDefinedError: The project spec 'Grease' in project BaselineOfSeaside3 has incompatible specs. MetacelloMCBaselineOfProjectSpec and Me...
--------------------
1. UserDefinedError(AbstractException)>>_signalWith: @5 line 25
2. UserDefinedError(AbstractException)>>signal @2 line 47
3. MetacelloCypressBaselineProjectSpec(Object)>>error: @6 line 7
4. MetacelloCypressBaselineProjectSpec(MetacelloSpec)>>validateMergeForSpec: @24 line 5
5. MetacelloCypressBaselineProjectSpec(MetacelloSpec)>>mergeSpec: @2 line 3
6. MetacelloCypressBaselineProjectSpec(MetacelloGenericProjectSpec)>>mergeSpec: @2 line 3
7. MetacelloCypressBaselineProjectSpec(MetacelloMCBaselineOfProjectSpec)>>mergeSpec: @3 line 2
8. MetacelloProjectReferenceSpec>>mergeSpec: @12 line 11
9. MetacelloPackagesSpec(MetacelloMemberListSpec)>>mapCopy:into: @17 line 8
10. [] in MetacelloPackagesSpec(MetacelloMemberListSpec)>>map @20 line 9
11. MetacelloCopyMemberSpec>>applyAdd:copy:merge:remove: @2 line 2
12. [] in MetacelloPackagesSpec(MetacelloMemberListSpec)>>map @12 line 8
13. OrderedCollection(Collection)>>do: @5 line 10
14. MetacelloPackagesSpec(MetacelloMemberListSpec)>>map @7 line 6
15. MetacelloPackagesSpec>>packageSpecsInLoadOrderFor: @2 line 5
16. MetacelloMCVersionSpec(MetacelloVersionSpec)>>packageSpecsInLoadOrder @3 line 2
17. MetacelloMCVersionSpec(MetacelloVersionSpec)>>projectDo:packageDo:groupDo: @2 line 3
18. MetacelloMCVersion>>packages @5 line 6
19. MetacelloMCVersion>>packageAndProjectNamesToLoad:loader: @2 line 5
20. MetacelloMCVersion>>defaultPackageNamesToLoad: @3 line 4
21. [] in MetacelloMCVersion>>doLoadRequiredFromArray: @26 line 10
22. ExecBlock0(ExecBlock)>>ensure: @2 line 12
23. MetacelloMCVersion>>doLoadRequiredFromArray: @22 line 16
24. Array(Collection)>>loadRequiredForMetacelloMCVersion: @2 line 3
25. MetacelloMCVersion>>load: @2 line 3
26. [] in MetacelloScriptEngine>>load:onProjectDownGrade:onProjectUpgrade: @18 line 16
27. ExecBlock0(ExecBlock)>>on:do: @3 line 44
28. [] in MetacelloScriptEngine>>handleNotificationsForAction: @20 line 6
29. ExecBlock0(ExecBlock)>>on:do: @3 line 44
30. [] in MetacelloScriptEngine>>handleNotificationsForAction: @12 line 14
31. ExecBlock0(ExecBlock)>>on:do: @3 line 44
32. [] in MetacelloScriptEngine>>handleNotificationsForAction: @6 line 20
33. ExecBlock0(ExecBlock)>>on:do: @3 line 44
34. MetacelloScriptEngine>>handleNotificationsForAction: @2 line 24
35. [] in MetacelloScriptEngine>>load:onProjectDownGrade:onProjectUpgrade: @6 line 5
36. ExecBlock0(ExecBlock)>>ensure: @2 line 12
37. MetacelloProjectRegistration class>>copyRegistryRestoreOnErrorWhile: @8 line 14
38. MetacelloScriptEngine>>load:onProjectDownGrade:onProjectUpgrade: @2 line 3
39. MetacelloScriptEngine>>load: @2 line 3
40. MetacelloScriptEngine(Object)>>perform:withArguments: @1 line 12
41. [] in MetacelloScriptApiExecutor(MetacelloScriptExecutor)>>execute: @40 line 15
42. [] in MetacelloScriptApiExecutor>>executeString:do: @13 line 6
43. Array(Collection)>>do: @5 line 10
44. MetacelloScriptApiExecutor>>executeString:do: @6 line 4
45. String>>execute:against: @2 line 2
46. MetacelloScriptApiExecutor(MetacelloScriptExecutor)>>execute: @6 line 9
47. Metacello>>execute:args: @8 line 5
48. Metacello>>load: @2 line 2
49. [] in TDMetacelloTool>>basicProjectLoadFromSpec: @102 line 47
50. [] in GsDeployer>>deploy: @21 line 8
51. ExecBlock0(ExecBlock)>>on:do: @3 line 44
52. [] in GsDeployer>>deploy: @7 line 9
53. [] in MCPlatformSupport class>>commitOnAlmostOutOfMemoryDuring: @11 line 7
54. ExecBlock0(ExecBlock)>>ensure: @2 line 12
55. MCPlatformSupport class>>commitOnAlmostOutOfMemoryDuring: @6 line 8
56. [] in UndefinedObject(GsDeployer)>>mcPlatformSupportDo: @13 line 11
57. ExecBlock0(ExecBlock)>>ensure: @2 line 12
58. GsDeployer>>mcPlatformSupportDo: @9 line 12
59. GsDeployer>>deploy: @2 line 3
60. GsDeployer class>>bulkMigrate: @5 line 15
61. TDMetacelloTool>>basicProjectLoadFromSpec: @62 line 61
62. TDProjectSpecEntryDefinition>>projectLoadFromSpec:using:registration: @8 line 5
63. TDMetacelloUnloadedProjectRegistrationDefinition(TDMetacelloProjectRegistrationDefinition)>>projectLoadFromSpec:using: @3 line 3
64. TDMetacelloTool>>projectLoadFromSpec:registration: @2 line 2
65. [] in TDMetacelloTool>>projectload @247 line 151
66. Dictionary(AbstractDictionary)>>at:ifPresent:ifAbsent: @3 line 5
67. TDMetacelloTool>>projectload @62 line 148
68. TDMetacelloTool(Object)>>perform: @1 line 8
69. TDMetacelloTool class(TDAbstractDevTool class)>>performSubCommand:objIn:commandOptions:todeCommand: @26 line 23
70. [] in TDMetacelloTool class>>project @5 line 5
71. ExecBlock4(ExecBlock)>>cull:cull:cull:cull: @20 line 14
72. TDTopezServer>>evaluateCommand:objIn: @18 line 22
73. TDTopezServer>>evaluateTopezScriptCommand: @14 line 9
74. [] in TDTopezServer>>evaluateTopezScript: @30 line 23
75. [] in TDCommandLine class>>line:forEachCommand: @19 line 12
76. OrderedCollection(Collection)>>do: @5 line 10
77. TDCommandLine class>>line:forEachCommand: @3 line 5
78. [] in TDCommandLine class>>fromStream:selectLine:forEachCommand: @39 line 28
79. OrderedCollection(Collection)>>do: @5 line 10
80. TDCommandLine class>>fromStream:selectLine:forEachCommand: @33 line 26
81. [] in TDTopezServer>>evaluateTopezScript: @13 line 11
82. [] in ExecBlock0(ExecBlock)>>ifCurtailed: @7 line 6
83. ExecBlock0(ExecBlock)>>ensure: @2 line 12
84. ExecBlock0(ExecBlock)>>ifCurtailed: @3 line 8
85. TDTopezServer>>evaluateTopezScript: @2 line 26
86. [] in TDTopezLeafNode>>block @6 line 2
87. ExecBlock4(ExecBlock)>>cull:cull:cull:cull: @20 line 14
88. TDTopezServer>>evaluateCommand:objIn: @18 line 22
89. TDTopezServer>>evaluateTopezScriptCommand: @14 line 9
90. [] in TDTopezServer>>evaluateTopezScript: @30 line 23
91. [] in TDCommandLine class>>line:forEachCommand: @19 line 12
92. OrderedCollection(Collection)>>do: @5 line 10
93. TDCommandLine class>>line:forEachCommand: @3 line 5
94. [] in TDCommandLine class>>fromStream:selectLine:forEachCommand: @39 line 28
95. OrderedCollection(Collection)>>do: @5 line 10
96. TDCommandLine class>>fromStream:selectLine:forEachCommand: @33 line 26
97. [] in TDTopezServer>>evaluateTopezScript: @13 line 11
98. [] in ExecBlock0(ExecBlock)>>ifCurtailed: @7 line 6
99. ExecBlock0(ExecBlock)>>ensure: @2 line 12
100. ExecBlock0(ExecBlock)>>ifCurtailed: @3 line 8
101. TDTopezServer>>evaluateTopezScript: @2 line 26
102. [] in TDTopezLeafNode>>block @6 line 2
103. ExecBlock4(ExecBlock)>>cull:cull:cull:cull: @20 line 14
104. TDTopezServer>>evaluateCommand:objIn: @18 line 22
105. TDTopezServer>>evaluateSTONCommand: @9 line 6
106. Executed Code
107. GsNMethod class>>_gsReturnToC @1 line 11
dalehenrich commented 3 years ago

It turns out that the reason this shows up is that the projectClass for the copied spec is picked up from the current baseline, not the one that is being copied! ... that explains why the change to BaseilineOfSeaside caused the merge conflict for Grease.

dalehenrich commented 3 years ago

Metacello/Metacello needs this fix