Skip to content

[Bug Report] Packwerk is not compatible with Ruby 4.0.0 #444

@exterm

Description

@exterm

Description
packwerk validate raises on Ruby 4.0.0 as it requires benchmark which is no longer bundled with Ruby.

To Reproduce
Run packwerk validate on Ruby 4.0.0

Expected Behaviour
Same as on previous Ruby versions

Screenshots
Not a screenshot, but better

$ bin/packwerk validate
/home/philip/.asdf/installs/ruby/4.0.0/lib/ruby/gems/4.0.0/gems/packwerk-3.2.3/lib/packwerk/formatters/progress_formatter.rb:4: warning: benchmark used to be loaded from the standard library, but is not part of the default gems since Ruby 4.0.0.
You can add benchmark to your Gemfile or gemspec to fix this error.
/home/philip/.asdf/installs/ruby/4.0.0/lib/ruby/4.0.0/bundled_gems.rb:60:in 'Kernel.require': cannot load such file -- benchmark (LoadError)
        from /home/philip/.asdf/installs/ruby/4.0.0/lib/ruby/4.0.0/bundled_gems.rb:60:in 'block (2 levels) in Kernel#replace_require'
        from /home/philip/.asdf/installs/ruby/4.0.0/lib/ruby/gems/4.0.0/gems/packwerk-3.2.3/lib/packwerk/formatters/progress_formatter.rb:4:in '<top (required)>'
        from /home/philip/.asdf/installs/ruby/4.0.0/lib/ruby/4.0.0/bundled_gems.rb:60:in 'Kernel.require'
        from /home/philip/.asdf/installs/ruby/4.0.0/lib/ruby/4.0.0/bundled_gems.rb:60:in 'block (2 levels) in Kernel#replace_require'
        from /home/philip/.asdf/installs/ruby/4.0.0/lib/ruby/gems/4.0.0/gems/packwerk-3.2.3/lib/packwerk/cli.rb:32:in 'Packwerk::Cli#initialize'
        from /home/philip/.asdf/installs/ruby/4.0.0/lib/ruby/gems/4.0.0/gems/sorbet-runtime-0.6.12698/lib/types/private/methods/_methods.rb:261:in 'UnboundMethod#bind_call'
        from /home/philip/.asdf/installs/ruby/4.0.0/lib/ruby/gems/4.0.0/gems/sorbet-runtime-0.6.12698/lib/types/private/methods/_methods.rb:261:in 'block in Packwerk::Cli#_on_method_added'
        from /home/philip/.asdf/installs/ruby/4.0.0/lib/ruby/gems/4.0.0/gems/packwerk-3.2.3/exe/packwerk:15:in '<top (required)>'
        from bin/packwerk:27:in 'Kernel#load'
        from bin/packwerk:27:in '<main>'

Version Information

  • Packwerk: v3.2.3
  • Ruby v4.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions