Camelcade / Perl5-IDEA

Perl5 plugins for IntelliJ IDEA
https://plugins.jetbrains.com/plugin/7796-perl/
Other
408 stars 75 forks source link

Properly handle hanging deparser #2490

Open cynovg opened 2 years ago

cynovg commented 2 years ago

After every start IDE i see warning about outadet XSubs declarations. When you try to regenerate, the process starts in the background and does not end. It is repeated in all projects, an attempt to roll back the IDE version did not lead to anything. This leads to the fact that some of the functions do not work. For example, renaming a function (Shift+F6).

After stopping the IDE, I see a sleeping process:

 48725 ?        S      0:00 /usr/bin/perl -I/home/cynovg/audiofile-info/lib /home/cynovg/.local/share/JetBrains/Toolbox/apps/CLion/ch-0/221.5080.224.plugins/plugin/perl/xs_parser_simple.pl

When I try to run the process from the terminal, I see:

/usr/bin/perl -I/home/cynovg/audiofile-info/lib /home/cynovg/.local/share/JetBrains/Toolbox/apps/CLion/ch-0/221.5080.224.plugins/plugin/perl/xs_parser_simple.pl
Subroutine can redefined at /usr/lib/x86_64-linux-gnu/perl5/5.30/Class/C3/XS.pm line 41.
Subroutine method redefined at /usr/lib/x86_64-linux-gnu/perl5/5.30/Class/C3/XS.pm line 43.
Subroutine method redefined at /usr/lib/x86_64-linux-gnu/perl5/5.30/Class/C3/XS.pm line 51.
Too late to run INIT block at /usr/lib/x86_64-linux-gnu/perl5/5.30/Glib/Object/Introspection.pm line 257.
Subroutine Pango::Layout::set_text redefined at /usr/share/perl5/Gtk3.pm line 2260.
Subroutine Pango::Layout::set_markup redefined at /usr/share/perl5/Gtk3.pm line 2266.
GLib-GObject-WARNING **: cannot register existing type 'GtkWidget' at /usr/lib/x86_64-linux-gnu/perl5/5.30/Glib/Object/Introspection.pm line 110.
GLib-GObject-WARNING **: cannot add class private field to invalid type '<invalid>' at /usr/lib/x86_64-linux-gnu/perl5/5.30/Glib/Object/Introspection.pm line 110.
GLib-GObject-WARNING **: cannot add private field to invalid (non-instantiatable) type '<invalid>' at /usr/lib/x86_64-linux-gnu/perl5/5.30/Glib/Object/Introspection.pm line 110.
GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed at /usr/lib/x86_64-linux-gnu/perl5/5.30/Glib/Object/Introspection.pm line 110.
GLib-GObject-WARNING **: cannot register existing type 'GtkBuildable' at /usr/lib/x86_64-linux-gnu/perl5/5.30/Glib/Object/Introspection.pm line 110.
GLib-GObject-CRITICAL **: g_type_interface_add_prerequisite: assertion 'G_TYPE_IS_INTERFACE (interface_type)' failed at /usr/lib/x86_64-linux-gnu/perl5/5.30/Glib/Object/Introspection.pm line 110.
GLib-CRITICAL **: g_once_init_leave: assertion 'result != 0' failed at /usr/lib/x86_64-linux-gnu/perl5/5.30/Glib/Object/Introspection.pm line 110.
GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed at /usr/lib/x86_64-linux-gnu/perl5/5.30/Glib/Object/Introspection.pm line 110.
GLib-GObject-CRITICAL **: g_type_register_static: assertion 'parent_type > 0' failed at /usr/lib/x86_64-linux-gnu/perl5/5.30/Glib/Object/Introspection.pm line 110.
GLib-GObject-WARNING **: cannot add private field to invalid (non-instantiatable) type '<invalid>' at /usr/lib/x86_64-linux-gnu/perl5/5.30/Glib/Object/Introspection.pm line 110.

Выделение_509

hurricup commented 2 years ago

Basically you should do:

  1. Uncomment https://github.com/Camelcade/Perl5-IDEA/blob/master/plugin/scripts/xs_parser_simple.pl#L14
  2. Run script from the console
  3. See on which module script stucks
  4. Try perl -MScript::In::Question it should do nothing (not hang not crush)
  5. If it does - worth asking module author - why.
hurricup commented 2 years ago

We could add the heartbeat message to the deparsing script and catch if it not finished and silent for a long time. And kill it by ourselves.

We could probably even show in progress - what are we currently doing. Indicator may be used with possibility to cancel.