Skip to content

Modernize build toolchain: Ruby 2.5.8 → 3.3.10, clear Dependabot alerts - #4896

Merged
Cobra-Bitcoin merged 9 commits into
bitcoin-dot-org:masterfrom
devdavidejesus:modernize-ruby-3-3
Aug 8, 2026
Merged

Modernize build toolchain: Ruby 2.5.8 → 3.3.10, clear Dependabot alerts#4896
Cobra-Bitcoin merged 9 commits into
bitcoin-dot-org:masterfrom
devdavidejesus:modernize-ruby-3-3

Conversation

@devdavidejesus

@devdavidejesus devdavidejesus commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Draft — do not merge until the build server has Ruby 3.3.10 (rvm install 3.3.10), per the Gemfile's own notes.

Why

The 40 open Dependabot alerts all live in the Gemfile.lock, which has been frozen on the Ruby 2.5.8 (EOL) toolchain; the bulk of them (the nokogiri chain, pinned by html-proofer 2.1.0) can't reach secure versions without a newer Ruby. These are build/test dependencies on a static Jekyll site, nothing is served to visitors, so real-world risk is low, but the alerts are valid.

What

  • Ruby 2.5.8 → 3.3.10 in Gemfile, .ruby-version, .travis.yml. Travis also drops the 2.5.8-era RubyGems/bundler pins, which would break on Ruby 3.3. (3.3.10 is the patch Travis images ship prebuilt — no rvm binaries exist for 3.3.12; the pin can move to any 3.3.x the server gets.)
  • html-proofer 2.1.0 → ~> 5.0, pulls fully patched nokogiri 1.19.4; rexml, concurrent-ruby, addressable and RedCloth all resolve to secure versions, clearing the alerts.
  • therubyracer/libv8 (2014) → mini_racer, needed as the ExecJS runtime for check-jshint (verified: ExecJS.runtime.name → "mini_racer (V8)" on Linux). less removed, nothing in the build invokes it (no plugin, no Makefile target; CSS comes from the SCSS pipeline, ie8.less is copied as-is).
  • Plugin fixes for APIs removed in Ruby 3.x (~14 lines across 7 files): Psych 4 rejects YAML aliases (8× YAML.unsafe_load_file); File.exists? removed in 3.2 (5× File.exist?); Kernel#open with URLs removed in 3.0 (2× URI.open, the old call failed silently behind a bare rescue, caching an empty contributors list).
  • _contrib/bco-htmlproof ported to the html-proofer 5.x API, keeping the exact 2.x checking scope (internal links only, no https enforcement, no hash checking).
  • One config line: sass: silence_deprecations: ["import"], Dart Sass deprecation warnings were tripping check-for-build-errors; migrating the SCSS to @use remains a future cleanup (sass-migrator automates it).
  • Lock includes x86_64-linux and arm64-darwin platforms; docs/setting-up-your-environment.md updated to 3.3.10.

Proof

Full make build test passes end to end in a Linux container (ruby:3.3 Docker image, same GNU toolchain as the build server): 3,823 pages built, every check green, link checker included (5,234 internal links, zero failures). The full build also passed on macOS arm64 during the sandbox PoC; the test suite on macOS only trips on pre-existing BSD-vs-GNU tool assumptions in the Makefile, unrelated to this change.

Notes for review

  • The 3.3.10 pin follows the current exact-pin convention and matches what Travis ships.
  • Backlog findings, deliberately not in this PR: the footer's MIT license link is http:// on every page; two dead anchors in old posts (#sponsorship/#github on about-us); _alerts destination-conflict warnings in the build log; the Makefile assumes GNU tools.

Regenerate Gemfile.lock on Ruby 3.3.12: html-proofer 2.1.0 -> ~> 5.0
(pulls fully patched nokogiri 1.19.4), rexml/concurrent-ruby/addressable/
RedCloth all resolve to secure versions, clearing the open Dependabot
alerts. Replace therubyracer/libv8 (2014, does not build on modern
toolchains) with mini_racer, which check-jshint needs as its ExecJS
runtime; drop less, which nothing in the build invokes. Lock includes
x86_64-linux and arm64-darwin platforms. Travis: bump rvm to 3.3.12 and
drop the RubyGems/bundler pins from the 2.5.8 era, which would break on
Ruby 3.3.
Psych 4 (Ruby 3.1+) rejects YAML aliases by default: switch 8
YAML.load_file calls to YAML.unsafe_load_file (build-time loading of the
repo's own files). File.exists? was removed in Ruby 3.2: use File.exist?
(5 occurrences). Kernel#open with a URL was removed in Ruby 3.0: use
URI.open (2 calls); without this the contributors plugin fails silently
behind a bare rescue and caches an empty list.
The 2.x require path and constructor are gone. Keep the same checking
scope as before: internal links only, no https enforcement, no internal
hash checking. Passes on the current site (5,234 internal links across
3,823 files).
…3.3.12

Dart Sass deprecation warnings for @import were tripping
check-for-build-errors; silencing is supported by jekyll-sass-converter
3.1. Migrating the SCSS to @use remains a future cleanup.
@devdavidejesus
devdavidejesus marked this pull request as draft July 23, 2026 18:59
Travis images ship ruby-3.3.10 prebuilt; no rvm binary rubies exist for
3.3.12 on either focal or jammy, so CI cannot install it. 3.3.10 resolves
the identical dependency set (same gem versions, same cleared alerts).
Full make build test re-verified green in a ruby:3.3.10 Linux container.
Also reverts the jammy dist experiment; focal provably ships 3.3.10.
@devdavidejesus devdavidejesus changed the title Modernize build toolchain: Ruby 2.5.8 → 3.3.12, clear Dependabot alerts Modernize build toolchain: Ruby 2.5.8 → 3.3.10, clear Dependabot alerts Jul 23, 2026
Travis's default install command still passes --deployment and --path,
flags removed in Bundler 4. Use the bundle config equivalents the error
message itself recommends, keeping the same semantics (frozen lockfile,
vendor/bundle path so the bundler cache keeps working).
mini_racer 0.21.x compiles with -std=c++20, which gcc 9 (focal default)
does not accept; jammy ships gcc 11. Everything else already passed on
focal: rvm found ruby 3.3.10 instantly and all 66 other gems installed
from x86_64-linux prebuilt binaries.
@Cobra-Bitcoin
Cobra-Bitcoin marked this pull request as ready for review August 7, 2026 15:33
@Cobra-Bitcoin

Copy link
Copy Markdown
Contributor

Thank you! This is great work and long overdue. Everything looks good. I think with a change like this the most important thing is knowing there isn't something silently breaking somewhere, and I don't think there is. I will merge this myself once the build server is prepared and the conflict has been resolved (good that we no longer need the events plugin). Will report back if it's a success.

@devdavidejesus

Copy link
Copy Markdown
Collaborator Author

Thanks, @Cobra-Bitcoin !

@Cobra-Bitcoin
Cobra-Bitcoin merged commit 8dbb7a7 into bitcoin-dot-org:master Aug 8, 2026
1 check passed
@devdavidejesus
devdavidejesus deleted the modernize-ruby-3-3 branch August 8, 2026 21:04
@devdavidejesus devdavidejesus added Build Pull requests that update the build process Ruby Pull requests that update ruby code labels Aug 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Build Pull requests that update the build process Ruby Pull requests that update ruby code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants