Closed halostatue closed 2 months ago
@halostatue
I'll see if I can look at what the issue is. None of the other Ruby versions that use MinGW on Windows 2019 (Ruby 3.0 and earlier) seem to be installing psych, but Ruby 3.0 is. The code in setup-ruby that handles MSYS2 (build tools and packages) is different for Windows 2019 vs Windows 2022.
Bottom line is the MSY2 MinGW libyaml package is not installed on Windows 2019, and it is needed to compile Psych.
Given that all of the other versions succeed, I am for the moment ignoring that particular failure, and I can take it out of the test loop as required, but I wanted to report it.
@halostatue
I could come up with a workaround, but your solution is fine by me. Could you maybe edit the issue title to include something about Window 2019 image & libyaml?
JFYI, one solution would be to use setup-ruby-pkgs with a conditional to install libyaml only on Window 2019 and Ruby 3.0 or lower.
The Windows 2019 image contains a partial MSYS2 MinGW install which has some of the packages needed to build Ruby, but not all. Ruby 3.1 and later use MSYS2 UCRT, so setup-ruby installs the full set of build tools/packages.
The Windows 2022 image only contains a partial MSY2 install, so setup-ruby installs all the build tools/packages needed, and selects MinGW or UCRT depending on the Ruby version. These operations are shown in the setup-ruby logs.
Done and done in my workflow. It's good to know about setup-ruby-pkgs, but given that everything else just works, I’ve disabled Ruby 3.0 on Windows 2019 for this. Is this issue worth keeping open?
given that everything else just works
That is the intent, but the Actions Windows 2019 image is much different than the Windows 2022 image.
I think I'll propose adding something to the README file that makes clear that all packages required to build Ruby are included when using Windows 2022, but that Windows 2019 does not include all of them, and may require installing package(s), which can be done with setup-ruby-pkgs or via MSYS2's pacman.
setup-ruby-pkgs is cross-platform and is often used by gems that require a package that is not used to build Ruby. Nokogiri would be an example, it's used five times in the ci workflow.
EDIT: I'll do a PR for the Readme, and have it close this issue.
Ensure the following before filing this issue
[X] I verified it reproduces with the latest version with
- uses: ruby/setup-ruby@v1
(see Versioning policy)[X] I tried to reproduce the issue locally by following the workflow steps (including all commands done by
ruby/setup-ruby
, except forDownloading Ruby
&Extracting Ruby
), and it did not reproduce locally (if it does reproduce locally, it's not a ruby/setup-ruby issue)Are you running on a GitHub-hosted runner or a self-hosted runner?
GitHub-hosted runner
Link to the failed workflow job (must be a public workflow job, so the necessary information is available)
https://github.com/halostatue/diff-lcs/actions/runs/10803766140/job/29969029880
Any other notes?
This is not a workflow issue as the same workflow succeeds on Ruby 2.6, 2.7, 3.1, 3.2, and 3.3. But Ruby 3.0 fails on installing Psych on Windows 2019