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

[CI] test.yml - use bundle exec, use setup-ruby bundler-cache, fixes Windows issue #758

Merged
merged 1 commit into from May 9, 2024

Conversation

MSP-Greg
Copy link
Contributor

@MSP-Greg MSP-Greg commented May 8, 2024

I saw this comment, which referred to failing tests on Windows for Ruby 3.0 thru 3.2.

I'm not exactly sure what the issue is, as it involves setup-ruby updating Bundler without updating RubyGems, which is done to some Windows Rubies due to a lack of a bash bin/bundle file.

Also, at present, two items:

  1. CI is using Bundler with a Gemfile, but it's not using bundle exec. This works, as Bundler defaults to installing gems such that one doesn't need bundle exec.

  2. Because of the above, every CI job is downloading and installing the gems, although setup-ruby can cache them.

This PR removes the bundle install step, and uses setup-ruby's bundler-cache option. It also runs steps with bundle exec.

All jobs passed in my fork...

@MSP-Greg
Copy link
Contributor Author

MSP-Greg commented May 8, 2024

This PR just removes the Actions 'depends/bundle install' step from the 'test' group. I left it in the 'test-openssls' group.

All the jobs in 'test-openssls' group use the same OS and Ruby version/platform (Ubuntu 22.04 & Ruby 3.0), so I believe all the jobs would have the same 'cache key' used for the gem cache. I suspect if the cache is a 'full match', so all jobs are only reading it, things would be fine.

But, if the cache needed to be updated, and multiple concurrent jobs try to update it, interesting things might happen. Since all of its jobs are passing, I left as is.

@MSP-Greg
Copy link
Contributor Author

MSP-Greg commented May 8, 2024

See #759, which also fixes this problem

@rhenium
Copy link
Member

rhenium commented May 9, 2024

Thank you for digging into it. Looking at rubygems/rubygems#7638, it's likely an issue in Bundler. [It's strange I can't reproduce it on my locally installed Ruby 3.2 (RubyGems 3.4.19) and Bundler 2.5.10, by the way. Bundler::SharedHelpers is correctly autoloaded for me.]

  1. CI is using Bundler with a Gemfile, but it's not using bundle exec. This works, as Bundler defaults to installing gems such that one doesn't need bundle exec.

  2. Because of the above, every CI job is downloading and installing the gems, although setup-ruby can cache them.

Regardless, these changes make perfect sense. Thank you!

@rhenium rhenium merged commit 818aa9f into ruby:master May 9, 2024
54 checks passed
@MSP-Greg
Copy link
Contributor Author

MSP-Greg commented May 9, 2024

it's likely an issue in Bundler

Agreed. Since RubyGems and Bundler are 'separate' gems, this issue seems to only exist with certain combinations of the two.

And, since there's no guarantee of what combination a user may have installed...

@MSP-Greg MSP-Greg deleted the 00-ci-windows branch May 12, 2024 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants