Afghan hell

I'm trying to develop a simple project in Pharo and I would like to add its dependencies to Metacello. My project depends on Glamor, Roassal and XMLSupport.

The way to clean install my project is to manually install the dependencies first. By following the book Deep in Pharo you can do

Gofer new
  smalltalkhubUser: 'Moose' project: 'Glamour';
  package: 'ConfigurationOfGlamour';
  load.
(Smalltalk at: #ConfigurationOfGlamour) perform: #loadDefault.

Gofer new smalltalkhubUser: 'ObjectProfile'
  project: 'Roassal';
  package: 'ConfigurationOfRoassal';
  load.
(Smalltalk at: #ConfigurationOfRoassal) load.

Gofer new
  squeaksource: 'XMLSupport'; 
  package: 'ConfigurationOfXMLSupport';
  load.
(Smalltalk at: #ConfigurationOfXMLSupport) perform: #loadDefault.

      

and then my project will work fine.

I tried to build ConfigurationOfMyProject

with Versionner and I added Glamor, Roassal and XMLSupport as dependencies using the version currently installed in my image (2.6-snapshot, 1.430 and 1.2.1 respectively).

The problem is I can't load my project with Metacello on the new image. The project loads fine, but whenever I try to load my classes, I get missing methods in Glamor. Moreover, it is obvious that something is different, because even the world menu has different entries.

I've tried other combinations of versions, including using stable Glamor (2.1), but I got more errors, including not even being able to open the project in the Version (it complains about the lack of Roassal name).

What is the correct way to add these dependencies cleanly?

+3


source to share


3 answers


First of all, I want to emphasize that if the configuration is in the ConfigurationOf <proj-name> class, you can load it using the message #configuration

:

Gofer new
  smalltalkhubUser: 'Moose' project: 'Glamour';
  configuration;
  load.
(Smalltalk at: #ConfigurationOfGlamour) perform: #loadDefault.

      

A I don't see your project, I can just suggest that you write the configuration manually. There is a simple tutorial called Dead simple intro to Metacello .



As per your description, it should be something like:

baseline01: spec 
  <version: '0.1'>

  spec for: #common do: [  
    spec blessing: #release.
    spec repository: 'your repo url'.

    spec 
      package: 'YourPackage' with: [
        spec requires: #('Glamour' 'Roassal' 'XMLSupport') ].
    "also maybe you have a couple of packages that depend on different projects"

    spec project: 'Glamour' with: [
      spec 
        className: 'ConfigurationOf Glamour';
        repository: 'http://smalltalkhub.com/mc/Moose/Glamour/main';
        version: #'2.6-snapshot' ].

    spec project: 'Roassal' with: [
      spec 
        className: 'ConfigurationOfRoassal';
        repository: 'http://smalltalkhub.com/mc/ObjectProfile/Roassal/main';
        version: #'1.430' ].

    "and same for XMLSupport" ].

      

Also you can try downloading the #development versions as I got the impression that projects like Roassal and Glamor have very outdated stable versions. Also note that Roassal2 is under active development and will replace the original Roassal on the Moose platform, you might want to use it.

+2


source


I would seriously give up writing configurations by hand - this is Metacello assembly code;) If you are not working on Cross-Smalltalk projects with platform code (for example, code for Pharo 1.4 vs Squeak 4.5) - an area that has not been explored yet, the version for developers is the tool for you. I've written dozens of configurations with it and haven't run into an obstacle yet.

When you say you added them as dependencies, did you just add them as projects in the Dependent Projects panel?

enter image description here

If so, you should also specify which of the packages in your project depends on them. To do this, you select the appropriate package for your project in the Packages panel.



enter image description here

Now hit the edit button with the pencil icon that you just activated. In the dialog box that appears, click the green button +

and add the external projects of interest.

enter image description here

+1


source


It looks like you are trying to do this in an older version of Pharo?

Roassal has been replaced by Roassal2, and XML support has been replaced with smalltalkhub, split into ConfigurationOfXMLWriter and ConfigurationOfXMLParser, as in PharoExtras.

If you download the correct groups from Glamor, you do not need to describe Roassal dependencies, as Glamor already depends on Roassal (2). This explains your cyclical dependency.

You also ran into an issue that we talked about recently on the pharo mailing lists that #stable is not a usable symbolic version name. In Seaside / Magritte / Grease projects, we changed the use of the symbolic version names of the style `` release3.1 ''. This ensures that the ripple effect stabilizes as it progresses.

Version snapshots should never be dependent, they just describe what is currently being loaded and are mostly not updated.

[edit] Metacello tries to be smart by default by not installing older versions with newer ones. This works really well as long as things don't move to different packages. So you're a little out of luck that you ended up in a non-working combination.

Metacello supports complex workflows and different smalltalk projects (required) use different workflows. It often takes some time to reach consensus on the best way to do something.

Roassal is independent of Glamor, but you can create a loop in your own configuration :)

Packages were moved from squeaksource to ss3 and smalltalkhub because the server was having stability issues. More recently, these issues have been fixed. The xml support was split as it was noted that many applications actually do not need to either write or read the xml.

Once you have a working configuration it might be a good idea to build and test it on a pharo continuous integration server: http://ci.inria.fr/pharo-contribution If this is not your application, at least the open source parts used by you. This way the Pharo, Glamor and Roassal teams can find out if any change they are making has changed.

+1


source







All Articles