Dependencies and Monticello

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

Dependencies and Monticello

Andrew Black
I probably don't understand how to use Monticello dependencies correctly.  Here is the situation.  Your help appreciated.

I'm writing code that uses PetitParser.  So, I added to my own package a dependency on PetitParser.

Strangely, rather than linking to the PetitParser repository, this copies PetitParser into my repository when save a new version on my package.

The problem is that I have found it necessary to change a few definitions in *PetitParser.  (I would call these bug fixes, but that is a matter of opinion.)  I didn't think that would be a problem; I put the overriding definitions into my package, and everything worked fine.

That is, it worked fine until I started with a clean image and loaded my package.  Monticello apparently loaded my package, and then loaded PetitParser.  This over-wrote my (bug-fix) definitions with the original ones.   Most of my tests failed.

If I load my package a second time, them my definitions overwrite the ones from PetitParser, and all is well.

I infer that Monticello packages are supposed to be load-order-independent.  So, what is the right way to fix this problem (other than convincing Lukas that trimSpaces should, indeed, trimSpaces)?

    Andrew

Reply | Threaded
Open this post in threaded view
|

Re: Dependencies and Monticello

Stéphane Ducasse
Hi andrew

Do not use dependencies.
They do not work well.
Use Metacello. Here is a draft I should finish on metacello.




On Feb 15, 2011, at 12:04 PM, Andrew Black wrote:

> I probably don't understand how to use Monticello dependencies correctly.  Here is the situation.  Your help appreciated.
>
> I'm writing code that uses PetitParser.  So, I added to my own package a dependency on PetitParser.
>
> Strangely, rather than linking to the PetitParser repository, this copies PetitParser into my repository when save a new version on my package.
>
> The problem is that I have found it necessary to change a few definitions in *PetitParser.  (I would call these bug fixes, but that is a matter of opinion.)  I didn't think that would be a problem; I put the overriding definitions into my package, and everything worked fine.
>
> That is, it worked fine until I started with a clean image and loaded my package.  Monticello apparently loaded my package, and then loaded PetitParser.  This over-wrote my (bug-fix) definitions with the original ones.   Most of my tests failed.
>
> If I load my package a second time, them my definitions overwrite the ones from PetitParser, and all is well.
>
> I infer that Monticello packages are supposed to be load-order-independent.  So, what is the right way to fix this problem (other than convincing Lukas that trimSpaces should, indeed, trimSpaces)?
>
>    Andrew
>


Metacello.pdf (539K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Dependencies and Monticello

laurent laffont
Hi,


Laurent Laffont - @lolgzs

Pharo Smalltalk Screencasts: http://www.pharocasts.com/
Blog: http://magaloma.blogspot.com/


On Tue, Feb 15, 2011 at 4:23 PM, Stéphane Ducasse <[hidden email]> wrote:
Hi andrew

Do not use dependencies.
They do not work well.
Use Metacello. Here is a draft I should finish on metacello.




On Feb 15, 2011, at 12:04 PM, Andrew Black wrote:

> I probably don't understand how to use Monticello dependencies correctly.  Here is the situation.  Your help appreciated.
>
> I'm writing code that uses PetitParser.  So, I added to my own package a dependency on PetitParser.
>
> Strangely, rather than linking to the PetitParser repository, this copies PetitParser into my repository when save a new version on my package.
>
> The problem is that I have found it necessary to change a few definitions in *PetitParser.  (I would call these bug fixes, but that is a matter of opinion.)  I didn't think that would be a problem; I put the overriding definitions into my package, and everything worked fine.
>
> That is, it worked fine until I started with a clean image and loaded my package.  Monticello apparently loaded my package, and then loaded PetitParser.  This over-wrote my (bug-fix) definitions with the original ones.   Most of my tests failed.
>
> If I load my package a second time, them my definitions overwrite the ones from PetitParser, and all is well.
>
> I infer that Monticello packages are supposed to be load-order-independent.  So, what is the right way to fix this problem (other than convincing Lukas that trimSpaces should, indeed, trimSpaces)?
>
>    Andrew
>



Reply | Threaded
Open this post in threaded view
|

Re: Dependencies and Monticello

Andrew Black
In reply to this post by Stéphane Ducasse
Hi St&eacute;f

Thank you for the draft chapter, and also to Laurent for the video.  The video, however, goes too fast for those who as yet do not understand.  Using these resources, I have spent 2 or 3 hours learning about Metacello.  It seems like a very powerful tool, but one that is overkill for my purposes.  It looks like a lot of machinery is needed to do what is now the simplest thing for me, which is to load the bleeding edge version of my own code.   However, the effort of learning all of this stuff has not been lost, because in 6 months or a year I may really need it.

Still, I cannot figure out how to  solve the motivating problem, which was described in my original mail: make my 'project' depend on someone else's package.

So far I have this:

baseline100: spec
        <version: '1.0-baseline'>
       
        spec for: #common do: [
                spec blessing: #baseline.
                spec repository: 'http://www.SqueakSource/GraceParser'.
                spec
                        package: 'Grace-Parser' with: [spec requires: 'PetitParser';
                                                                                                repository: 'http://source.lukas-renggli.ch/petit' ];
                        package: 'Grace-ParserTests' with: [spec requires: 'PetitTests-Core';
                                                                                                repository: 'http://source.lukas-renggli.ch/petit' ].
                spec
                        group: 'default' with: #('Core' 'Tests');
                        group: 'Core' with: #('Grace-Parser');
                        group: 'Tests' with: #('Grace-ParserTests'). ].

When I try to load: '1.0', I get a walkback with the message: 'Error: Name not found: PetitParser', so obviously I'm not describing the dependency correctly.

What's the right way to define a dependency on a package in another repository?

    Andrew




-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Stéphane Ducasse
Sent: 15 February 2011 15:24
To: A friendly place where any question about pharo is welcome
Subject: Re: [Pharo-users] Dependencies and Monticello

Hi andrew

Do not use dependencies.
They do not work well.
Use Metacello. Here is a draft I should finish on metacello.


Reply | Threaded
Open this post in threaded view
|

Re: Dependencies and Monticello

simondenier
Hi Andrew

If you don't want to spend the extra time to learn Metacello right now (although it's the very basic thing Metacello does, so I think it should be pretty easy for you to get started and just deal with the basics of Metacello), you can write a script to load packages in a specific order with Gofer.

See http://www.lukas-renggli.ch/blog/gofer

So something like
Gofer new
        squeaksource: 'yourproject';
        package: 'packageX';   "get latest version of packageX"
        version: 'packageY-yyyyy.188'; "get version 188 of packageY"
        load

and you can save the script in a method (to set up your environment) or even an external file which can be passed to and runned by the VM (not all VMs support this though)



On 17 févr. 2011, at 16:02, Andrew Black wrote:

> Hi St&eacute;f
>
> Thank you for the draft chapter, and also to Laurent for the video.  The video, however, goes too fast for those who as yet do not understand.  Using these resources, I have spent 2 or 3 hours learning about Metacello.  It seems like a very powerful tool, but one that is overkill for my purposes.  It looks like a lot of machinery is needed to do what is now the simplest thing for me, which is to load the bleeding edge version of my own code.   However, the effort of learning all of this stuff has not been lost, because in 6 months or a year I may really need it.
>
> Still, I cannot figure out how to  solve the motivating problem, which was described in my original mail: make my 'project' depend on someone else's package.
>
> So far I have this:
>
> baseline100: spec
> <version: '1.0-baseline'>
>
> spec for: #common do: [
> spec blessing: #baseline.
> spec repository: 'http://www.SqueakSource/GraceParser'.
> spec
> package: 'Grace-Parser' with: [spec requires: 'PetitParser';
> repository: 'http://source.lukas-renggli.ch/petit' ];
> package: 'Grace-ParserTests' with: [spec requires: 'PetitTests-Core';
> repository: 'http://source.lukas-renggli.ch/petit' ].
> spec
> group: 'default' with: #('Core' 'Tests');
> group: 'Core' with: #('Grace-Parser');
> group: 'Tests' with: #('Grace-ParserTests'). ].
>
> When I try to load: '1.0', I get a walkback with the message: 'Error: Name not found: PetitParser', so obviously I'm not describing the dependency correctly.
>
> What's the right way to define a dependency on a package in another repository?
>
>    Andrew
>
>
>
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf Of Stéphane Ducasse
> Sent: 15 February 2011 15:24
> To: A friendly place where any question about pharo is welcome
> Subject: Re: [Pharo-users] Dependencies and Monticello
>
> Hi andrew
>
> Do not use dependencies.
> They do not work well.
> Use Metacello. Here is a draft I should finish on metacello.
>
>

--
Simon Denier




Reply | Threaded
Open this post in threaded view
|

Re: Dependencies and Monticello

Luc Fabresse
Hi Andrew,

 You forgot to declare 'PetitParser' and 'PetitTests' (not 'PetitTests-Core' ;-) )
 Find attached a ConfigurationOfGrace.
 See class comment to load.

Cheers,

#Luc


Le 17 févr. 2011 à 17:31, Simon Denier a écrit :

> Hi Andrew
>
> If you don't want to spend the extra time to learn Metacello right now (although it's the very basic thing Metacello does, so I think it should be pretty easy for you to get started and just deal with the basics of Metacello), you can write a script to load packages in a specific order with Gofer.
>
> See http://www.lukas-renggli.ch/blog/gofer
>
> So something like
> Gofer new
> squeaksource: 'yourproject';
> package: 'packageX';   "get latest version of packageX"
> version: 'packageY-yyyyy.188'; "get version 188 of packageY"
> load
>
> and you can save the script in a method (to set up your environment) or even an external file which can be passed to and runned by the VM (not all VMs support this though)
>
>
>
> On 17 févr. 2011, at 16:02, Andrew Black wrote:
>
>> Hi St&eacute;f
>>
>> Thank you for the draft chapter, and also to Laurent for the video.  The video, however, goes too fast for those who as yet do not understand.  Using these resources, I have spent 2 or 3 hours learning about Metacello.  It seems like a very powerful tool, but one that is overkill for my purposes.  It looks like a lot of machinery is needed to do what is now the simplest thing for me, which is to load the bleeding edge version of my own code.   However, the effort of learning all of this stuff has not been lost, because in 6 months or a year I may really need it.
>>
>> Still, I cannot figure out how to  solve the motivating problem, which was described in my original mail: make my 'project' depend on someone else's package.
>>
>> So far I have this:
>>
>> baseline100: spec
>> <version: '1.0-baseline'>
>>
>> spec for: #common do: [
>> spec blessing: #baseline.
>> spec repository: 'http://www.SqueakSource/GraceParser'.
>> spec
>> package: 'Grace-Parser' with: [spec requires: 'PetitParser';
>> repository: 'http://source.lukas-renggli.ch/petit' ];
>> package: 'Grace-ParserTests' with: [spec requires: 'PetitTests-Core';
>> repository: 'http://source.lukas-renggli.ch/petit' ].
>> spec
>> group: 'default' with: #('Core' 'Tests');
>> group: 'Core' with: #('Grace-Parser');
>> group: 'Tests' with: #('Grace-ParserTests'). ].
>>
>> When I try to load: '1.0', I get a walkback with the message: 'Error: Name not found: PetitParser', so obviously I'm not describing the dependency correctly.
>>
>> What's the right way to define a dependency on a package in another repository?
>>
>>   Andrew
>>
>>
>>
>>
>> -----Original Message-----
>> From: [hidden email] [mailto:[hidden email]] On Behalf Of Stéphane Ducasse
>> Sent: 15 February 2011 15:24
>> To: A friendly place where any question about pharo is welcome
>> Subject: Re: [Pharo-users] Dependencies and Monticello
>>
>> Hi andrew
>>
>> Do not use dependencies.
>> They do not work well.
>> Use Metacello. Here is a draft I should finish on metacello.
>>
>>
>
> --
> Simon Denier
>
>
>
>


ConfigurationOfGrace.st (6K) Download Attachment