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] Add Ruby 3.1, OS to numeric, Windows #491

Closed
wants to merge 1 commit into from

Conversation

MSP-Greg
Copy link
Contributor

@MSP-Greg MSP-Greg commented Jan 15, 2022

The Actions windows-2016 & 2019 images have mingw build tools installed. The new windows-2022 image only has a bash shell and pacman installed.

So, when using the windows-2022 image, ruby/setup-ruby now installs the mingw64 or ucrt64 toolsets. Since the additional size of the packages needed to build Ruby is negligible, those packages are also installed. This means that the only reason for using MSP-Greg/setup-ruby-pkgs is the Windows mswin build.

Since the code for that is rather simple (install openssl-dev, etc), I switched to ruby/setup-ruby and added a short PowerShell script to account for the mswin job.

EDIT: There are some excepts to the above, but only with Windows Rubies 2.4 and earlier. If one needs to build with OpenSSL on 2.4, MSP-Greg/setup-ruby-pkgs needs to be used, as 2.4 was built with OpenSSL 1.0.2. Windows Ruby 2.3 and earlier need MSP-Greg/setup-ruby-pkgs for all package installations, and there are very few available (they were built with MSYS, not MSYS2).

@rhenium
Copy link
Member

rhenium commented Jan 19, 2022

Thank you always.

If I understand this correctly, the current workflows will start to break without applying the changes in this PR.

ref. GitHub Actions: Jobs running on windows-latest are now running on Windows Server 2022. | GitHub Changelog

We still need to maintain gem versions 2.1 and onwards for some time, until Ruby 2.7 reaches its EOL. Could you change the target branch to maint-2.1?

@MSP-Greg
Copy link
Contributor Author

MSP-Greg commented Jan 19, 2022

Thanks for all your work with OpenSSL 3. I'm not that deep into SSL/crypto, but I know enough to know it's far from trivial.

Could you change the target branch to maint-2.1?

Yes.

EDIT: Sorry, I said yes before I looked at the branch. This PR should be against master and/or maybe maint-2.2. maint-2.1 is using older Rubies, so it still requires MSP-Greg/setup-ruby-pkgs for the older Rubies. I can do a PR for that?

the current workflows will start to break without applying the changes in this PR.

When windows-latest switches to windows-2022, only the Windows mswin job will break. See https://bugs.ruby-lang.org/issues/18362.

There have been quite a few changes recently related to Actions CI.

  • Windows Ruby 3.1 is ucrt, while 3.0 is mingw.
  • Actions windows-2022 has no MSYS2 build tools; windows-2019 has mingw tools, but ucrt tools will not be added.
  • Issues with Bundler/RubyGems, dependent on what is in one's Gemfile.

Previously when using Actions and windows-2016/2019, installing build tools required using MSP-Greg/setup-ruby-pkgs or writing pacman commands.

Since windows-2022 has no build tools, ruby/setup-ruby is installing the tools. Further, to maintain parity with Ubuntu/macOS, I decided that, in addition to build tools, all packages needed to build Ruby 2.5 and later will also be added. This also means that MSP-Greg/setup-ruby-pkgs may not be needed.

So, with windows-2022 and Ruby >= 2.5, ruby/setup-ruby installs OpenSSL 1.1.1. And, yes, this will get a bit more complex when we have 'active' Rubies building with both 1.1.1 and 3.x.

Lastly, the '-latest' vs '-numeric' issue. As mentioned, if this was left as is, mswin would fail when Actions changes windows-latest to windows-2022. Many of the Ruby repos have the experience with things to notice the cause, but that may not be the case with other repos. And, since I think Ruby repos should be considered 'examples' of 'best practices', I thought the change was a good idea. I can revert...

@hsbt hsbt mentioned this pull request Mar 24, 2022
@MSP-Greg
Copy link
Contributor Author

See PR #514

@MSP-Greg MSP-Greg closed this May 17, 2022
@MSP-Greg MSP-Greg deleted the actions-test branch May 17, 2022 21:10
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.

2 participants