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

fix: make CI work and improve dev setup #18

Merged
merged 5 commits into from
Sep 12, 2024
Merged

Conversation

knarewski
Copy link
Contributor

Background
I wanted to work towards merging another PR into master

Problems
There were multiple issues with dev/CI setup:

  • The test matrix used floats instead of strings, meaning that ruby 2.0 wasn't tested at all
  • CI failed for Ruby 2.0 and 2.3 with the default gem resolution
  • Ruby 2.7 failed because of the latest bundler requiring ruby 3+
  • A dedicated Gemfile for docker image caused unnecessary duplication

Solutions

  • Drop official support for Ruby 2.0 & 2.3
  • Let setup-ruby action install bundler, as it handles the proper version resolution
  • Only include the relevant files when releasing the gem to drop dependency on git and to make the gem lighter
  • Use gemspec-based Gemfile when building dev environment for improved consistency and maintainability

Notes

Just using "gem install bundler" does not work with matrix setup out of the box, because
it always tries to install latest, which doesn't work for all the ruby versions
It seems that 2.0 was treated as integer, which resulted in testing on the latest 2.X version.
That could have been fixed, but there is also no reason to support ruby which is that ancient
Error on "ensures the dev environment image builds" job:
 #11 1.812 ffi-1.17.0-x86_64-linux-musl requires rubygems version >= 3.3.22, which is
 #11 1.812 incompatible with the current version, 3.1.6
 #11 ERROR: process "/bin/sh -c bundle install" did not complete successfully: exit code: 5

The rubygems version 3.4.22 is the last to support ruby 2.7.X
- copy gemspec dependencies to docker context before calling "bundle install"
- specify the desired gem paths by hand to avoid complains about missing git
cairo depends on unspecified version of red-colors, which uses `Comparable#clamp`, that is not supported
by ruby 2.3. We could lock red-colors manually, but ruby 2.3 causes more issues with the soon-incoming
changes, eg "undefined symbol: RB_NIL_P" when installing glib2-4.2.2
@knarewski knarewski requested review from MrLukeSmith and a team September 12, 2024 14:48
Copy link
Contributor

@MrLukeSmith MrLukeSmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see anything in the PR description explaining the specific version of RubyGems. I knew it would be somewhere, and of course it was. Found it in the commit message for the change. 😉

@knarewski knarewski merged commit 0561661 into master Sep 12, 2024
4 of 7 checks passed
@knarewski knarewski deleted the fix-ci-and-setup branch September 12, 2024 15:37
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

Successfully merging this pull request may close these issues.

2 participants