weechat-matrix-rs icon indicating copy to clipboard operation
weechat-matrix-rs copied to clipboard

Error: API mismatch for plugin

Open ams72 opened this issue 2 years ago • 9 comments

I'm getting this upon opening weechat 3.0.1:

Error: API mismatch for plugin "/home/ams/.weechat/plugins/matrix.so" (current API: "20201004-01", plugin API: "20200621-01"), failed to load
 If plugin "matrix" is old/obsolete, you can delete this file.

ams72 avatar Oct 13 '21 22:10 ams72

If are you using the binary from the repo's CI/CD, it uses the latest stable weechat, so update your weechat. If you are building it yourself, it should already use the correct weechat API installed on your system unless you have updated Weechat but didn't rebuild the plugin.

pvonmoradi avatar Oct 17 '21 08:10 pvonmoradi

I'm still very much a novice with rust (and frankly don't have time right now to really look to see where I can help test), but I tried relying on my fork of rust-weechat with an updated API (from 20200621-01 to 20210704-01 in rust-weechat/weechat-sys/src/weechat-plugin). Building the plugin works fine, but trying to start weechat results in a crash.

I'm not sure if this belongs here or a new issue on rust-weechat, but this was the backtrace given:

(written by WeeChat 3.3, compiled on Oct 10 2021 13:19:04)
001  ??:? [function weechat_backtrace]
002  ??:? [function debug_sigsegv_cb]
003  sigaction.c:? [function __restore_rt]
004  /builddir/glibc-2.32/string/../sysdeps/x86_64/multiarch/strlen-avx2.S:96 [function __strlen_avx2]
005  /builddir/glibc-2.32/string/strdup.c:41 [function __GI___strdup]
006  ??:? [function hook_infolist]
007  <weechat::hooks::Hook as core::ops::drop::Drop>::drop
007  /home/ElDifinitivo/.cargo/git/checkouts/rust-weechat-bef6955044b5e4a2/0cd8308/weechat/src/hooks/mod.rs:41
008  core::ptr::drop_in_place<weechat::hooks::Hook>
008  /rustc/f1edd0429582dd29cccacaf50fd134b05593bd9c/library/core/src/ptr/mod.rs:188
009  weechat::hooks::fd::FdHook<F>::new
009  /home/ElDifinitivo/.cargo/git/checkouts/rust-weechat-bef6955044b5e4a2/0cd8308/weechat/src/hooks/fd.rs:181
010  weechat::executor::WeechatExecutor::new
010  /home/ElDifinitivo/.cargo/git/checkouts/rust-weechat-bef6955044b5e4a2/0cd8308/weechat/src/executor.rs:104
011  weechat::executor::WeechatExecutor::start
011  /home/ElDifinitivo/.cargo/git/checkouts/rust-weechat-bef6955044b5e4a2/0cd8308/weechat/src/executor.rs:157
012  weechat::weechat::Weechat::init_from_ptr
012  /home/ElDifinitivo/.cargo/git/checkouts/rust-weechat-bef6955044b5e4a2/0cd8308/weechat/src/weechat.rs:?
013  /home/ElDifinitivo/bin/git/weechat-matrix-rs/src/lib.rs:281 [function weechat_plugin_init]
014  ??:? [function plugin_call_init]
015  ??:? [function plugin_auto_load]
016  ??:? [function plugin_init]
017  ??:? [function weechat_init]
018  ??:? [function main]
019  /builddir/glibc-2.32/csu/../csu/libc-start.c:314 [function __libc_start_main]
020  ??:? [function _start]

ElDifinitivo avatar Dec 09 '21 18:12 ElDifinitivo

I think that's a bug in the rust-weechat crate, something to do with the FdHook constructor.

poljar avatar Feb 01 '22 08:02 poljar

Similar problem but in this case weechat-matrix-rs is obsolete, not the other way around:

API mismatch for plugin "/home/sircmpwn/.weechat/plugins/matrix.so" (current API: "20220312-01", plugin API: "20200621-01"), failed to load

ddevault avatar Apr 06 '22 19:04 ddevault

The build will by default use the systemwide weechat-plugin.h file, otherwise a bundled one will be used. The bundled one is as you can see very outdated.

You can also point at a custom one, more info here: https://github.com/poljar/rust-weechat/tree/master/weechat-sys#choosing-the-plugin-include-file.

poljar avatar Apr 06 '22 19:04 poljar

Since the bundled one by all rights simply does not work any longer, should it be removed? An error during the build is much better than an error at runtime.

ddevault avatar Apr 06 '22 19:04 ddevault

Yeah, that might be a good idea at this point. The initial idea was to keep it up-to date with the latest Weechat release.

poljar avatar Apr 06 '22 20:04 poljar

You can also point at a custom one, more info here: https://github.com/poljar/rust-weechat/tree/master/weechat-sys#choosing-the-plugin-include-file.

Hi, this link returns a 404. Are the details still relevant and if so I would like to read through it because I believe I am having the problem described with the -dev of weechat.

carldavis avatar Nov 23 '23 16:11 carldavis

This link works https://github.com/poljar/rust-weechat/tree/master/crates/weechat-sys#choosing-the-plugin-include-file.

poljar avatar Nov 23 '23 16:11 poljar