-
-
Notifications
You must be signed in to change notification settings - Fork 275
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
Add a new input to optionally update RubyGems #271
Conversation
I see that CI already exercises everything, awesome! |
Thank you for the PR! Could you add a single CI job around setup-ruby/.github/workflows/test.yml Lines 115 to 168 in 180e1d1
Maybe also for a specific version. Since the default remains And could you add a new |
For TruffleRuby it will just ignore the update, which is probably fine for now, so I think best to treat it like any other Ruby in this action. |
What's your opinion regarding the psych 4 + old Ruby/RubyGems issue? (#264) I think updating to a given RubyGems version wouldn't work if people have a matrix of both old and new Rubies (it would actually downgrade RubyGems on the newer Rubies). |
Thanks, I will make the requested updates 👍. Regarding the Psych + old RubyGems issue, a custom input value feels too hacky, yeah. I saw you added some custom code sometimes to workaround issues with bundler on different rubies (for example, installing Bundler 1 on JRuby 9.1 because it has issues with Bundler 2). I guess we could similarly automagically update RubyGems to 3.0.3 for example (the same shipped with Ruby 2.6) on older rubies and note that in the "rubygems: default" documentation. Not sure if the issue is spread enough to warrant that kind of handling though. As far as I understand for the issue to happen, the following conditions must be met:
|
Yeah, we could e.g. look at the lockfile to see if there is Pysch 4 in there, but that feels hacky.
It's not default but it's fairly common. |
@deivid-rodriguez What do you think of this:
I think that seems generally useful, unless there might be a valid reason to downgrade RubyGems lower than the version with Ruby? (I guess not) |
Oh, we automatically prevent that. If you try to downgrade RubyGems to a version older than the one that comes with each Ruby, it raises an error. Of course, you need to start from a RubyGems version that has this feature, and it's fairly recent. |
I think downgrading can be useful sometimes, for example, to workaround some regression. But we forbid downgrading past the default version that comes with Ruby because we never test that kind of combination. |
OK, then we should probably check jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
ruby: [2.3, 2.4, 2.5, 2.6, 2.7, '3.0', 3.1]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
rubygems: MINIMUM_RUBYGEMS_VERSION_WHICH_SUPPORTS_PSYCH4
bundler-cache: true and for Ruby >= 2.6 it should just no try to update RubyGems as that would error (or downgrade). BTW, which RubyGems version has Psych 4 support? |
Oh, you're right. Yeah, that's probably best, if a specific version is given, interpret and document it as a minimum RubyGems version for the matrix, and do nothing if the default one for a particular Ruby is newer.
I think it's 3.0.0.beta2: rubygems/rubygems@b7995ca. |
Thanks, so I think we should recommend |
I was thinking of recommending using either 3.0.3 (the version of RubyGems that comes with the next Ruby, 2.6), or 3.0.9 (the latest patch level on that series). I think 3.0.3 should be fine. |
When a fixed version is passed, it should be the minimum RubyGems version for the whole matrix, i.e., RubyGems should not be dowgraded past the default version of the oldest Ruby in the matrix.
I added the requested changes. CI is having some issues on Windows, but it's not this PR's fault. |
Also added a note recommending |
cc @MSP-Greg for the windows failures (mingw & ucrt): |
This is awesome, thank you! Some things I noticed in https://github.com/ruby/setup-ruby/runs/4905624850?check_suite_focus=true
|
Can you rerun the CI? Not sure what happened, last night something went haywire with MSYS2, and I've never seen it before. Since I've never seen it before, I didn't have any tests to fail the 'builds', so they replaced the working release assets. That cascaded into the ruby-loco builds. I fixed things late last night (early this morning), and I'm adding tests now to both. |
It seems the |
@MSP-Greg The rerun is all green indeed, thanks for the reply. |
Thank you @eregon. Regarding your first question, we have Regarding |
I tried |
Yes, I agree with you, I think we should have some intermediate option between Thanks for merging! |
Require RubyGems version 3.3.22 with the `rubygems` property as implemented in ruby/setup-ruby#271.
Require RubyGems version 3.3.22 with the `rubygems` property as implemented in ruby/setup-ruby#271.
Implements #228.
I guess TruffleRuby needs some special handling. Also, I'd like to ask what's the recommended way to try out my changes when working on a PR?