Skip to content

Rewrite ruby/setup-msys2-gcc #762

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Rewrite ruby/setup-msys2-gcc #762

wants to merge 1 commit into from

Conversation

ntkme
Copy link
Contributor

@ntkme ntkme commented May 4, 2025

This PR include a few changes for windows:

  • Fix the issue with gcc 15 vs gcc 14 by introducing flexible variants of toolchains.
  • Reduce friction with Rewrite setup-msys2-gcc#26.
  • Improves performance by install to fast disk and create junction link on slow disk.
    • Ruby is installed to $RUNNER_TEMP\$base and a junction link is created at original $rubyPrefix.
    • MSYS2 is installed to $RUNNER_TEMP\msys64 and a junction link is created at $rubyPrefix\msys64.
  • Improves the reliability of ridk enable step by using proper serialization.
  • Refactor and clean up tech debt.

Performance

Run to run improvement varies a lot due to different sizes of packages and the unstable performance of the slow disk.
However, in general this saves anywhere from 20s to 60s per run. Example of a performance improvement from 63.43s to 27.15s - or 36.38s in saving:

https://github.com/ruby/setup-ruby/actions/runs/14772696897/job/41475457782

Downloading Ruby
  https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.4.3-1/rubyinstaller-3.4.3-1-x64.7z
  Took   0.97 seconds
Extracting  Ruby
  Took  25.38 seconds
Modifying Path
Downloading msys2 build tools
  https://github.com/ruby/setup-msys2-gcc/releases/download/msys2-gcc-pkgs/msys2.7z
  Took   0.73 seconds
Extracting  msys2 build tools
  Took  12.52 seconds
Downloading ucrt64-3.0 build tools
  https://github.com/ruby/setup-msys2-gcc/releases/download/msys2-gcc-pkgs/ucrt64-3.0.7z
  Took   1.00 seconds
Extracting  ucrt64-3.0 build tools
  Took  22.83 seconds

https://github.com/ntkme/setup-ruby/actions/runs/14823150160/job/41612838924

Downloading Ruby
  https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.4.3-1/rubyinstaller-3.4.3-1-x64.7z
  Took   0.46 seconds
Extracting  Ruby
  Took   9.87 seconds
Modifying Path
Downloading msys2 build tools
  https://github.com/ntkme/setup-msys2-gcc/releases/latest/download/msys2-ucrt64-gcc@14.7z
  Took   1.18 seconds
Extracting  msys2 build tools
  Took  15.64 seconds

Note regarding why use $rubyPrefix\msys64:

>=2.4.1 means $rubyPrefix\msys64 is supported by all currently available ruby installer versions that's linked with msys2, and it has higher priority than C:\msys64 so that we don’t need to touch the preinstalled C:\msys64 at all.

@ntkme ntkme force-pushed the dev branch 10 times, most recently from 42e2c97 to ad6e0db Compare May 8, 2025 01:51
@ntkme ntkme marked this pull request as ready for review May 8, 2025 02:37
@ntkme ntkme force-pushed the dev branch 3 times, most recently from 363de67 to a8d7546 Compare May 8, 2025 05:50
@ntkme ntkme force-pushed the dev branch 8 times, most recently from 15a109c to 7168d8b Compare May 8, 2025 21:06
@MSP-Greg
Copy link
Collaborator

Curious, why the need for 'Revert back to use GITHUB_WORKSPACE to detect fast drive'?

@ntkme
Copy link
Contributor Author

ntkme commented May 12, 2025

Curious, why the need for 'Revert back to use GITHUB_WORKSPACE to detect fast drive'?

Sorry, was just testing something and pushed to the wrong branch.

@MSP-Greg
Copy link
Collaborator

@eregon

I've quickly looked as this, and everything seems ok. We're getting close to finalizing the changes to setup-msys2-gcc, so checking is this is okay. Once the new packages are created, this can be merged.

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