Uh oh!
There was an error while loading. Please reload this page.
Add a new input to optionally update RubyGems - #271
Conversation
deivid-rodriguez
commented
Jan 21, 2022
I see that CI already exercises everything, awesome! |
eregon
commented
Jan 21, 2022
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 |
eregon
commented
Jan 21, 2022
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. |
eregon
commented
Jan 21, 2022
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:
|
eregon
commented
Jan 21, 2022
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. |
eregon
commented
Jan 21, 2022
@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) |
deivid-rodriguez
commented
Jan 21, 2022
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. |
deivid-rodriguez
commented
Jan 21, 2022
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: falsematrix:
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@v1with:
ruby-version: ${{ matrix.ruby }}rubygems: MINIMUM_RUBYGEMS_VERSION_WHICH_SUPPORTS_PSYCH4bundler-cache: trueand 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? |
deivid-rodriguez
commented
Jan 21, 2022
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: ruby/rubygems@b7995ca. |
eregon
commented
Jan 21, 2022
Thanks, so I think we should recommend |
deivid-rodriguez
commented
Jan 22, 2022
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.
deivid-rodriguez
commented
Jan 22, 2022
I added the requested changes. CI is having some issues on Windows, but it's not this PR's fault. |
deivid-rodriguez
commented
Jan 22, 2022
Also added a note recommending |
cc @MSP-Greg for the windows failures (mingw & ucrt): |
eregon
commented
Jan 22, 2022
This is awesome, thank you! Some things I noticed in https://github.com/ruby/setup-ruby/runs/4905624850?check_suite_focus=true
|
MSP-Greg
commented
Jan 22, 2022
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. |
Uh oh!
There was an error while loading. Please reload this page.
eregon
commented
Jan 22, 2022
It seems the |
eregon
commented
Jan 22, 2022
@MSP-Greg The rerun is all green indeed, thanks for the reply. |
deivid-rodriguez
commented
Jan 23, 2022
Thank you @eregon. Regarding your first question, we have Regarding |
eregon
commented
Jan 23, 2022
I tried |
deivid-rodriguez
commented
Jan 23, 2022
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.
Replace the separate "Update RubyGems" step with the `rubygems: latest` option in `ruby/setup-ruby` action. ruby/setup-ruby#271 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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?