Require gem classes, but out out of require-time side effects?
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 25/100
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Ruby
- Sterne
- 1.3k
- Forks
- 146
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus ruby/debug
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 68/100
-
Support exceptionOptions in setExceptionBreakpoints to catch arbitrary exception classes via DAP Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 55/100
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 45/100
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 52/100
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
palladius/rails8-app-on-gcp#145 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
rubocop/rubocop-rspec#2236 ·
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
riscv/riscv-unified-db#2624 · 1 Reaktion ·
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100