How to force a BaselineOf to load ?

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

How to force a BaselineOf to load ?

Sven Van Caekenberghe-2
Hi,

I have a Pharo 4 (#40627) image that already contains P3. Now I want to update P3, without completely rebuilding this image from scratch.

It seems as if an expression like

Metacello new
  baseline: 'P3';
  repository: 'github://svenvc/P3';
  load.

executed like

$ ../bin/pharo build-trackit.image eval --save "Metacello new baseline: 'P3'; repository: 'github://svenvc/P3'; load"

does not really reload the code. How can I force it to (re)load ?

Thx,

Sven
Reply | Threaded
Open this post in threaded view
|

Re: How to force a BaselineOf to load ?

CyrilFerlicot
On Tue, Feb 6, 2018 at 4:22 PM, Sven Van Caekenberghe <[hidden email]> wrote:
> Hi,
>
Hi,

> I have a Pharo 4 (#40627) image that already contains P3. Now I want to update P3, without completely rebuilding this image from scratch.
>
> It seems as if an expression like
>
> Metacello new
>   baseline: 'P3';
>   repository: 'github://svenvc/P3';
>   load.
>
> executed like
>
> $ ../bin/pharo build-trackit.image eval --save "Metacello new baseline: 'P3'; repository: 'github://svenvc/P3'; load"
>
> does not really reload the code. How can I force it to (re)load ?
>
IIRC, Dale worked on Metacello to introduce a new project kind in the
baseline to manage this problem.

See thread:
http://forum.world.st/ANN-Metacello-support-for-GitFileTree-metadata-less-mode-td4906662.html

So you need to implement this method in the baseline:

projectClass

    ^ MetacelloCypressBaselineProject

Quoted from Dale
(http://forum.world.st/unsolicited-package-cache-use-td5060335.html
Jan 18, 2018; 4:10pm):
«if not, then what looks like a package-cache problem could be that
you haven't told Metacello that you are using a metadataless
filetree/tonel repository.

Metacello has an internal rule to not load Monticello packages of the
same version, since they are already loaded. However, when using
metadataless repositories the filetree/tonel Monticello package
readers typically generate a package name using the author/version
`-cypress.1`, which make Metacello think that the versions are the
same and the package is not loaded ... by including the above method
in your baselineof, Metacello will know to ignore the Monticello
author/version of the package and always load it....

Of course, because Monticello only installs changed definitions when
loading a package, "loading the same package over and over again"
costs a little bit in loading the _definitions_ into the image from
disk, but doesn't end up compiling any new methods or creating new
classes ...»
BUT! Because there is a but... This is not present by default in
Pharo... To get it, we need to upgrade Matacello :(


> Thx,
>
> Sven



--
Cyril Ferlicot
https://ferlicot.fr

Reply | Threaded
Open this post in threaded view
|

Re: How to force a BaselineOf to load ?

Sven Van Caekenberghe-2
Thanks Cyril, I think I understand. I saw you opened an issue for this.

I am working on upgrading my builds for pharo 7.

> On 7 Feb 2018, at 15:12, Cyril Ferlicot <[hidden email]> wrote:
>
> On Tue, Feb 6, 2018 at 4:22 PM, Sven Van Caekenberghe <[hidden email]> wrote:
>> Hi,
>>
> Hi,
>
>> I have a Pharo 4 (#40627) image that already contains P3. Now I want to update P3, without completely rebuilding this image from scratch.
>>
>> It seems as if an expression like
>>
>> Metacello new
>>  baseline: 'P3';
>>  repository: 'github://svenvc/P3';
>>  load.
>>
>> executed like
>>
>> $ ../bin/pharo build-trackit.image eval --save "Metacello new baseline: 'P3'; repository: 'github://svenvc/P3'; load"
>>
>> does not really reload the code. How can I force it to (re)load ?
>>
> IIRC, Dale worked on Metacello to introduce a new project kind in the
> baseline to manage this problem.
>
> See thread:
> http://forum.world.st/ANN-Metacello-support-for-GitFileTree-metadata-less-mode-td4906662.html
>
> So you need to implement this method in the baseline:
>
> projectClass
>
>    ^ MetacelloCypressBaselineProject
>
> Quoted from Dale
> (http://forum.world.st/unsolicited-package-cache-use-td5060335.html
> Jan 18, 2018; 4:10pm):
> «if not, then what looks like a package-cache problem could be that
> you haven't told Metacello that you are using a metadataless
> filetree/tonel repository.
>
> Metacello has an internal rule to not load Monticello packages of the
> same version, since they are already loaded. However, when using
> metadataless repositories the filetree/tonel Monticello package
> readers typically generate a package name using the author/version
> `-cypress.1`, which make Metacello think that the versions are the
> same and the package is not loaded ... by including the above method
> in your baselineof, Metacello will know to ignore the Monticello
> author/version of the package and always load it....
>
> Of course, because Monticello only installs changed definitions when
> loading a package, "loading the same package over and over again"
> costs a little bit in loading the _definitions_ into the image from
> disk, but doesn't end up compiling any new methods or creating new
> classes ...»
> BUT! Because there is a but... This is not present by default in
> Pharo... To get it, we need to upgrade Matacello :(
>
>
>> Thx,
>>
>> Sven
>
>
>
> --
> Cyril Ferlicot
> https://ferlicot.fr