Windows: Use "ridk enable" like variable setup and add UCRT #197
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a "ridk enable" like setup of environment variables. "ridk enable" and "ridk exec" are the preferred ways to enable MSYS2 in RubyInstaller2. This not only sets the PATH but also several other variables that are required for pkgconf, autotools, etc.
"ridk enable" mimics the variable setup of MSYS2 "bash --login", but enables powershell and cmd.exe to run MSYS2 commands.
As a fallback, in case the RubyInstaller mechanism fails, the PATH is extended to use MSYS64 with MINGW or UCRT, but no other variables are set.
The PR installs gcc when running on Windows-UCRT, since there is no UCRT capable compiler preinstalled on github actions. That might be a temporary solution until @MSP-Greg finds another way to package gcc in a faster install solution.
A Github Action run on Windows looks like so: https://github.com/larskanis/ruby-pg/runs/2972095461?check_suite_focus=true#step:3:19