From b105b37acc2790abfc9bff0dc86ca0315b44899e Mon Sep 17 00:00:00 2001 From: Lukas Audzevicius Date: Thu, 20 Aug 2026 11:57:43 +0100 Subject: [PATCH 1/5] Add Ruby 4.0 / Puppet 9 lane to ci/nightly With the arrival of Puppetcore 9, we need to ensure our tools are compatible with Ruby 4. Adds a ruby_version: 4.0 / puppet_version: ~> 9.0 lane to both ci.yml and nightly.yml's spec job. No Gemfile change needed - this gem has no dependency on puppet itself (only molinillo/semantic_puppet), so there's no puppetcore gem source to add. --- .github/workflows/ci.yml | 5 ++++- .github/workflows/nightly.yml | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9120ff2..618a170 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,10 +19,13 @@ jobs: matrix: ruby_version: - '3.2' + - '4.0' include: - ruby_version: '3.2' puppet_version: '~> 8.0' - runs-on: + - ruby_version: '4.0' + puppet_version: '~> 9.0' + runs-on: - ubuntu-latest - windows-latest name: "spec (ruby ${{ matrix.ruby_version }} | puppet ${{ matrix.puppet_version }} - ${{ matrix.runs-on }})" diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index ad3b5af..8d8c4eb 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -12,10 +12,13 @@ jobs: matrix: ruby_version: - '3.2' + - '4.0' include: - ruby_version: '3.2' puppet_version: '~> 8.0' - runs-on: + - ruby_version: '4.0' + puppet_version: '~> 9.0' + runs-on: - ubuntu-latest - windows-latest name: "spec (ruby ${{ matrix.ruby_version }} | puppet ${{ matrix.puppet_version }} - ${{ matrix.runs-on }})" From 1c826fbde75a32a65e1605cce4d40290e5b9a689 Mon Sep 17 00:00:00 2001 From: Lukas Audzevicius Date: Thu, 20 Aug 2026 12:05:13 +0100 Subject: [PATCH 2/5] Add benchmark gem for Ruby 4.0 compatibility Ruby 4.0 unbundled benchmark from the standard library. rubocop 1.50.2 still requires it directly at its exe/rubocop entrypoint, so the Ruby 4.0 lane failed immediately with "cannot load such file -- benchmark" on both ubuntu-latest and windows-latest. --- Gemfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Gemfile b/Gemfile index bd40968..9ee3305 100644 --- a/Gemfile +++ b/Gemfile @@ -11,6 +11,9 @@ group :test do gem 'rubocop', '~> 1.50.0' gem 'rubocop-rspec', '~> 2.19' gem 'rubocop-performance', '~> 1.16' + # Ruby 4.0 unbundled benchmark from the standard library; rubocop 1.50.2 still requires + # it directly at startup. + gem 'benchmark' gem 'simplecov' gem 'simplecov-console' From e6b990f542b7699fd71de330674857328c684ec7 Mon Sep 17 00:00:00 2001 From: Lukas Audzevicius Date: Thu, 20 Aug 2026 12:17:05 +0100 Subject: [PATCH 3/5] Add base64/tsort for rubocop 1.50.2 on Ruby 4 rubocop 1.50.2 also requires base64 (html_formatter.rb) and tsort (parallel_assignment.rb) directly. base64 was unbundled since Ruby 3.4.0, causing the same LoadError as benchmark on the 4.0 lane; tsort is unbundled starting Ruby 4.1.0 (currently just a warning) - adding it now too to avoid another round-trip when that lands. --- Gemfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 9ee3305..dffc2e5 100644 --- a/Gemfile +++ b/Gemfile @@ -11,9 +11,11 @@ group :test do gem 'rubocop', '~> 1.50.0' gem 'rubocop-rspec', '~> 2.19' gem 'rubocop-performance', '~> 1.16' - # Ruby 4.0 unbundled benchmark from the standard library; rubocop 1.50.2 still requires - # it directly at startup. + # rubocop 1.50.2 still requires these directly; unbundled from the standard library by + # Ruby (base64 since 3.4.0, benchmark since 4.0.0, tsort from 4.1.0). + gem 'base64' gem 'benchmark' + gem 'tsort' gem 'simplecov' gem 'simplecov-console' From 6eef3aefd2f084207969725ece13b17f654f94de Mon Sep 17 00:00:00 2001 From: Lukas Audzevicius Date: Thu, 20 Aug 2026 15:01:58 +0100 Subject: [PATCH 4/5] Add ostruct/logger for Ruby 4 compatibility Found by installing Ruby 4.0.2 locally and iterating directly instead of round-tripping through CI: ostruct (required by rubocop's HTML formatter) and logger (required directly by gclone_spec.rb). Verified clean on both Ruby 3.2 and real Ruby 4.0.2 - full spec suite and rubocop, no further stdlib-unbundling surprises. --- Gemfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Gemfile b/Gemfile index dffc2e5..8a37c47 100644 --- a/Gemfile +++ b/Gemfile @@ -16,6 +16,8 @@ group :test do gem 'base64' gem 'benchmark' gem 'tsort' + gem 'ostruct' + gem 'logger' gem 'simplecov' gem 'simplecov-console' From 897235e59102b31e15b8e6e38bcf312f49f52161 Mon Sep 17 00:00:00 2001 From: Lukas Audzevicius Date: Thu, 20 Aug 2026 15:28:56 +0100 Subject: [PATCH 5/5] Drop tsort - not actually required yet tsort's stdlib-unbundling warning is forward-looking ("will no longer be part of the default gems starting from Ruby 4.1.0") - on Ruby 4.0.2 it's still just a warning, not a LoadError. Keeping this PR scoped to what's actually broken today; verified clean on both Ruby 3.2 and real Ruby 4.0.2 without it. --- Gemfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 8a37c47..8d017d0 100644 --- a/Gemfile +++ b/Gemfile @@ -11,12 +11,13 @@ group :test do gem 'rubocop', '~> 1.50.0' gem 'rubocop-rspec', '~> 2.19' gem 'rubocop-performance', '~> 1.16' - # rubocop 1.50.2 still requires these directly; unbundled from the standard library by - # Ruby (base64 since 3.4.0, benchmark since 4.0.0, tsort from 4.1.0). + # rubocop 1.50.2 still requires these directly; unbundled from the standard library + # since Ruby 3.4.0 (base64) or 4.0.0 (benchmark, ostruct). gem 'base64' gem 'benchmark' - gem 'tsort' gem 'ostruct' + # required directly by spec/unit/puppetfile-resolver/spec_searchers/git/gclone_spec.rb; + # unbundled from the standard library since Ruby 4.0.0. gem 'logger' gem 'simplecov'