Require gem classes, but out out of require-time side effects?
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
Línea de trabajo
Start by reproducing the failure with bundle exec tapioca gem debug, both with and without RUBY_DEBUG_ENABLE=0, and inspect the gem's require path and the attach, trap, and fork-interceptor entry points. Done means Tapioca can require debug without side effects and generate an RBS or RBI successfully.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Your proposal
Is it possible to separate out the logic to attempt to attach to a process, and to define all the classes that the library needs?
Additional context
When using type checkers like Sorbet, various tools (srb init, tapioca gem, etc.) attempt to require the gem only to see what classes, methods, and constants the gem defines, so that it can generate either an RBS or RBI file providing annotations for the gem.
It seems that the debug gem does not work for those use cases, because requiring the gem seems to try to attach to the gem:
~/sandbox/default jez@jez-pc-01
❯ cat Gemfile
source 'https://rubygems.org'
gem 'tapioca'
gem 'debug'
~/sandbox/default jez@jez-pc-01
❯ bundle install &> /dev/null && bundle exec tapioca gem debug
Requiring all gems to prepare for compiling... DEBUGGER: Attaching after process 676571 fork to child process 676585
Done
Error: Cannot find gem 'debug'
~/sandbox/default jez@jez-pc-01
❯ export RUBY_DEBUG_ENABLE=0
~/sandbox/default jez@jez-pc-01
❯ bundle install &> /dev/null && bundle exec tapioca gem debug
Requiring all gems to prepare for compiling... Done
Error: Cannot find gem 'debug'
What I would like to be able to do is to have a way to require all the supporting classes/modules/constants/methods that the debug gem defines but not have the gem attempt to do any side effects. For example, I want to require the gem but explicitly opt out of the trap and fork interceptors.
The feature request would be considered complete when it's possible to generate an RBS or RBI for the debug gem without having it fail, as shown in the screenshot above.
- Lenguaje dominante
- Ruby
- Estrellas
- 1.3k
- Forks
- 146
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de ruby/debug
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
-
Support exceptionOptions in setExceptionBreakpoints to catch arbitrary exception classes via DAP Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
Todos los issues de ruby/debug
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
palladius/rails8-app-on-gcp#145 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
rubocop/rubocop-rspec#2236 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
riscv/riscv-unified-db#2624 · 1 reacción ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100