Getting from GitBrowser to the System Browser

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

Re: Getting from GitBrowser to the System Browser

Tom Beckmann
It looks like Jakob beat me by a couple of seconds :D

Concerning the MCStReader error, have a look at this Inbox commit to fix it locally in your image for the moment :)

On Sun, Oct 4, 2020 at 3:14 PM Tom Beckmann <[hidden email]> wrote:
Hi timothy,

first, on the Array>>\ error, this is likely because you somehow ended up with the master instead of the squeak branch of squeak-tonel. I would recommend to manually unload all three tonel packages using the Monticello Browser and then running:
Metacello new
     repository: 'github://squeak-smalltalk/squeak-tonel:squeak';
     baseline: 'Tonel';
     load.

On Metacello vs Git and the general workflow:
- from my understanding, it is generally recommendable to first install a package using Metacello as it takes care to resolve and install third-party dependencies you may not want to care about
- Metacello is, however, end-user oriented if you will; the sources are stored in a github-cache folder, which only exists for caching purposes. My usual workflow is thus, after installing the desired package once using Metacello, to clone the main repo (the repo that I actually care about) again using the GitBrowser and do a checkout on the most recent commit on master; this should leave things unchanged provided that Metacello also installed the version from the master branch
- You can then work in your image and adapt things as needed; when you have a working increment, you can use the GitBrowser again to create commits and push them Github, typically to a fork that belongs to you and then place a pull request

You can skip Metacello if you clone all dependencies using the GitBrowser and install them one after the other in the right order. If you look at the many dependencies of for example Roassal [1], it will however be pretty obvious why you would usually want to have Metacello automate this for you.

Hope this helps you to get started. Please feel free to ask again if I left something unanswered or if you feel like the workflow should be easier in some way. Maybe there is something we can improve :)

Best,
Tom


On Sun, Oct 4, 2020 at 2:34 PM gettimothy via Squeak-dev <[hidden email]> wrote:
Hi folks,

backing up from the specifics and looking at the "correct" way to go about this so we are all on the same page.

Could you please check my assumptions as this Git stuff in squeak is new to me.


If we have the Git, why do we need the Metacello? Can/should we do all the work in the Git and then when it is done, do the Metacello?


Assuming "doing all the work in Git" is the way to go...

Is just "working through the baseline" and getting things in the system a good approach?

Thoughts?

thx

tty




Reply | Threaded
Open this post in threaded view
|

Re: Getting from GitBrowser to the System Browser

Squeak - Dev mailing list
In reply to this post by Jakob Reschke

Jacob and Tom

I have both your workflow responses saved to workspaces that I have filed out to work by.

Where do you guys store your cloned repos? I put mine in git-cache and that appears to conflict with what Metacello gets.


Ok, "its a loop" meaning that the MetacelloConfiguration is created from the Git repo with data from the BaselineOfFoo   somehow. 
The Metacello is loaded.
Git is cloned.
You do the smalltalk-git dance by checkout objects which takes them from git and puts them in the image.
Tools are available to diff.

So, I think it is best that I match your workflows to avoid confusion as we progress.

Ok, gotta solve the Metacello "somehow" before getting the git.

I will do that on a pristine image.

thx again.






---- On Sun, 04 Oct 2020 09:13:44 -0400 Jakob Reschke <[hidden email]> wrote ----

Hi,

Loading the repository packages with Git will only load the packages
that belong to Roassal, but not its dependencies (other third-party
packages) if any. To get the dependencies, Metacello is used.
(Moreover the Metacello baseline could indicate that some packages are
only relevant for Pharo version x and others for Pharo version y, or
others for Squeak version z. I suppose that is something Tom has been
modifying for his *-Squeak package.)

So I would recommend: first install the software via Metacello, then
start using Git on the loaded packages. It does not really matter
whether you initialize the Git project before or after loading with
Metacello. That is because currently the Clone action does not load
the packages into the image (you would still have to "Checkout
objects" after cloning). I should probably change that in the future.
If you Add the repository instead of Clone, nothing will be loaded at
first either.

After you have both loaded the code via Metacello and set up the Git
repository, check whether there are any differences between your image
and what is on the active branch (the one with the green dot) by
pushing the Commit button or right-clicking the top commit or active
branch and choosing "Compare with working copy".

If there are differences and if that is because a different branch or
commit was used in the Metacello load, you have some options to fix
the situation:
1) Identify the correct branch that you installed via Metacello. Then
shift+right-click on the branch and choose "Make this the current
branch". This will change the active branch, but not make any changes
to the loaded classes (similar to Reparent in Monticello).
2) If there is no branch, identify the commit that matches what you
installed, find it in the commit list, right-click on it and choose
"Create new branch at this commit". Then proceed with option 1.
3) Overwrite the loaded classes with the state of the active branch:
right-click on the top commit and choose "Checkout objects".

If you do not use Metacello, you must collect the dependencies
manually and load them with Git or Monticello in the correct order. To
find the dependencies, you would read the baseline(s) and thus follow
the dependency graph.

Kind regards,
Jakob

Am So., 4. Okt. 2020 um 14:34 Uhr schrieb gettimothy <[hidden email]>:

>
> Hi folks,
>
> backing up from the specifics and looking at the "correct" way to go about this so we are all on the same page.
>
> Could you please check my assumptions as this Git stuff in squeak is new to me.
>
>
> If we have the Git, why do we need the Metacello? Can/should we do all the work in the Git and then when it is done, do the Metacello?
>
>
> Assuming "doing all the work in Git" is the way to go...
>
> Is just "working through the baseline" and getting things in the system a good approach?
>
> Thoughts?
>
> thx
>
> tty
>




Reply | Threaded
Open this post in threaded view
|

Re: Getting from GitBrowser to the System Browser

Jakob Reschke
Am So., 4. Okt. 2020 um 15:39 Uhr schrieb gettimothy <[hidden email]>:
>
> Where do you guys store your cloned repos? I put mine in git-cache and that appears to conflict with what Metacello gets.
>

Basically any place goes if it is not already used by something else.
The git-cache directory is "already used by" Metacello.

I have my repositories under a Squeak folder in My Documents, for
example. You could also check them out next to the image if you like.

>
> Ok, "its a loop" meaning that the MetacelloConfiguration is created from the Git repo with data from the BaselineOfFoo   somehow.

The baseline is manually written by the maintainer of the repository.
Metacello downloads the zip snapshot of the code and reads the
baseline class first, to determine what to load into the image.
Originally Metacello works with baselines and configurations, where
the baselines specify which packages and dependencies there are and
the configurations specify which versions of the stuff from a baseline
to load. But in a Git repository, each commit is exactly one
configuration of the contained packages. That's why only a baseline is
needed for Git projects. This baseline should specify the versions or
branches/commits of the dependencies, though.

Reply | Threaded
Open this post in threaded view
|

Re: Getting from GitBrowser to the System Browser

Squeak - Dev mailing list
In reply to this post by Tom Beckmann
Hi Tom,

Still having problems loading Roassal3 via Metacello

Here are my steps:

pristine image

Preference Wizard last page install git, refactor etc.

Installer ensureRecentMetacello

SquitAddRemote >>remoteName

^ remoteName ifNil: [String empty] ifNotNil: [remoteName asString]

Manually unload all three tonel packages using the Monticello Browser

MonticelloTonel-Core
MonticelloTonel-FileSystem
MonticelloTonel-Tests



and then running:
Metacello new
     repository: 'github://squeak-smalltalk/squeak-tonel:squeak';
     baseline: 'Tonel';
     load.


Metacello new
    baseline: 'Roassal3';
    repository: 'github://tom95/Roassal3';
    load.
GoferRepositoryError: UndefinedObject>>directoryFromPath:relativeTo:

from MetacelloFetchingMCSPecLoader >> linearLoadPackageSpec: gover:


this call here:     

references := self
        retryingResolvePackageSpecReferences: packageSpec
        gofer: gofer. "look up mcz file"
Transcript shows:

...RETRY->BaselineOfRoassal3
...RETRY->BaselineOfRoassal3
gofer repository error: 'GoferRepositoryError: UndefinedObject>>directoryFromPath:relativeTo:'...ignoring
...FAILED->BaselineOfRoassal3

I am on 9.0 alpha...should I try a 5.3 image?

cheers.





---- On Sun, 04 Oct 2020 09:17:54 -0400 Tom Beckmann <[hidden email]> wrote ----

It looks like Jakob beat me by a couple of seconds :D

Concerning the MCStReader error, have a look at this Inbox commit to fix it locally in your image for the moment :)

On Sun, Oct 4, 2020 at 3:14 PM Tom Beckmann <[hidden email]> wrote:
Hi timothy,

first, on the Array>>\ error, this is likely because you somehow ended up with the master instead of the squeak branch of squeak-tonel. I would recommend to manually unload all three tonel packages using the Monticello Browser and then running:
Metacello new
     repository: 'github://squeak-smalltalk/squeak-tonel:squeak';
     baseline: 'Tonel';
     load.

On Metacello vs Git and the general workflow:
- from my understanding, it is generally recommendable to first install a package using Metacello as it takes care to resolve and install third-party dependencies you may not want to care about
- Metacello is, however, end-user oriented if you will; the sources are stored in a github-cache folder, which only exists for caching purposes. My usual workflow is thus, after installing the desired package once using Metacello, to clone the main repo (the repo that I actually care about) again using the GitBrowser and do a checkout on the most recent commit on master; this should leave things unchanged provided that Metacello also installed the version from the master branch
- You can then work in your image and adapt things as needed; when you have a working increment, you can use the GitBrowser again to create commits and push them Github, typically to a fork that belongs to you and then place a pull request

You can skip Metacello if you clone all dependencies using the GitBrowser and install them one after the other in the right order. If you look at the many dependencies of for example Roassal [1], it will however be pretty obvious why you would usually want to have Metacello automate this for you.

Hope this helps you to get started. Please feel free to ask again if I left something unanswered or if you feel like the workflow should be easier in some way. Maybe there is something we can improve :)

Best,
Tom


On Sun, Oct 4, 2020 at 2:34 PM gettimothy via Squeak-dev <[hidden email]> wrote:
Hi folks,

backing up from the specifics and looking at the "correct" way to go about this so we are all on the same page.

Could you please check my assumptions as this Git stuff in squeak is new to me.


If we have the Git, why do we need the Metacello? Can/should we do all the work in the Git and then when it is done, do the Metacello?


Assuming "doing all the work in Git" is the way to go...

Is just "working through the baseline" and getting things in the system a good approach?

Thoughts?

thx

tty






Reply | Threaded
Open this post in threaded view
|

Re: Getting from GitBrowser to the System Browser

Squeak - Dev mailing list
Ok, spun up a fresh 5.3 and ran the steps as below on the 6 alpha.

Same error.

I will hit it again next weekend when I have a functioning brain.

Thanks for all your help. much appreciated.




---- On Sun, 04 Oct 2020 10:31:16 -0400 gettimothy via Squeak-dev <[hidden email]> wrote ----

Hi Tom,

Still having problems loading Roassal3 via Metacello

Here are my steps:

pristine image

Preference Wizard last page install git, refactor etc.

Installer ensureRecentMetacello

SquitAddRemote >>remoteName

^ remoteName ifNil: [String empty] ifNotNil: [remoteName asString]

Manually unload all three tonel packages using the Monticello Browser

MonticelloTonel-Core
MonticelloTonel-FileSystem
MonticelloTonel-Tests



and then running:
Metacello new
     repository: 'github://squeak-smalltalk/squeak-tonel:squeak';
     baseline: 'Tonel';
     load.


Metacello new
    baseline: 'Roassal3';
    repository: 'github://tom95/Roassal3';
    load.
GoferRepositoryError: UndefinedObject>>directoryFromPath:relativeTo:

from MetacelloFetchingMCSPecLoader >> linearLoadPackageSpec: gover:


this call here:     

references := self
        retryingResolvePackageSpecReferences: packageSpec
        gofer: gofer. "look up mcz file"
Transcript shows:

...RETRY->BaselineOfRoassal3
...RETRY->BaselineOfRoassal3
gofer repository error: 'GoferRepositoryError: UndefinedObject>>directoryFromPath:relativeTo:'...ignoring
...FAILED->BaselineOfRoassal3

I am on 9.0 alpha...should I try a 5.3 image?

cheers.





---- On Sun, 04 Oct 2020 09:17:54 -0400 Tom Beckmann <[hidden email]> wrote ----

It looks like Jakob beat me by a couple of seconds :D

Concerning the MCStReader error, have a look at this Inbox commit to fix it locally in your image for the moment :)

On Sun, Oct 4, 2020 at 3:14 PM Tom Beckmann <[hidden email]> wrote:
Hi timothy,

first, on the Array>>\ error, this is likely because you somehow ended up with the master instead of the squeak branch of squeak-tonel. I would recommend to manually unload all three tonel packages using the Monticello Browser and then running:
Metacello new
     repository: 'github://squeak-smalltalk/squeak-tonel:squeak';
     baseline: 'Tonel';
     load.

On Metacello vs Git and the general workflow:
- from my understanding, it is generally recommendable to first install a package using Metacello as it takes care to resolve and install third-party dependencies you may not want to care about
- Metacello is, however, end-user oriented if you will; the sources are stored in a github-cache folder, which only exists for caching purposes. My usual workflow is thus, after installing the desired package once using Metacello, to clone the main repo (the repo that I actually care about) again using the GitBrowser and do a checkout on the most recent commit on master; this should leave things unchanged provided that Metacello also installed the version from the master branch
- You can then work in your image and adapt things as needed; when you have a working increment, you can use the GitBrowser again to create commits and push them Github, typically to a fork that belongs to you and then place a pull request

You can skip Metacello if you clone all dependencies using the GitBrowser and install them one after the other in the right order. If you look at the many dependencies of for example Roassal [1], it will however be pretty obvious why you would usually want to have Metacello automate this for you.

Hope this helps you to get started. Please feel free to ask again if I left something unanswered or if you feel like the workflow should be easier in some way. Maybe there is something we can improve :)

Best,
Tom


On Sun, Oct 4, 2020 at 2:34 PM gettimothy via Squeak-dev <[hidden email]> wrote:
Hi folks,

backing up from the specifics and looking at the "correct" way to go about this so we are all on the same page.

Could you please check my assumptions as this Git stuff in squeak is new to me.


If we have the Git, why do we need the Metacello? Can/should we do all the work in the Git and then when it is done, do the Metacello?


Assuming "doing all the work in Git" is the way to go...

Is just "working through the baseline" and getting things in the system a good approach?

Thoughts?

thx

tty









Reply | Threaded
Open this post in threaded view
|

Re: Getting from GitBrowser to the System Browser . + Woot!

Squeak - Dev mailing list
In reply to this post by Jakob Reschke
Hi folks

I have been hunting down why my 

Transcript clear.
Metacello new
    repository: 'github://tom95/Roassal3';
    baseline: 'Roassal3';
    load.

is erroring out.

Here is the initial process which I have done:
pristine image

Preference Wizard last page install git, refactor etc.

Installer ensureRecentMetacello

SquitAddRemote >>remoteName

^ remoteName ifNil: [String empty] ifNotNil: [remoteName asString]

Manually unload all three tonel packages using the Monticello Browser

MonticelloTonel-Core
MonticelloTonel-FileSystem
MonticelloTonel-Tests



and then running:
Metacello new
     repository: 'github://squeak-smalltalk/squeak-tonel:squeak';
     baseline: 'Tonel';
     load.

A couple of things.

TonelFileUtils install
is not being automatically run . this populates the Current class instance variable needed or the TonelFilueUtils > current class side call.

Then, in 

TonelRepository >> directoryFromFileName: aString
"Answer the reference to the directory represented by the 'file name'."
^ self fileUtils
directoryFromPath: (self class directoryNameFromFileName: aString)
relativeTo: self directory

is throwing an SubclassResponsibility signal because 

TonelFileUtils class >> directoryFromPath: directoryPath relativeTo: aDirectory    self subclassResponsibility
What I presume we want is a TonelFileSystemUtils...

so....in 


TonelFileUtils class >> install    Current := self
make it:


TonelFileUtils class >>install    Current := TonelFileSystemUtils

Install proceeds as previously described and

RSChartExample new example01Markers open.

works.

Woot!



Reply | Threaded
Open this post in threaded view
|

TonelFileSystemutils initialize not being run automatically?

Squeak - Dev mailing list
Hi folks,

Yesterday, I wrote:


A couple of things.

TonelFileUtils install
is not being automatically run . this populates the Current class instance variable needed or the TonelFilueUtils > current class side call.

Then, in 

TonelRepository >> directoryFromFileName: aString
"Answer the reference to the directory represented by the 'file name'."
^ self fileUtils
directoryFromPath: (self class directoryNameFromFileName: aString)
relativeTo: self directory

is throwing an SubclassResponsibility signal because 

TonelFileUtils class >> directoryFromPath: directoryPath relativeTo: aDirectory    self subclassResponsibility
What I presume we want is a TonelFileSystemUtils...

so....in 


TonelFileUtils class >> install    Current := self
make it:


TonelFileUtils class >>install    Current := TonelFileSystemUtils



Well, this morning I took a look at TonelFileSystemUtils and it has a class side initialize method.

Run that and the 'self' referred to by Current is correct.

That tells me that the "initialize" method of TonelFileSystemUtils is not being run upon installation.




cheers,

t



Reply | Threaded
Open this post in threaded view
|

Re: TonelFileSystemutils initialize not being run automatically?

marcel.taeumel
Hi all --

That tells me that the "initialize" method of TonelFileSystemUtils is not being run upon installation.

A class-side #initialize is run only if (a) added to the system or (b) changed. I suppose that that "Current" will be overwritten somewhere during the initial set up? I mean, *after* it was evaluated once.

Best,
Marcel

Am 11.10.2020 09:40:45 schrieb gettimothy via Squeak-dev <[hidden email]>:

Hi folks,

Yesterday, I wrote:


A couple of things.

TonelFileUtils install
is not being automatically run . this populates the Current class instance variable needed or the TonelFilueUtils > current class side call.

Then, in 

TonelRepository >> directoryFromFileName: aString
"Answer the reference to the directory represented by the 'file name'."
^ self fileUtils
directoryFromPath: (self class directoryNameFromFileName: aString)
relativeTo: self directory

is throwing an SubclassResponsibility signal because 

TonelFileUtils class >> directoryFromPath: directoryPath relativeTo: aDirectory    self subclassResponsibility
What I presume we want is a TonelFileSystemUtils...

so....in 


TonelFileUtils class >> install    Current := self
make it:


TonelFileUtils class >>install    Current := TonelFileSystemUtils



Well, this morning I took a look at TonelFileSystemUtils and it has a class side initialize method.

Run that and the 'self' referred to by Current is correct.

That tells me that the "initialize" method of TonelFileSystemUtils is not being run upon installation.




cheers,

t



12