Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skipping debug gem misses ::DEBUGGER__::TrapInterceptor #1060

Closed
dimerman opened this issue Jul 13, 2022 · 3 comments
Closed

Skipping debug gem misses ::DEBUGGER__::TrapInterceptor #1060

dimerman opened this issue Jul 13, 2022 · 3 comments

Comments

@dimerman
Copy link

on #947 tapioca skips the debug gem.
however I'm seeing errors such as:

  sorbet/rbi/gems/activesupport@7.0.3.1.rbi:13320: Replace with Logger::Severity::DEBUG
       13320 |  include ::DEBUGGER__::TrapInterceptor
                        ^^^^^^^^^^^^

workaround:
add to todo.rbi

module ::DEBUGGER__::TrapInterceptor; end
@dimerman dimerman changed the title Skipping debug gem misses ::DEBUGGER__::TrapInterceptor Skipping debug gem misses ::DEBUGGER__::TrapInterceptor Jul 13, 2022
@georgebrock
Copy link
Contributor

I've had some success with adding ENV["RUBY_DEBUG_ENABLE"] = "0" to my prerequire file to prevent the debug gem from executing.

This environment variable means that even if the debug gem loads, it doesn't do anything.

One caveat – there is a bug with the RUBY_DEBUG_ENABLE support in the latest release of the Gem which means that loading the gem doesn't define the DEBUGGER__ constant but still tries to access it. They've already merged a fix (ruby/debug#731). Until that's released the workaround I'm using in my prerequire file is to define a little stub so that it doesn't raise:

unless defined? DEBUGGER__
  module DEBUGGER__
    def self.start(*args, **kwargs)
    end
  end
end

@Morriar
Copy link
Collaborator

Morriar commented Aug 2, 2022

The best workaround would be to add the missing constants to https://github.com/Shopify/rbi-central so Tapioca can pick it up when running tapioca annotations.

@paracycle
Copy link
Member

Since #1179 is merged, Tapioca is internally setting ENV["RUBY_DEBUG_ENABLE"] = "0" so that we never load the debug gem at all (loading it lead to some hangs in forked processes). Morevover, ruby/debug#731 has been released in 1.6.2 of the debug gem, so, this should be resolved.

I am closing this issue, please reopen if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants