Repository navigation
fix: add explicit fileutils/logger dependencies for Ruby 4.0 - #119
Merged
gavindidrichsen merged 2 commits intoSep 14, 2026
Merged
Conversation
Nightly CI has failed for 5+ consecutive nights on the ruby 4.0 / puppet ~> 9.0 lanes with `NameError: uninitialized constant FileUtils` in builder_spec.rb. Ruby 4.0 unbundled both fileutils and logger from the default gem set (already worked around for win32ole in the Gemfile); builder.rb uses FileUtils extensively but never required it, and only required logger without declaring it as a real dependency. It happened to work before because some other gem in the resolved dependency graph transitively pulled fileutils/logger in - that's not guaranteed and breaks under a different dependency set. Verified locally: reproduced the NameError under Ruby 4.0.2, confirmed it's gone with these two gemspec dependencies plus the missing require, and the full unit suite (59 examples) now passes under both Ruby 4.0.2 and 3.2.6 with no regressions. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #119 +/- ##
==========================================
+ Coverage 94.93% 94.96% +0.03%
==========================================
Files 2 2
Lines 158 159 +1
==========================================
+ Hits 150 151 +1
Misses 8 8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
bastelfreak
reviewed
Sep 14, 2026
Sounds good. Thanks for the suggestion Co-authored-by: Tim Meusel <tim@bastelfreak.de>
gavindidrichsen
approved these changes
Sep 14, 2026
gavindidrichsen
deleted the
fix/ruby4-missing-fileutils-logger-requires
branch
September 14, 2026 12:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
spec (ruby 4.0 | puppet ~> 9.0)nightly lane has failed 5 consecutive nights on both ubuntu and windows.fileutilsandloggerfrom the default gem set (the same thing already happened towin32ole, per an existing comment in this repo).lib/puppet/modulebuilder/builder.rbusesFileUtilsextensively but neverrequires it, andrequire 'logger'without declaringloggeras a real gemspec dependency. This only worked before by accident, via some other gem in the dependency graph transitively pulling both in — not guaranteed, and it broke under Ruby 4.0.Test plan
NameError: uninitialized constant FileUtilslocally on Ruby 4.0.2 with a minimal bundle, matching the CI failurerequire 'fileutils'inbuilder.rband explicitfileutils/loggerdependencies in the gemspecbundle exec rspec spec/unit) passes 59/59 on both Ruby 3.2.6 and Ruby 4.0.2, matching CI's example count🤖 Generated with Claude Code