hpi-swa / smalltalkCI

Framework for testing Smalltalk projects with GitHub Actions, GitLab CI, Travis CI, AppVeyor, and others.
MIT License
94 stars 67 forks source link

SmalltalkCI overrides STON-Core in Squeak trunk #527

Open theseion opened 3 years ago

theseion commented 3 years ago

Squeak trunk (5.4) can't currently load any code. The reason for this appears to be a name clash of STON-Core. Squeak now comes with its own version of STON (https://github.com/squeak-smalltalk/squeak-ston) which includes a class names STONJSON which is need to load code from Tonel repositories. SmalltalkCI inadvertently replaces this package, thus removing STONJSON.

I suspect the SmalltalkCI baseline needs to be updated for 5.4 to exclude the STON package.

tom95 commented 3 years ago

Hey @theseion, do you have a link to a failing build to inspect? Generally, Squeak-trunk builds still work (or better: I just had one pass). STON has been added as a dependency of Metacello on Squeak a little while ago, to be able to read the .properties files so that it can identify when the Tonel format is in use.

theseion commented 3 years ago

Sure: https://travis-ci.org/github/theseion/Fuel/jobs/772071007.

I just rechecked that I didn't mess up and indeed, loading the SmalltalkCI baseline from a freshly updated Squeak trunk image has the effect of replacing the STON package:

Metacello new
    repository: 'filetree:///Users/cthulu/dev/git/smalltalkCI/repository';
    baseline: 'SmalltalkCI';
    load
tom95 commented 3 years ago

After some digging I came up with this: the core problem is that smalltalkCI for Squeak bundles its own STON, which overrides the more up-to-date version of STON installed by Metacello during bootstrapping.

A couple of factors are coming together here so that the error only rarely manifests:

The simplest fix might be something like this in smalltalkCI's squeak baseline:

Smalltalk at: #STON ifAbsent: [
  spec 
    package: 'STON-Core';
    package: 'STON-Tests'
" and then also adapt the dependencies accordingly "

but I'm not sure if this is necessarily good style.

The proper fix would most likely be to drop the version of STON that is bundled in smalltalkCI and ensure that we always load the most recent Metacello that comes with STON. As the images for squeak <=5.3 are cached we might even be able to just do the proper fix without incurring any damages. Gemstone and Pharo appear not to depend on the bundled STON but I would have to double check before removing anything for good :)

theseion commented 3 years ago

Thanks Tom. I think fixing the baseline is the proper way to go. We already have a similar strategy for Pharo. I've opened a PR with a proposed fix.