Howto BaselineOf

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

Re: Changing a BaselineOf... to include one more package

Sean P. DeNigris
Administrator
Andrew P. Black wrote
> I don’t know what else to try!

From the error message:
    Could not resolve: BaselineOfSmaCC-Reification... in
https://github.com/apblack/SmaCC.git[working]

I'm guessing that you can't load from two different branches of the same git
repo. Can you fork the project and create a new branch that merges in the
required changes from the 'working' and 'fglr' branches?



-----
Cheers,
Sean
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Changing a BaselineOf... to include one more package

AndrewBlack

> On 21 Jul 2018, at 08:22 , Sean P. DeNigris <[hidden email]> wrote:
>
> Andrew P. Black wrote
>> I don’t know what else to try!
>
> From the error message:
>    Could not resolve: BaselineOfSmaCC-Reification... in
> https://github.com/apblack/SmaCC.git[working]
>
> I'm guessing that you can't load from two different branches of the same git
> repo. Can you fork the project and create a new branch that merges in the
> required changes from the 'working' and 'fglr' branches?

Good trysuggestion Sean.  I think that there may indeed be some brokenness in the way that Pharo uses git, so that the branch spec in the baseline is not always obeyed.

So I switched both of the dependencies to be on the same branch (fglr), and for good measure switched my local repo to also be on that branch.

> spec
> baseline: 'SmaCC'
> with: [ spec repository: 'github://apblack/SmaCC:fglr' ].
> spec
> baseline: 'SmaCC-Reification'
> with: [ spec repository: 'github://apblack/SmaCC:fglr' ].

The result?  Nothing changes.  I still get a complaint

Could not resolve: BaselineOfSmaCC-Reification [BaselineOfSmaCC-Reification] in /Users/black/Development/Pharo/images/Pharo 7.0 SmallGrace 33/pharo-local/package-cache [hidden email]:apblack/SmaCC.git[fglr]

In the git directory I can see

> silverstone: ~/iceberg/apblack/SmaCC$ ls -d SmaCC-Reification.package/
> SmaCC-Reification.package/
> silverstone: ~/iceberg/apblack/SmaCC$ git br
> * fglr
>   ...


Is it supposed to be looking for `BaselineOfSmaCC-Reification` rather than for `SmaCC-Reification`?  There is no `BaselineOfSmaCC-Reification`, just a `BaselineOfSmaCC` that defines a group called `SmaCC-Refication`.  (I did try replacing baseline: ‘SmaCC-Reification’ by group: ‘SmaCC-Reification’ , but that gave a different error.)

        Andrew




Reply | Threaded
Open this post in threaded view
|

Re: Changing a BaselineOf... to include one more package

Sean P. DeNigris
Administrator
In reply to this post by Guillermo Polito
Guillermo Polito wrote
>> But then I must also specify the dependencies of the SmaCC-Reification
>> package, so I need to add
>>
>> spec package: 'SmaCC-Reification' with: [ spec requires:
>> #('SmaCC-Smalltalk-Parser' 'SmaCC-Runtime' 'SmaCC-Java') ]

AFAICT this is not necessary because these dependencies are declared in
BaselineOfSmaCC. In fact the whole point of Metacello is that you can refer
just to the specific entity within a project you want to load and Metacello
should take care of bringing along all its dependencies.



-----
Cheers,
Sean
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Changing a BaselineOf... to include one more package

Sean P. DeNigris
Administrator
In reply to this post by AndrewBlack
Andrew Black-2 wrote
>> spec
>> baseline: 'SmaCC-Reification'
>> with: [ spec repository: 'github://apblack/SmaCC:fglr' ].

This line will not work. What you're saying here is load a BaselineOfXyz
where Xyz = 'SmaCC-Reification'. In fact you want to load the package. I
think you can just change the keyword #basline: to #package:, although SmaCC
has a 'Reification' group, which might be better. In any event, if you just
want to make sure that the 'SmaCC-Reification' package is loaded when you
load SmaCC, then I think what you're after is:
  spec
  baseline: 'SmaCC' with: [ spec loads: #('Reification' ) ]

I think the above would replace both of your SmaCC-related lines (you can
specify multiple entities in to #loads: if needed.

NB. the preferred syntax in a baseline is literal arrays like above i.e. #()
instead of curly-brace runtime arrays like {'Grace-Tests' . 'Grace-Ast'}



-----
Cheers,
Sean
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: Changing a BaselineOf... to include one more package

AndrewBlack

On 22 Jul 2018, at 19:35 , Sean P. DeNigris <[hidden email]> wrote:

Andrew Black-2 wrote
spec
baseline: 'SmaCC-Reification' 
with: [ spec repository: '<a href="github://apblack/SmaCC:fglr'" class="">github://apblack/SmaCC:fglr' ].

This line will not work. What you're saying here is load a BaselineOfXyz
where Xyz = 'SmaCC-Reification'. In fact you want to load the package. I
think you can just change the keyword #basline: to #package:, although SmaCC 
has a 'Reification' group, which might be better. In any event, if you just
want to make sure that the 'SmaCC-Reification' package is loaded when you
load SmaCC, then I think what you're after is:
spec
baseline: 'SmaCC' with: [ spec loads: #('Reification' ) ]

I think the above would replace both of your SmaCC-related lines (you can
specify multiple entities in to #loads: if needed.

NB. the preferred syntax in a baseline is literal arrays like above i.e. #()
instead of curly-brace runtime arrays like {'Grace-Tests' . 'Grace-Ast'}


Thanks for the suggestions.  But now I am more confused than ever!  Can you tell me what this line actually means.  That is, what does the #baseline:with: method actually declare?  Where should I put this statement?  In baselineOfSmaCC, or baselineOfGrace?  Why?

Note that the SmaCC-Reification package is not part of the current normal load for SmaCC — that’s why I have to specify it separately.  Is this declaration saying the opposite?  If not, what is it saying?

Earlier, you wrote:

spec package: 'SmaCC-Reification' with: [ spec requires:
#('SmaCC-Smalltalk-Parser' 'SmaCC-Runtime' 'SmaCC-Java') ]

AFAICT this is not necessary because these dependencies are declared in
BaselineOfSmaCC.

These declarations are the very lines from baselineOfSmaCC that declare these dependencies — aren’t they?  If I take them out, how will Metacello know that loading SmaCC-Reification requires the three packages listed in the array?

I’m sorry if I sound frustrated — none of this makes any sense to me.  There seems to be no documentation other than the very high-level stuff that describes th eoverall purpose of package dependencies — which I think that I understand.    

Andrew


  
Reply | Threaded
Open this post in threaded view
|

Re: Changing a BaselineOf... to include one more package

Sean P. DeNigris
Administrator
Andrew Black-2 wrote
>> spec
>> baseline: 'SmaCC' with: [ spec loads: #('Reification' ) ]
>
> Can you tell me what this line actually means.  That is, what does the
> #baseline:with: method actually declare?

It means load the 'Reification' group of the SmaCC project, as specified in
BaselineOfSmaCC. The 'Reification' group includes the SmaCC-Reification
package, and by extension its dependencies as specified by the baseline.


Andrew Black-2 wrote
> Where should I put this statement?  In baselineOfSmaCC, or
> baselineOfGrace?  Why?

baselineOfGrace. You're saying that SmaCC (specifically the Reification
group) is a dependency of Grace. You should probably also add Smacc the the
#requires: list of whatever (e.g. package(s)) requires it.

Deep into Pharo (http://books.pharo.org/deep-into-pharo/) Chapter 9 gives a
pretty good explanation of much of Metacello. Ignore the gopher stuff which
has been replaced by the Metacello scripting API. Also, the book was written
when baseline methods were in Configuration classes, whereas now for git
they are reified into BaselineOf classes, but the API of the actual method
is still the same so it should help clarify.



-----
Cheers,
Sean
--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html

Cheers,
Sean
12