Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project Dependencies: Use #stable versions in Basline and numbered versions in Config #1

Open
seandenigris opened this issue Mar 21, 2016 · 3 comments

Comments

@seandenigris
Copy link
Owner

There was a pattern in pre-BaselineOf Metacello where one would define
dependencies loosely in the #baselineXyz:, and then pin them to a specific
version in the #versionAbc:.

For example:

ConfigurationOfBabyPhexample>>#baseline100: spec
        ...
        project: 'BabyMock' with: [
                spec
                        className: #ConfigurationOfBabyMock;
                        versionString: #'stable';
                        repository: 'http://smalltalkhub.com/mc/zeroflag/BabyMock/main/' ]
        ...

and then:

ConfigurationOfBabyPhexample>>#version10: spec
        ...
        spec
                project: 'BabyMock' with: '1.2'
        ...

How does one handle this sort of thing with #baseline:import:?

This is what I came up with…

In the BaselineOf:

BaselineOfBabyPhexample>>#baseline:project: 'BabyMock' with: [
        spec ... versionString: #'stable' … ];

And then in the ConfigurationOf:
```smalltalk
ConfigurationOfBabyPhexample>>#version10: spec
        ...
        baseline: 'BabyPhexample'
                with: [
                      spec
                        repository:

'github://seandenigris/Baby-Phexample:INSERT-SHA-HERE/repository' ].
                spec
                        project: 'BabyMock' with: '1.2'
        ...

But I got this error from the last line: MessageNotUnderstood: receiver of "fetchUsing:" is nil.
Then I changed the last line to:

    spec
        project: 'BabyMock' with: [ 
            spec
                className: #'ConfigurationOfBabyMock';
                versionString: '1.2' ]

And there was no error, but ConfigurationOfBabyPhexample project stableVersion record loadDirective. reports that the #stable version of BabyMock (1.3) will be loaded loaded instead of the version 1.2 that I specified in my configuration.

@seandenigris
Copy link
Owner Author

As a workaround, I guess when I want to release I could:

  1. Commit a baseline with specific versions of dependencies
  2. Reference the commit from the Config
  3. Change the baseline back to depending on #stable or #development or whatever

A bit tedious but replicates the previous behavior…

@dalehenrich
Copy link

@seandenigris ... first off you've got an error in your BabyPhexample baseline, you are using a symbol not a string ... I know that Pharo treats strings and symbols exactly the same, but it's a bad habit to get into --- using Strings and Symbols interchangeably ...

@dalehenrich
Copy link

Secondly, the fact the BabyMock 1.3 is being loaded implies that Metacello thinks that BabyMock 1.3 is already loaded ... I'd need to see a transcript log to be sure ... Are you doing loads using Metacello new or are you using the "should be obsolete" method of sending #load to a configuration? If you are using the latter, then depending upon the BabyMock configuration and dependencies, Metacello could just be guessing wrong ... if you use the former, Metacllo does't guess about which version of a project is loaded as the versions are recorded ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants