Manuscript (Case [Issue]22865) Metacello - Metacello Baselines using the copy functionality over a project defining projectClass as MetacelloCypressB

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Manuscript (Case [Issue]22865) Metacello - Metacello Baselines using the copy functionality over a project defining projectClass as MetacelloCypressB

Pharo Issue Tracker
Manuscript Notification
avatar
Bug in Project:  Metacello: Divers  •  You are subscribed to this case
If you have a dependency in your baseline to some project declaring projectClass as MetacelloCypressBaselineProject (wich is the right option if you're using metadaless, AFAIK), and you try to use the project:copyFrom:with: method to load different groups of the dependency, when Metacello tries to load the Baseline it will fail with this kind of error:

Error: The project spec 'Buoy' in project BaselineOfCannon has incompatible specs. MetacelloMCBaselineOfProjectSpec and MetacelloCypressBaselineProjectSpec are not compatible

You can see a failing job here: https://travis-ci.org/ba-st/Cannon/jobs/475358948

Find attached a fuel out of the failing stack. And here is a textual copy:

MetacelloCypressBaselineProjectSpec(Object)>>error:
MetacelloCypressBaselineProjectSpec(MetacelloSpec)>>validateMergeForSpec:
MetacelloCypressBaselineProjectSpec(MetacelloSpec)>>mergeSpec:
MetacelloCypressBaselineProjectSpec(MetacelloGenericProjectSpec)>>mergeSpec:
MetacelloCypressBaselineProjectSpec(MetacelloMCBaselineOfProjectSpec)>>mergeSpec:
MetacelloProjectReferenceSpec>>mergeSpec:
MetacelloPackagesSpec(MetacelloMemberListSpec)>>mapCopy:into:
[ :memberSpec | self mapCopy: memberSpec into: map ] in [ :member |
member
    applyAdd: [ :memberSpec | self mapAdd: memberSpec into: map ]
    copy: [ :memberSpec | self mapCopy: memberSpec into: map ]
    merge: [ :memberSpec | self mapMerge: memberSpec into: map ]
    remove: [ :memberSpec | self mapRemove: memberSpec into: map ]
] in MetacelloPackagesSpec(MetacelloMemberListSpec)>>map in Block: [ :memberSpec | self mapCopy: memberSpec into: map...etc...
MetacelloCopyMemberSpec>>applyAdd:copy:merge:remove:
[ :member |
member
    applyAdd: [ :memberSpec | self mapAdd: memberSpec into: map ]
    copy: [ :memberSpec | self mapCopy: memberSpec into: map ]
    merge: [ :memberSpec | self mapMerge: memberSpec into: map ]
    remove: [ :memberSpec | self mapRemove: memberSpec into: map ]
] in MetacelloPackagesSpec(MetacelloMemberListSpec)>>map in Block: [ :member | ...
OrderedCollection>>do:
MetacelloPackagesSpec(MetacelloMemberListSpec)>>map
MetacelloPackagesSpec>>packageSpecsInLoadOrderFor:
MetacelloMCVersionSpec(MetacelloVersionSpec)>>packageSpecsInLoadOrder
MetacelloMCVersionSpec(MetacelloVersionSpec)>>projectDo:packageDo:groupDo:
MetacelloMCVersion>>packages
MetacelloMCVersion>>packageAndProjectNamesToLoad:loader:
MetacelloMCVersion>>defaultPackageNamesToLoad:
[ | fetchLoader |

fetchLoader := self
    fetchRequiredFromArray: ( self defaultPackageNamesToLoad: anArray ).
MetacelloPlatform current
    do: [ fetchLoader doLoad ]
    displaying: 'Loading ' , displayString.
Transcript
    cr;
    show: '...finished ' , self versionNumber printString.
^ fetchLoader
] in MetacelloMCVersion>>doLoadRequiredFromArray: in Block: [ | fetchLoader |...
BlockClosure>>ensure:
MetacelloMCVersion>>doLoadRequiredFromArray:
Array(Collection)>>loadRequiredForMetacelloMCVersion:
MetacelloMCVersion>>load:
[ | version loadedSpec |

self setDefaultsAndValidateProjectSpec.
[ loadedSpec := ( self lookupProjectSpecFor: self projectSpec ) copy ]
    on: MetacelloAllowProjectDowngrade , MetacelloAllowProjectUpgrade
    do:
        [ :ex | ex handleOnDownGrade: onDownGradeBlock onUpgrade: onUpgradeBlock ].
version := loadedSpec versionForScriptEngine: self.
self
    root:
        ( required isEmpty
            ifTrue: [ version load ]
            ifFalse: [ version load: required ] ) loadDirective.
loadedSpec loads: required.
MetacelloProjectRegistration
    registrationForProjectSpec: loadedSpec
    ifAbsent: [ :new |
        new
            loadedInImage: true;
            registerProject
        ]
    ifPresent: [ :existing :new |
        existing
            copyOnWrite: [ :existingCopy |
                existingCopy
                    loadedInImage: true;
                    merge: new
                ]
        ]
] in [ self
    handleNotificationsForAction: [ | version loadedSpec |

        self setDefaultsAndValidateProjectSpec.
        [ loadedSpec := ( self lookupProjectSpecFor: self projectSpec ) copy ]
            on: MetacelloAllowProjectDowngrade , MetacelloAllowProjectUpgrade
            do:
                [ :ex | ex handleOnDownGrade: onDownGradeBlock onUpgrade: onUpgradeBlock ].
        version := loadedSpec versionForScriptEngine: self.
        self
            root:
                ( required isEmpty
                    ifTrue: [ version load ]
                    ifFalse: [ version load: required ] ) loadDirective.
        loadedSpec loads: required.
        MetacelloProjectRegistration
            registrationForProjectSpec: loadedSpec
            ifAbsent: [ :new |
                new
                    loadedInImage: true;
                    registerProject
                ]
            ifPresent: [ :existing :new |
                existing
                    copyOnWrite: [ :existingCopy |
                        existingCopy
                            loadedInImage: true;
                            merge: new
                        ]
                ]
        ]
] in MetacelloScriptEngine>>load:onProjectDownGrade:onProjectUpgrade: in Block: [ | version loadedSpec |...
BlockClosure>>on:do:
[ actionBlock
    on:
        MetacelloLookupProjectSpec , MetacelloLookupProjectSpecForLoad
            , MetacelloProjectSpecLoadedNotification
            , MetacelloScriptEnsureProjectLoadedForDevelopment
            , MetacelloLookupBaselineSpecForEnsureLoad
    do:
        [ :ex | "lookup and registration handlers need to be innermost set of handlers ...they may throw option notifications" ex handleResolutionFor: self ]
] in [ [ actionBlock
    on:
        MetacelloLookupProjectSpec , MetacelloLookupProjectSpecForLoad
            , MetacelloProjectSpecLoadedNotification
            , MetacelloScriptEnsureProjectLoadedForDevelopment
            , MetacelloLookupBaselineSpecForEnsureLoad
    do:
        [ :ex | "lookup and registration handlers need to be innermost set of handlers ...they may throw option notifications" ex handleResolutionFor: self ]
]
    on:
        MetacelloAllowProjectDowngrade , MetacelloAllowProjectUpgrade
            , MetacelloAllowConflictingProjectUpgrade
    do:
        [ :ex | "option handlers need to be outermost set of handlers ... last line of defense before users are involved" ex handleResolutionFor: self ]
] in [ [ [ actionBlock
    on:
        MetacelloLookupProjectSpec , MetacelloLookupProjectSpecForLoad
            , MetacelloProjectSpecLoadedNotification
            , MetacelloScriptEnsureProjectLoadedForDevelopment
            , MetacelloLookupBaselineSpecForEnsureLoad
    do:
        [ :ex | "lookup and registration handlers need to be innermost set of handlers ...they may throw option notifications" ex handleResolutionFor: self ]
]
    on:
        MetacelloAllowProjectDowngrade , MetacelloAllowProjectUpgrade
            , MetacelloAllowConflictingProjectUpgrade
    do:
        [ :ex | "option handlers need to be outermost set of handlers ... last line of defense before users are involved" ex handleResolutionFor: self ]
]
    on: MetacelloAllowLockedProjectChange
    do:
        [ :ex | "MetacelloAllowLockedProjectChange need to be outermost handler ... since it is signaled from second line of handlers" ex handleResolutionFor: self ]
] in MetacelloScriptEngine>>handleNotificationsForAction: in Block: [ actionBlock...
BlockClosure>>on:do:
[ [ actionBlock
    on:
        MetacelloLookupProjectSpec , MetacelloLookupProjectSpecForLoad
            , MetacelloProjectSpecLoadedNotification
            , MetacelloScriptEnsureProjectLoadedForDevelopment
            , MetacelloLookupBaselineSpecForEnsureLoad
    do:
        [ :ex | "lookup and registration handlers need to be innermost set of handlers ...they may throw option notifications" ex handleResolutionFor: self ]
]
    on:
        MetacelloAllowProjectDowngrade , MetacelloAllowProjectUpgrade
            , MetacelloAllowConflictingProjectUpgrade
    do:
        [ :ex | "option handlers need to be outermost set of handlers ... last line of defense before users are involved" ex handleResolutionFor: self ]
] in [ [ [ actionBlock
    on:
        MetacelloLookupProjectSpec , MetacelloLookupProjectSpecForLoad
            , MetacelloProjectSpecLoadedNotification
            , MetacelloScriptEnsureProjectLoadedForDevelopment
            , MetacelloLookupBaselineSpecForEnsureLoad
    do:
        [ :ex | "lookup and registration handlers need to be innermost set of handlers ...they may throw option notifications" ex handleResolutionFor: self ]
]
    on:
        MetacelloAllowProjectDowngrade , MetacelloAllowProjectUpgrade
            , MetacelloAllowConflictingProjectUpgrade
    do:
        [ :ex | "option handlers need to be outermost set of handlers ... last line of defense before users are involved" ex handleResolutionFor: self ]
]
    on: MetacelloAllowLockedProjectChange
    do:
        [ :ex | "MetacelloAllowLockedProjectChange need to be outermost handler ... since it is signaled from second line of handlers" ex handleResolutionFor: self ]
] in MetacelloScriptEngine>>handleNotificationsForAction: in Block: [ [ actionBlock...
BlockClosure>>on:do:
[ [ [ actionBlock
    on:
        MetacelloLookupProjectSpec , MetacelloLookupProjectSpecForLoad
            , MetacelloProjectSpecLoadedNotification
            , MetacelloScriptEnsureProjectLoadedForDevelopment
            , MetacelloLookupBaselineSpecForEnsureLoad
    do:
        [ :ex | "lookup and registration handlers need to be innermost set of handlers ...they may throw option notifications" ex handleResolutionFor: self ]
]
    on:
        MetacelloAllowProjectDowngrade , MetacelloAllowProjectUpgrade
            , MetacelloAllowConflictingProjectUpgrade
    do:
        [ :ex | ...
Priority Priority: 3 – Must Fix Status Status: Working On
Assigned To Assigned to: Everyone Milestone Milestone: Pharo7.0

Go to Case
No longer need updates? Unsubscribe from this case.

Don't want Manuscript notifications anymore? Update your preferences.

Manuscript

_______________________________________________
Pharo-bugtracker mailing list
[hidden email]
https://lists.gforge.inria.fr/mailman/listinfo/pharo-bugtracker