Windows: Use "ridk enable" like variable setup and add UCRT#197
Closed
larskanis wants to merge 2 commits intoruby:masterfrom
Closed
Windows: Use "ridk enable" like variable setup and add UCRT#197larskanis wants to merge 2 commits intoruby:masterfrom
larskanis wants to merge 2 commits intoruby:masterfrom
Conversation
Collaborator
This was referenced Jul 2, 2021
eregon
reviewed
Sep 25, 2021
| const parts = envvar.split("=", 2) | ||
| core.exportVariable(parts[0], parts[1]) | ||
| }) | ||
| } catch (ex) { |
Member
There was a problem hiding this comment.
I think we should at minimum log the exception here to help debug if anything goes wrong.
I think more reliable would be to have no fallback, do we need this fallback?
Collaborator
Author
There was a problem hiding this comment.
You're right, a message would be good.
I think the fallback is used on the ruby-loco mswin version. It doesn't ship the RubyInstaller::Runtime library. But both ruby-loco mingw and RubyInstaller have it.
Member
There was a problem hiding this comment.
I think best to have a if !mswin then and no catch
Member
|
I think this has been superseded #224 which was merged, so I'll close. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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