Skip to content

Sync with upstream ruby/setup-ruby v1.342.0 (Ruby security fix) - #20

Merged
priyanka-0206 merged 25 commits into
masterfrom
sync/upstream-v1.342.0
Nov 20, 2026
Merged

priyanka-0206 merged 25 commits into
masterfrom
sync/upstream-v1.342.0

Conversation

@priyanka-0206

@priyanka-0206 priyanka-0206 commented Nov 20, 2026 •

Copy link
Copy Markdown

Issue

Ruby has a critical security bug, CVE-2026-132825 ("ruby2shell"). It can let an attacker run code, and Rails apps can hit it by default. It's fixed in Ruby 3.3.14, 3.4.13 and 4.0.10. Upstream setup-ruby added those versions in v1.342.0. Our fork is still on v1.335.0, so it can't install them. Brightside asked for this (Plain T-1427).

What

Syncs the fork with upstream ruby/setup-ruby v1.342.0, up from v1.335.0.

  1. Adds ruby 3.3.14, 3.4.13 and 4.0.10.
  2. Adds the Windows builds of those three versions. RubyInstaller published them after upstream tagged v1.342.0, so upstream doesn't have them yet. Generated with generate-windows-versions.rb, the same way upstream does it.
  3. Brings in upstream's other changes since v1.335.0: mswin/vcpkg support on Windows, $BUNDLE_JOBS for bundle install, and the download token now only sent to github.com.

Decisions

  • Users on ruby-version: 3.3, 3.4 or 4.0 get the fixed Ruby on their next run. Users who pin an exact older version, such as 3.4.12, must change it themselves.
  • macOS 14 is no longer supported, same as upstream. The new Ruby builds are made on macOS 15, and on macOS 14 they fail with Could not load OpenSSL. So warp-macos-14-arm64-6x is removed from the test matrix. Only one customer uses Ruby on macOS 14, and we'll tell them.
  • generate-test-matrix.rb otherwise keeps our Warp runner list. Upstream added ubuntu-26.04, but we don't add runners in a sync.
  • test.yml keeps our ubuntu-24.04 pins and adds upstream's new result job.
  • dist/index.js is rebuilt with yarn run package. It matches the merged file and keeps the warp-cache code.

Tested

  • yarn run package gives no diff.
  • I couldn't run generate-test-matrix.rb locally (the local Ruby is too old), so CI checks it.

Checklist

  • CI passes
  • Human self review done
  • After merge, tag v1.342.0 and fast-forward the v1 branch to it

🤖 Generated with Claude Code

eregon and others added 25 commits October 30, 2026 21:37
* To have a single target for "required checks" in GitHub for auto-merge.
* Same shape as the result jobs in ruby/ruby workflows.
ubuntu-26.04 only has builds of the latest patch release of each series,
so use 3.4.12 and 3.1.7 instead of 3.4.0 and 3.1.0.
Ruby 2.0 does not compile on ubuntu-26.04, so drop that test.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The mswin builds are downloaded from cache.ruby-lang.org, which does not take the token.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The mswin build of ruby-loco has not been updated since 2026-10-14. cache.ruby-lang.org publishes the newest daily build for x64 and arm64 as ruby-head-<platform>.zip. Their OpenSSL looks for certificates in a directory that does not exist on runners, so SSL_CERT_FILE points at the bundle of Git for Windows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DevKit Rubies got it only from the DevKit setup, so `windows-toolchain: none` left them without CA certificates while mswin had them. It is their OpenSSL that needs the certificates, not the toolchain.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Using setup-ruby twice in the same job (e.g. for multiple Gemfiles in a
monorepo) was not tested, which let ruby#444 slip through: BUNDLER_VERSION
exported by a first setup-ruby step using Bundler 1 leaked into a second
step, whose `bundle install` then failed with "You must use Bundler 2 or
greater with this lockfile".

The new job reproduces that scenario: a first step uses Bundler 1 via
gemfiles/bundler1.gemfile, then a second step on the root Gemfile must
use Bundler 2.4 (the latest Bundler for Ruby 2.7), both for the action's
own `bundle install` and for later steps.

It runs on ubuntu-24.04 since Ruby 2.7 is not available on ubuntu-26.04,
which ubuntu-latest is moving to.

Closes ruby#445
Use Ruby 3.4 for the second setup-ruby step, so the test also covers
switching Ruby versions within a job, and check with `ruby --version`
after each step that the expected Ruby is picked.

Ruby 3.4 ships with Bundler 2.6, so expect that instead of Bundler 2.4.

Co-Authored-By: Claude <noreply@anthropic.com>
bundle install was always invoked with an explicit `--jobs N` (the number
of available processors, capped at 8). Since Bundler stores command-line
options as temporary settings, which take precedence over every other
configuration source, this silently overrode any `BUNDLE_JOBS` set by the
user, making it impossible to e.g. disable parallel installation.

Only pass `--jobs` when `BUNDLE_JOBS` is not set, so that the `BUNDLE_*`
environment variables recommended in the README for configuring Bundler
also work for the number of jobs.

Fixes ruby#673
The mswin builds from cache.ruby-lang.org keep the build machine's paths out of configure_args, so extconf.rb no longer finds the vcpkg headers and libraries that ruby-loco located through --with-opt-dir. Their RbConfig also has an empty PKG_CONFIG, so mkmf ran the MSYS2 pkg-config on PATH, which pointed fiddle at the MinGW libffi headers and broke the MSVC build. ruby-loco meant to set PKG_CONFIG to the vcpkg pkgconf, but its path missed a variable and pointed nowhere.

ruby#976

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
json builds without any external library, so it did not catch mkmf losing track of vcpkg.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mkmf skips an absolute PKG_CONFIG that File.expand_path would rewrite, so the backslashed path never ran pkgconf and extensions built only through their header and library fallbacks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The mswin Ruby ships z.dll, not the libz.dll that vcpkg's libz.lib imports, so a zlib extension built against vcpkg failed to load and then broke RubyGems in that gem home. The other vcpkg DLLs still resolve to the copies in Ruby's own bin first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Building fiddle succeeded even while a zlib extension linked to libz.dll could not be loaded. The step activates the installed zlib explicitly, because Ruby also ships a default zlib built against its own z.dll.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds ruby 3.3.14, 3.4.13 and 4.0.10, which fix CVE-2026-132825.
Keeps the Warp runner list in generate-test-matrix.rb and the
ubuntu-24.04 pins in test.yml.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RubyInstaller published them after upstream tagged v1.342.0.
Generated with generate-windows-versions.rb.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The new Ruby builds are made on macOS 15 and fail to load OpenSSL on
macOS 14. Upstream dropped macos-14 for the same reason.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@priyanka-0206
priyanka-0206 merged commit 2d99711 into master Nov 20, 2026
346 checks passed
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.

7 participants