vhakulinen / gnvim

GUI for neovim, without any web bloat
MIT License
1.86k stars 68 forks source link

thread 'main' panicked at 'Failed to retrieve template child. Please check that it has been bound and has a #[template_child] attribute. #201

Closed henrique-smr closed 1 year ago

henrique-smr commented 1 year ago

Error running gnvim:

$ RUST_BACKTRACE=full ./gnvim 

thread 'main' panicked at 'Failed to retrieve template child. Please check that it has been bound and has a #[template_child] attribute.', /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/gtk4-0.4.7/src/subclass/widget.rs:1303:17
stack backtrace:
   0:     0x55d3e9bfb18a - std::backtrace_rs::backtrace::libunwind::trace::h34aec3ef6cd8ad7e
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x55d3e9bfb18a - std::backtrace_rs::backtrace::trace_unsynchronized::h8035d38698d0f7a8
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x55d3e9bfb18a - std::sys_common::backtrace::_print_fmt::hff968f6695a1ba22
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x55d3e9bfb18a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h7eea0efe77acf1ec
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x55d3e9c1c0fe - core::fmt::write::hc553f17407eb0b48
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/fmt/mod.rs:1208:17
   5:     0x55d3e9bf8cd5 - std::io::Write::write_fmt::h62e5f01a089f48c0
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/io/mod.rs:1682:15
   6:     0x55d3e9bfaf55 - std::sys_common::backtrace::_print::h52d116aff3db4cd1
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x55d3e9bfaf55 - std::sys_common::backtrace::print::h9e7d2f98fb7af075
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x55d3e9bfc5df - std::panicking::default_hook::{{closure}}::hf74999dab2d0a95c
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:267:22
   9:     0x55d3e9bfc31b - std::panicking::default_hook::hc11ca7d10c44c42f
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:286:9
  10:     0x55d3e9bfccec - std::panicking::rust_panic_with_hook::hdb4da1ae79c845a5
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:688:13
  11:     0x55d3e9bfca42 - std::panicking::begin_panic_handler::{{closure}}::h02b5b35b126d5cf2
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:577:13
  12:     0x55d3e9bfb63c - std::sys_common::backtrace::__rust_end_short_backtrace::h6c6853376cf416d1
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/sys_common/backtrace.rs:137:18
  13:     0x55d3e9bfc792 - rust_begin_unwind
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:575:5
  14:     0x55d3e9a915b3 - core::panicking::panic_fmt::hfd9e949092070b66
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/panicking.rs:64:14
  15:     0x55d3e9abbf5a - <gnvim::components::popupmenu::imp::Popupmenu as gtk4::subclass::widget::CompositeTemplate>::check_template_children::hb4ad8d305ff6519f
  16:     0x55d3e9adb8a9 - glib::subclass::types::instance_init::h291c9565c7d98d55
  17:     0x7f674c7b3de9 - g_type_create_instance
  18:     0x7f674c797d30 - <unknown>
  19:     0x7f674c7993fc - g_object_new_with_properties
  20:     0x7f674c79a001 - g_object_new
  21:     0x7f674c02a8f1 - <unknown>
  22:     0x7f674c02c585 - <unknown>
  23:     0x7f674c02ec3a - <unknown>
  24:     0x7f674c02c68f - <unknown>
  25:     0x7f674c25f838 - <unknown>
  26:     0x7f674c02f600 - <unknown>
  27:     0x7f674c028119 - gtk_builder_extend_with_template
  28:     0x7f674c23b35c - gtk_widget_init_template
  29:     0x55d3e9adc58e - glib::subclass::types::instance_init::h84fabbcdb635eb69
  30:     0x7f674c7b3de9 - g_type_create_instance
  31:     0x7f674c797d30 - <unknown>
  32:     0x7f674c7993fc - g_object_new_with_properties
  33:     0x7f674c79a001 - g_object_new
  34:     0x7f674c02a8f1 - <unknown>
  35:     0x7f674c02c585 - <unknown>
  36:     0x7f674c02ec3a - <unknown>
  37:     0x7f674c02c68f - <unknown>
  38:     0x7f674c25f838 - <unknown>
  39:     0x7f674c02f600 - <unknown>
  40:     0x7f674c028119 - gtk_builder_extend_with_template
  41:     0x7f674c23b35c - gtk_widget_init_template
  42:     0x55d3e9adcbe7 - glib::subclass::types::instance_init::hc557e18646740de5
  43:     0x7f674c7b3de9 - g_type_create_instance
  44:     0x7f674c797d30 - <unknown>
  45:     0x7f674c7993fc - g_object_new_with_properties
  46:     0x7f674c79a001 - g_object_new
  47:     0x7f674c02a8f1 - <unknown>
  48:     0x7f674c02c585 - <unknown>
  49:     0x7f674c02ec3a - <unknown>
  50:     0x7f674c02c68f - <unknown>
  51:     0x7f674c25f838 - <unknown>
  52:     0x7f674c02f600 - <unknown>
  53:     0x7f674c028119 - gtk_builder_extend_with_template
  54:     0x7f674c23b35c - gtk_widget_init_template
  55:     0x55d3e9adcede - glib::subclass::types::instance_init::hf97c797178c6866d
  56:     0x7f674c7b3de9 - g_type_create_instance
  57:     0x7f674c797d30 - <unknown>
  58:     0x7f674c799610 - g_object_newv
  59:     0x55d3e9bdb1f0 - glib::object::Object::new_internal::h76295acf8e344281
  60:     0x55d3e9bdad4a - glib::object::Object::with_type::h716aacc49055bf10
  61:     0x55d3e9b1aa1b - glib::object::Object::new::hcdd1a829a513aad3
  62:     0x55d3e9abbd08 - gnvim::build_ui::hd79373e4309cc27a
  63:     0x55d3e9aaa561 - <O as gio::auto::application::ApplicationExt>::connect_activate::activate_trampoline::h2a773a1a3f57287f
  64:     0x7f674c7923b0 - g_closure_invoke
  65:     0x7f674c7a5076 - <unknown>
  66:     0x7f674c7abbf5 - g_signal_emit_valist
  67:     0x7f674c7abdbf - g_signal_emit
  68:     0x7f674bc42438 - <unknown>
  69:     0x7f674bc425c6 - g_application_run
  70:     0x55d3e9aaa2e3 - <O as gio::application::ApplicationExtManual>::run_with_args::h013a3dd5eb818848
  71:     0x55d3e9abbc14 - gnvim::main::h1eb1ec94783b3609
  72:     0x55d3e9b176e3 - std::sys_common::backtrace::__rust_begin_short_backtrace::h179834cfdcf77433
  73:     0x55d3e9aca489 - std::rt::lang_start::{{closure}}::hbfbea9908e69c2a5
  74:     0x55d3e9bf52bc - core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once::h9ab31282e87f134a
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/core/src/ops/function.rs:606:13
  75:     0x55d3e9bf52bc - std::panicking::try::do_call::h42ddf5b01d0b4bc7
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:483:40
  76:     0x55d3e9bf52bc - std::panicking::try::hfb70320d7386c61a
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:447:19
  77:     0x55d3e9bf52bc - std::panic::catch_unwind::h978c9edbad2bb4d4
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panic.rs:137:14
  78:     0x55d3e9bf52bc - std::rt::lang_start_internal::{{closure}}::h04ede5bd2f26b553
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/rt.rs:148:48
  79:     0x55d3e9bf52bc - std::panicking::try::do_call::ha6b9da35a0885c93
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:483:40
  80:     0x55d3e9bf52bc - std::panicking::try::h3325520cab3a642e
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panicking.rs:447:19
  81:     0x55d3e9bf52bc - std::panic::catch_unwind::h160beec6f047175b
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/panic.rs:137:14
  82:     0x55d3e9bf52bc - std::rt::lang_start_internal::h79190e3a877a769d
                               at /rustc/fc594f15669680fa70d255faec3ca3fb507c3405/library/std/src/rt.rs:148:20
  83:     0x55d3e9abc065 - main
  84:     0x7f674b77218a - <unknown>
  85:     0x7f674b772245 - __libc_start_main
  86:     0x55d3e9a91b71 - _start
  87:                0x0 - <unknown>
vhakulinen commented 1 year ago

Is this on the latest master?

gmankab commented 1 year ago

Is this on the latest master?

yes

i have same error

image

image

MostHated commented 1 year ago

Same error here as well. Fresh clone 5 minutes ago.

System Details ```sh OS: Pop!_OS 22.04 LTS x86_64 Host: X670E Taichi Kernel: 6.1.11-76060111-generic Uptime: 4 hours, 9 mins Packages: 4494 (dpkg), 43 (nix-default), 115 (flatpak), 17 (snap) Shell: zsh 5.8.1 Resolution: 2560x1080 DE: GNOME 42.5 WM: Mutter WM Theme: Pop-dark Theme: Pop-dark [GTK2/3] Icons: Flatery-Orange-Dark [GTK2/3] Terminal: figterm CPU: AMD Ryzen 9 7950X (32) @ 4.500GHz GPU: AMD ATI Radeon RX 6800/6800 XT / 6900 XT GPU: AMD ATI 59:00.0 Device 164e Memory: 31713MiB / 63415MiB ```
jkemp814 commented 1 year ago

Same error.

Fedora Linux 37 Silverblue.

Compiling gnvim v0.3.0-dev (/var/home/james/.src/gnvim/ui) Finished release [optimized] target(s) in 3m 00s

No errors reported while compiling.

cargo 1.67.1

nvim --version ─╯ NVIM v0.8.3 Build type: RelWithDebInfo LuaJIT 2.1.0-beta3 Compilation: /usr/bin/gcc -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/builddir/build/BUILD/neovim-0.8.3/redhat-linux-build/cmake.config -I/builddir/build/BUILD/neovim-0.8.3/src -I/usr/include -I/usr/include/luajit-2.1 -I/builddir/build/BUILD/neovim-0.8.3/redhat-linux-build/src/nvim/auto -I/builddir/build/BUILD/neovim-0.8.3/redhat-linux-build/include Compiled by mockbuild@koji

Features: +acl +iconv +tui See ":help feature-compile"

system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

svavs commented 1 year ago

Same error on Fedora 37.

❯ sudo make install          
[sudo] password di silvano: 
install -d "/usr/local/bin"
install ./target/release/gnvim "/usr/local/bin"
install -d "/usr/local/share/gnvim"
cp -r ./runtime "/usr/local/share/gnvim"
install -d "/usr/local/share/applications"
sed -e "s|Exec=gnvim|Exec=/usr/local/bin/gnvim|" \
    "./desktop/gnvim.desktop" \
    >"/usr/local/share/applications/gnvim.desktop"
install -d "/usr/local/share/icons/hicolor/48x48/apps"
install -d "/usr/local/share/icons/hicolor/128x128/apps"
cp ./desktop/gnvim_128.png "/usr/local/share/icons/hicolor/128x128/apps/gnvim.png"
cp ./desktop/gnvim_48.png "/usr/local/share/icons/hicolor/48x48/apps/gnvim.png"

❯ gnvim
thread 'main' panicked at 'Failed to retrieve template child. Please check that it has been bound and has a #[template_child] attribute.', /home/silvano/.cargo/registry/src/github.com-1ecc6299db9ec823/gtk4-0.4.7/src/subclass/widget.rs:1303:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

❯ uname -srmno
Linux fedora 6.1.13-200.fc37.x86_64 x86_64 GNU/Linux
Aframuz commented 1 year ago

Executing cargo update -p gtk4 before build worked for me

MostHated commented 1 year ago

Executing cargo update -p gtk4 before build worked for me

Awesome, this worked for me as well. :+1:

vhakulinen commented 1 year ago

Should be fixed by 2f1a54d674362341ae1e4c58b97c3cc2821ab4b2.