Re: [Pharo-project] [Metacello] Fwd: Metacello questions
----- "Andreas.Raab" <andreas.raab@gmail.com> wrote: | 3) When exactly is HelpSystem loaded? | | What I'm wondering about in the above is that HelpSystem should only | be | loaded if WebClient-Help is being loaded. Is this implicitly part of | specifying a 'project' instead of a 'package'? Or is there some other | way of specifying that? | | I guess really the question here is what entities get loaded | implicitly | simply by declaring them (packages for sure, any others?) and what | entities need to be 'required' in order to be loaded? Andreas, Here's the Transcript from a (successful) load of WebClient: Loading 1.0 of ConfigurationOfWebClient... Fetched -> ConfigurationOfHelpSystem-tbn.12 Loaded -> ConfigurationOfHelpSystem-tbn.12 Fetched -> WebClient-Core-ar.15 Fetched -> WebClient-Tests-ar.7 Fetched -> WebClient-HTTP-ar.1 Project: HelpSystem Fetched -> HelpSystem-Core-tbn.40 Fetched -> HelpSystem-Tests-tbn.9 Fetched -> Pharo-Project-Help-tbn.8 Fetched -> WebClient-Help-ar.4 Fetched -> WebClient-Pharo-ar.1 Starting atomic load Loaded -> WebClient-Core-ar.15 Loaded -> WebClient-Tests-ar.7 Loaded -> WebClient-HTTP-ar.1 Finished atomic load Loaded -> HelpSystem-Core-tbn.40 Loaded -> HelpSystem-Tests-tbn.9 Loaded -> Pharo-Project-Help-tbn.8 Starting atomic load Loaded -> WebClient-Help-ar.4 Loaded -> WebClient-Pharo-ar.1 Finished atomic load Evaluated -> 1.1 [ConfigurationOfHelpSystem] >> openHelpBrowser In your configuration you had specified that WebClient-Help required the Help System, so you can see that the load of the Help System was inserted at that point in the load (which is what triggered the bug, too). The order of specifying packages/projects implies the order that things will be loaded in. With #requires:, the load order is explicit. I would recommend that you explicitly use #requires: unless only one or two packages are involved. The implicit load order is not obvious when you introduce conditional loading (with #squeakCommon #squeak, and #pharo), so if load order matters I would explicitly declare the relationships. The other aspect besides load order is what you want loaded. By default all packages/projects are loaded, but you can define a 'default' group which would be used to specify a subset of the packages/projects that are loaded by default. This is useful if you want to control whether or not a set of packages (say tests) are loaded or not ... I don't think I've completely answered your questions so we might want to continue the dialog on this question.... Dale
On 5/6/2010 5:26 PM, Dale Henrichs wrote:
I don't think I've completely answered your questions so we might want to continue the dialog on this question....
We're getting close :-) Let me take my own questions and answer them in my own words to see if I understand the issues correctly: Q1: #includes: vs. #requires: If I understand correctly what you're saying then, in heavily simplified form, I'd say they're both dependencies, except that #requires: is loaded before the package it relates to and #includes: afterwords. Thus: spec package: 'B' with:[ spec requires: 'A'. spec includes: 'C'. ]. will load A, B, and C in that order. One thing one can do with this is to have mutually dependent packages, for example if package Foo and Bar always must be loaded together (Foo before Bar) one would specify: spec package: 'Foo' with:[spec includes: 'Bar']. spec package: 'Bar' with:[spec requires: 'Foo']. There is now no way by which Foo or Bar could be loaded without its companion. Correct? Q2: Why is HelpSystem not loaded? A: That's a bug which I can work around by specifying either #version: or #versionString:. Q3: When exactly is HelpSystem loaded? A: In the context of my configuration HelpSystem is loaded for two reasons: a) because it's a dependency for WebClient-Help and b) because no 'default' group has been specified it would be loaded implicitly. Q4: How does one define dependencies that differ based on platform? A: I'm not really sure about this. My understanding is that I could use #includes: to model the dependency in the "for: #pharo" branch, but one question that is still open is whether the following two expressions are equivalent: spec package:'Foo' with:[spec requires: 'Bar']; package:'Foo' with:[spec requires: 'Baz']; and spec package: 'Foo' with:[spec requires: #('Bar' 'Baz')]. Are these equivalent? Cheers, - Andreas
participants (2)
-
Andreas Raab -
Dale Henrichs