-
Notifications
You must be signed in to change notification settings - Fork 3
Update for downgraded package #25
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
Comments
This is the problem of serving the compiler tool chain as part of setup-ruby for users’ convenience. We could have said if you need tool chain run As we will likely continue to provide bundled tool chains, I have a few comments if we actually get a chance to rework this from scratch:
|
The proposed names LGTM.
Yes, JSON would be fine. It could also be code as a
I don't recall the exact numbers but extraction is unfortunately very slow on Windows (downloading is fast), picking for example https://github.com/ruby/setup-ruby/actions/runs/14765135437/job/41454925639?pr=761#step:3:26 gives: I don't know if that one is incremental or not, but yeah the motivation for "just download the delta" is to speedup that. I agree though in principle it would be simpler and safer to ignore any preinstalled msys2. Though could that cause problems if two msys2 installations exist, especially if one is in a standard location and we might end up using a mix of both?
Interesting. Where would we store such bundled ruby + toolchain? Here maybe? |
Unfortunately, this is a result of weak x64 hardware on default hosted runners. - if you look at windows-11-arm runners which currently download a full msys2 package we built from scratch, the extraction is less than 15 seconds (roughly 3x faster) with the 7z archive being twice as large. If download is fast, but decompression is a performance concern due to weak hardware, a simple optimization can be reduce compression ratio or use archive without compression. Download size will increase but extraction will be much faster. Also keep in mind that executable files in general doesn’t compress that well, for an archive that the majority of the size are binaries, it’s probably better use a plain archive with compression rate 0 (e.g. something equivalent to a plain tar file without compression). One thing that I need to test is that whether the slowness of compression is due to weak CPU or weak disk I/O. - If it’s weak CPU than the no compression optimization is worth doing, but if it’s weak disk I/O then not much we can do. |
I did a quick benchmark... The issue is weak disk I/O on The annoying inconsistency is that x64 runner has a slow on:
push:
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2019, windows-2022, windows-2025, windows-11-arm]
archive: [msys2, msys2-arm64]
destination: [C:\msys2, D:\msys2]
exclude:
# arm64 runners do not have D: drive
- os: windows-11-arm
destination: D:\msys2
steps:
- name: Download ${{ matrix.archive }}.7z
run: |
(New-Object System.Net.WebClient).DownloadFile("https://github.com/ruby/setup-msys2-gcc/releases/download/msys2-gcc-pkgs/${{ matrix.archive }}.7z", "${{ matrix.archive }}.7z")
- name: Extract ${{ matrix.archive }}.7z to ${{ matrix.destination }}
run: |
7z x ${{ matrix.archive }}.7z -o${{ matrix.destination }} |
@eregon So regarding the decompression cost, there is an easy solution - just detect which drive |
Thank you for benchmarking that. Do you have a workflow run link just for curiosity? I think having the full toolchain and extracting it to the fast disk would be the best solution: simple, consistent (across windows images), reliable (less affected by the image pre-installed MSYS2), fast. |
https://github.com/ntkme/test/actions/runs/14773387075/job/41477219178 Test definition is at https://github.com/ntkme/test/actions/runs/14773387075/workflow |
From https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories given the same RAM/cores/storage it gives the impression they are the same machines or similar, and the linux ones seem pretty decent speedwise. So yeah more of a disk I/O issue as you said. |
My only concern left about that approach is:
|
Another note, I just checked https://github.com/msys2/setup-msys2/blob/a5d2c5a565c520efa5f477391e4e3f87c2e08f46/action.yml#L31-L34 To avoid a clash, maybe we can use something like |
Good morning (my time). I think the distinction between C: & D: has been brought up before, possibly related to where the Ruby builds are placed. Also, whether to change ENV setting re the 'temp' folder. A long time ago, the GHA hardware docs made clear that the Ubuntu & Windows hardware was the same, and they contained both an SSD and an HDD. If you look at the 'Physical Disk' step in windows jobs at https://github.com/MSP-Greg/actions-image-testing/actions/runs/14765640250/job/41456379175#step:6:43, you see different PhysicalSectorSize with the two disks. Typically, HDD are 4096, and SSD are 512. So, at present, C: is an HDD, D: is an SSD. There could be 'noisy neighbor' issues with both. Regardless, the SSD should always be faster (as we all know). This could change in the future. Re moving build files to D:, I don't see an issue, we can always rename Also, we could then have a single file for download, instead of one for MSYS2 and one for the ucrt/mingw/clang build tools. That might help with the speed issue. 'mswin' will need an MSYS2 package, as it's installed for 'full' bash support.
Re Today, there are many repos that require compiling ext code, and many work on Windows with no 'Windows specific' steps in the workflow files. Many of those are running CI on both Windows MSYS2 and 'mswin' builds. I can't remember where, but recently a well respected Ruby coder stated that Another reason to keep the code in Off-topic history @ntkme sorry, you may know all this, not sure... I've been involved with 'Windows' Ruby since the conversion from MSYS (last Ruby was 2.3) to MSYS2 (started with 2.4). Back then, everyone used Travis & Appveyor. If one wanted a repo to run CI on Windows, one pretty much had to write the Appveyor script/yaml file. In addition, almost all Ruby head builds were unstable (all OS's, many not tested), and it was a mess. Then, GHA was available (Windows 2016 & 2019), and both Benoit and I separately started working on code similar to |
Completely agreed. I was just bringing up a slim possibility from a historical point of view. In fact, I'd even say in general very few coders are familiar with infrastructure and operation that they only care about their code to "just work".
Thanks for sharing. I only knew the GitHub part of it from https://github.com/actions/setup-ruby/blob/main/README.md. Now we knows about these runners better, knows about corner cases like openssl/gcc incompatibility better, we can definitely make the whole workflow better after more thoughts. I have a few ideas that I will probably try to prototype later this week. |
I have the big change ready for review. The features we've discussed in this thread are added, and much more. - Please see each PR's description for a summary of changes: It will be somewhat controversial as it's a complete rewrite for this repository, but I believe it's better in almost every way. As for users who are not using |
@eregon & @ntkme
I think I've mentioned that the whole 'system' of creating archives (7z files) is in need of an update.
So, what I'd like to do is set it up so the package/downgrade info is more 'data/configuration' driven, rather than the current 'code' driven approach.
An example of what I think will be needed is shown below in a new GHA matrix:
setup-ruby
.setup-ruby
for the proper selection of which build tool archive files to install, based on the Ruby version and platform. This code may be messy, since patch versions may be needed for proper selection, eg Ruby 3.4.3 should use gcc-14, but Ruby 3.4.4 should use gcc-15 (assuming backports). I'd like to keep the data here, possibly in a json or yaml format, and transfer it in some way tosetup-ruby
, which is where the selection occurs.Any thoughts?
@hsbt I'm not sure where to look. Is there a stated policy regarding backports for updated build tool/package issues? If they are backported to 'bug' supported versions, would they also be done for Ruby versions in 'security only' updates? Thanks for adding the Ubuntu gcc-15 CI...
*EDIT: I have not mentioned. MSYS2 uses
pacman
for its package manager, andpacman
only allows one package to be installed. Unlike some other popular package managers,pacman
will only install one version. So, to downgrade a package, we need to store the downgrade package (MSYS2 only keeps old packages for a limited time), and use a different install command.The text was updated successfully, but these errors were encountered: