Metacello / metacello

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

Query BaselineOf dependencies? #517

Open hernanmd opened 4 years ago

hernanmd commented 4 years ago

Imagine I have loaded a very complex Baseline, using Metacello.

I would like to inspect which other Baselines are loaded by this complex Baseline. And maybe check for Baseline dependencies of a Baseline dependency itself... and so on.

Is there a way to query and get a tree of baseline dependencies?

Something like?

BaselineOfMyProject dependencyTree.
dalehenrich commented 4 years ago

There is no ready made query for this.

You can use record in place of load in a Metacello load expression to produce an ordered list of load directives. And from that you can produce a list of the version directives that correspond to dependent projects being loaded:

| directives versions |
directives := Metacello new
   baseline: <project-name>
   repository: <rep-url>
   record.
versions := OrderedCollection new.
directives versionDirectivesDo: [:d | versions add: d ].
versions

But it is not a tree structure as the directives are produced in load order ...

You might check with the fink guys as I believe that they have produced visualizations for Metacello in the past and may have done something a bit more like what you are looking for ...

Dale

On 6/20/20 6:08 AM, Hernán Morales Durand wrote:

Imagine I have loaded a very complex Baseline, using Metacello.

I would like to inspect which other Baselines are loaded by this complex Baseline. And maybe check for Baseline dependencies of a Baseline dependency itself... and so on.

Is there a way to query and get a tree of baseline dependencies?

Something like?

BaselineOfMyProject dependencyTree.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Metacello/metacello/issues/517, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEYKT32DZCCEDVCXNHZDNDRXSYDRANCNFSM4ODMEHMA.

dalehenrich commented 4 years ago

s/fink/feenk/ ... sorry about that  ... wish I could blame spell checker:)

Dale

On 6/20/20 10:59 AM, Dale Henrichs wrote:

There is no ready made query for this.

You can use record in place of load in a Metacello load expression to produce an ordered list of load directives. And from that you can produce a list of the version directives that correspond to dependent projects being loaded:

| directives versions |
directives := Metacello new
   baseline: <project-name>
   repository: <rep-url>
   record.
versions := OrderedCollection new.
directives versionDirectivesDo: [:d | versions add: d ].
versions

But it is not a tree structure as the directives are produced in load order ... You might check with the fink guys as I believe that they have produced visualizations for Metace

On 6/20/20 6:08 AM, Hernán Morales Durand wrote:

Imagine I have loaded a very complex Baseline, using Metacello.

I would like to inspect which other Baselines are loaded by this complex Baseline. And maybe check for Baseline dependencies of a Baseline dependency itself... and so on.

Is there a way to query and get a tree of baseline dependencies?

Something like?

BaselineOfMyProject dependencyTree.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Metacello/metacello/issues/517, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEYKT32DZCCEDVCXNHZDNDRXSYDRANCNFSM4ODMEHMA.

hernanmd commented 4 years ago

Thanks Dale! Yes, I remember the visualization, just wanted to check if it can be produced out of their box. Will try to use your script to see what I get.

hernanmd commented 4 years ago

Maybe something is missing, I get "Instance of MetacelloScriptApiExecutor did not understand #versionDirectivesDo:" for example with a very small repo:

| directives versions |

directives := Metacello new
    baseline: 'StringExtensions';
    repository: 'github://hernanmd/StringExtensions/repository';
    record.
versions := OrderedCollection new.
directives versionDirectivesDo: [:d | versions add: d ].
versions
dalehenrich commented 4 years ago

Where are you running this?

The MetacelloScriptApiExecutor class is an internal Metacello class and definitely shouldn't be returned  by that expression ... I haven't changed Metacello in a several years now and I'm certain that there are tests for this in Metacello, so something is not right in your image?

Dale

On 6/20/20 1:46 PM, Hernán Morales Durand wrote:

Maybe something is missing, I get "Instance of MetacelloScriptApiExecutor did not understand #versionDirectivesDo:" for example with a very small repo:

|directives versions |

directives:= Metacello new baseline: 'StringExtensions'; repository: 'github://hernanmd/StringExtensions/repository'; record. versions:= OrderedCollection new. directivesversionDirectivesDo: [:d | versionsadd: d ]. versions

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Metacello/metacello/issues/517#issuecomment-647043646, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEYKT6B7F5CR74OJ44I2TTRXUN2JANCNFSM4ODMEHMA.

hernanmd commented 4 years ago

I ran this in a clean vanilla Pharo 8 image (Pharo 8.0.0 Build information: Pharo-8.0.0+build.1140.sha.5e328f2d7e8ed65fbddfb761624df5a19d0400f7 (64 Bit)) under macOS:

 wget -O- get.pharo.org/64 | bash -

All Metacello tests (183) passes, but this is the output I get running your script:

Instance of MetacelloScriptApiExecutor did not understand #versionDirectivesDo: MetacelloScriptApiExecutor(Object)>>doesNotUnderstand: #versionDirectivesDo: UndefinedObject>>DoIt OpalCompiler>>evaluate RubSmalltalkEditor>>evaluate:andDo: RubSmalltalkEditor>>highlightEvaluateAndDo: [ textMorph textArea editor highlightEvaluateAndDo: ann action. textMorph shoutStyler style: textMorph text ] in [ textMorph textArea handleEdit: [ textMorph textArea editor highlightEvaluateAndDo: ann action. textMorph shoutStyler style: textMorph text ] ] in GLMMorphicPharoScriptRenderer(GLMMorphicPharoCodeRenderer)>>actOnHighlightAndEvaluate: in Block: [ textMorph textArea editor highlightEvaluateAndDo...etc... RubEditingArea(RubAbstractTextArea)>>handleEdit: [ textMorph textArea handleEdit: [ textMorph textArea editor highlightEvaluateAndDo: ann action. textMorph shoutStyler style: textMorph text ] ] in GLMMorphicPharoScriptRenderer(GLMMorphicPharoCodeRenderer)>>actOnHighlightAndEvaluate: in Block: [ textMorph textArea... WorldState>>runStepMethodsIn: WorldMorph>>runStepMethods WorldState>>doOneCycleNowFor: WorldState>>doOneCycleFor: WorldMorph>>doOneCycle WorldMorph class>>doOneCycle [ [ WorldMorph doOneCycle. Processor yield. false ] whileFalse: [ ] ] in MorphicUIManager>>spawnNewProcess in Block: [ [ WorldMorph doOneCycle.... [ self value. Processor terminateActive ] in BlockClosure>>newProcess in Block: [ self value....

dalehenrich commented 4 years ago

Hernán,

It sounds like this must be a Metacello regression that is specific to Pharo9. When I look at the test lineup for Metacello on github[1]. The latest version of Pharo that is tested i6 Pharo6.1, so Phara appears to be using their own version of Metacello and I have no visibility of what they have done the last few years, but clearly there have been regressions.

Dale

[1] https://github.com/Metacello/metacello/blob/master/.travis.yml#L6-L21

On 6/21/20 10:59 AM, Hernán Morales Durand wrote:

I ran this in a clean vanilla Pharo 8 image (Pharo 8.0.0 Build information: Pharo-8.0.0+build.1140.sha.5e328f2d7e8ed65fbddfb761624df5a19d0400f7 (64 Bit)) under macOS:

wget -O- get.pharo.org/64| bash -

All Metacello tests (183) passes, but this is the output I get running your script:

Instance of MetacelloScriptApiExecutor did not understand
#versionDirectivesDo:
MetacelloScriptApiExecutor(Object)>>doesNotUnderstand:
#versionDirectivesDo:
UndefinedObject>>DoIt
OpalCompiler>>evaluate
RubSmalltalkEditor>>evaluate:andDo:
RubSmalltalkEditor>>highlightEvaluateAndDo:
[ textMorph textArea editor highlightEvaluateAndDo: ann action.
textMorph shoutStyler style: textMorph text ] in [ textMorph textArea
handleEdit: [ textMorph textArea editor highlightEvaluateAndDo:
ann action.
textMorph shoutStyler style: textMorph text ] ] in
GLMMorphicPharoScriptRenderer(GLMMorphicPharoCodeRenderer)>>actOnHighlightAndEvaluate:
in Block: [ textMorph textArea editor highlightEvaluateAndDo...etc...
RubEditingArea(RubAbstractTextArea)>>handleEdit:
[ textMorph textArea
handleEdit: [ textMorph textArea editor highlightEvaluateAndDo:
ann action.
textMorph shoutStyler style: textMorph text ] ] in
GLMMorphicPharoScriptRenderer(GLMMorphicPharoCodeRenderer)>>actOnHighlightAndEvaluate:
in Block: [ textMorph textArea...
WorldState>>runStepMethodsIn:
WorldMorph>>runStepMethods
WorldState>>doOneCycleNowFor:
WorldState>>doOneCycleFor:
WorldMorph>>doOneCycle
WorldMorph class>>doOneCycle
[ [ WorldMorph doOneCycle.
Processor yield.
false ] whileFalse: [ ] ] in MorphicUIManager>>spawnNewProcess in
Block: [ [ WorldMorph doOneCycle....
[ self value.
Processor terminateActive ] in BlockClosure>>newProcess in Block:
[ self value....

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Metacello/metacello/issues/517#issuecomment-647160817, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEYKT5R6UO6EWKDB3ZRQXDRXZDARANCNFSM4ODMEHMA.

hernanmd commented 4 years ago

Thanks Dale, I thought there was only one version of Metacello for all flavors and I also didn't found a forked Pharo 8 version. I will check if I find some info about this.