pharo-project / pharo

Pharo is a dynamic reflective pure object-oriented language supporting live programming inspired by Smalltalk.
http://pharo.org
Other
1.21k stars 355 forks source link

Metacello loads baseline dependencies not needed by group #9913

Open JanBliznicenko opened 3 years ago

JanBliznicenko commented 3 years ago

There is a case where baseline loads external dependencies although it is not part of the selected group. Consider following 2 loading scripts:

Metacello new
        baseline: 'Roassal2';
        repository: 'github://ObjectProfile/Roassal2';
        load: #( 'Core' )
Metacello new
        baseline: 'PetitParser';
        repository: 'github://moosetechnology/PetitParser';
        load: #( 'Core' ).

BaselineOfRoassal2 depends on GToolkitExamples, but Roassal2's Core group does not depend on it. BaselineOfPetitParser depends on Roassal2 (default group), but PetitParser's Core group does not depend on Roassal2 at all.

So, in theory, using these two scripts should never load GToolkitExamples, as Roassal2 core group does not depend on it and PetitParser core group does not depend on Roassal2.

If you execute the second script (load PetitParser core), it correctly loads the PetitParser core without the Roassal2 and any of its dependencies. If you execute the first script (load Roassal2 core), it correctly loads the Roassal2 core without GToolkitExamples.

BUT, if you load the Roassal2 core BEFORE loading PetitParser core, so execute first script before second one, Metacello (or whatever does that) tries to load all Roassal2 dependencies, including GToolkitExamples, although Roassal2 core does not need it and PetitParser does not need Roassal2 at all.

This is quite an issue in Pharo 10 as GToolkitExamples cannot be loaded and therefore loading PetitParser core group breaks.

Steps to reproduce:

  1. Take fresh Pharo 10 image
  2. Execute the first script (Load Roassal2 core)
  3. Execute the second script (Load PetitParser core) Result: GToolkit-Examples-Extensions fails to load, although it should not even attempt to load.
Ducasse commented 3 years ago

Yes this is a known limits of Metacello.