Shopify/packwerk

[Bug Report] Psych 5.2.0 breaks packwerk

Closed this issue · 3 comments

ujh commented

Description
When using psych 5.2.0 I get the following error when running packwerk:

❯ ./bin/packwerk validate
/Users/urbanhafner/.rvm/gems/ruby-3.3.5/gems/packwerk-3.2.1/lib/packwerk/cli.rb:12:in `block in <class:Cli>': uninitialized constant Packwerk::Cli::StringIO (NameError)

        out: T.any(StringIO, IO),
                   ^^^^^^^^
	from /Users/urbanhafner/.rvm/gems/ruby-3.3.5/gems/sorbet-runtime-0.5.11553/lib/types/private/methods/_methods.rb:360:in `instance_exec'
	from /Users/urbanhafner/.rvm/gems/ruby-3.3.5/gems/sorbet-runtime-0.5.11553/lib/types/private/methods/_methods.rb:360:in `run_builder'
	from /Users/urbanhafner/.rvm/gems/ruby-3.3.5/gems/sorbet-runtime-0.5.11553/lib/types/private/methods/_methods.rb:338:in `run_sig'
	from /Users/urbanhafner/.rvm/gems/ruby-3.3.5/gems/sorbet-runtime-0.5.11553/lib/types/private/methods/_methods.rb:248:in `block in _on_method_added'
	from /Users/urbanhafner/.rvm/gems/ruby-3.3.5/gems/sorbet-runtime-0.5.11553/lib/types/private/methods/_methods.rb:449:in `run_sig_block_for_key'
	from /Users/urbanhafner/.rvm/gems/ruby-3.3.5/gems/sorbet-runtime-0.5.11553/lib/types/private/methods/_methods.rb:429:in `maybe_run_sig_block_for_key'
	from /Users/urbanhafner/.rvm/gems/ruby-3.3.5/gems/sorbet-runtime-0.5.11553/lib/types/private/methods/_methods.rb:258:in `block in _on_method_added'
	from /Users/urbanhafner/.rvm/gems/ruby-3.3.5/gems/packwerk-3.2.1/exe/packwerk:15:in `new'
	from /Users/urbanhafner/.rvm/gems/ruby-3.3.5/gems/packwerk-3.2.1/exe/packwerk:15:in `<top (required)>'
	from ./bin/packwerk:27:in `load'
	from ./bin/packwerk:27:in `<main>'

To Reproduce
Upgrade from psych 5.1.2 to 5.2.0

Expected Behaviour
It should work and not error out. 😉

Version Information

  • Packwerk: 3.2.1
  • Ruby 3.3.5

Additional Context
I also use packwerk-extensions 0.3.0, but I was able to reproduce this issue even when I didn't require it.

I believe this is related to #418 which has just gone out. I haven't checked yet.

ujh commented

It seems that way. Awesome!

ujh commented

Fixed with the latest release!