NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.62k stars 13.77k forks source link

weechat-matrix-bridge: fails to load with “undefined symbol: lua_objlen” #65271

Open bdesham opened 5 years ago

bdesham commented 5 years ago

Describe the bug

When running a version of Weechat that has the weechat-matrix-bridge script “built in,” Weechat gives the following errors on startup:

lua: loading script "/nix/store/962z42i4kxmb1r4bb75lfqbs5xdc122g-weechat-matrix-bridge-2018-11-19/share/matrix.lua"
lua: unable to execute file "/nix/store/962z42i4kxmb1r4bb75lfqbs5xdc122g-weechat-matrix-bridge-2018-11-19/share/matrix.lua"
lua: error: error loading module 'cjson' from file '/nix/store/962z42i4kxmb1r4bb75lfqbs5xdc122g-weechat-matrix-bridge-2018-11-19/lib/cjson.so':
/nix/store/962z42i4kxmb1r4bb75lfqbs5xdc122g-weechat-matrix-bridge-2018-11-19/lib/cjson.so: undefined symbol: lua_objlen

The Matrix features like /matrix ... are unavailable.

To Reproduce

  1. Have a config.nix that looks like this:

    { pkgs }:

    { packageOverrides = pkgs: { myWeechat = pkgs.weechat.override { configure = { availablePlugins, ... }: { plugins = with availablePlugins; [ lua ]; scripts = with pkgs.weechatScripts; [ weechat-matrix-bridge ]; }; }; }

  2. Install the customized weechat with nix-env -i -A nixpkgs.myWeechat

  3. Run weechat

Expected behavior

Weechat launches and the Matrix script is loaded successfully.

Additional info

Running the customized version of Weechat and loading the script manually with /script load /nix/store/962z42i4kxmb1r4bb75lfqbs5xdc122g-weechat-matrix-bridge-2018-11-19/share/matrix.lua gives the same error message.

Metadata

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute: weechat-matrix-bridge
zimbatm commented 5 years ago

maintainers: @ma27

Ma27 commented 5 years ago

So, I can reproduce the bug on master (f99063f6a1c2ee14794c3d79d51a7d3a497bee83), however it appears to work fine on release-19.03, so you might want to use the weechatScripts.weechat-matrix-bridge from 19.03 as a temporary workaround.

Two additional things to note:

bdesham commented 5 years ago

Yeah, I noticed that the README for weechat-matrix-protocol-script mentions https://github.com/poljar/weechat-matrix as an alternative. It seems like maybe the encryption support in that script is more fleshed out than in weechat-matrix-protocol-script. (It’s written in Python, though, and I’ve compiled my Weechat without Python because of #64167, so I haven’t tried to use it yet.)

Ma27 commented 5 years ago

WeeChat can be built with Python using an expression like this:

weechat.override {
  configure = { availablePlugins }: {
    plugins = with availablePlugins; [
      python
    ];
  };
}

It would be awesome to get some feedback on how reliable this works, then we could actually deprecate this package :)

Ma27 commented 5 years ago

@bdesham did you manage to take a look at the python-based matrix plugin? I'd still prefer to get rid of the current one :)

vcunat commented 5 years ago

lua_objlen: are you sure you got lua versions right in there? 5.2 language changelog:

Function lua_objlen was renamed lua_rawlen.

bdesham commented 5 years ago

@Ma27 I did take a look, but that plugin depends on the matrix-nio package, which we don’t have a derivation for yet. I haven’t looked into it any further yet.

Ma27 commented 5 years ago

Have you also checked what @vcunat suggested? :)

bdesham commented 5 years ago

Sorry, I’m not sure what the suggestion was :-) If lua_objlen was removed, that would explain the error I got (lib/cjson.so: undefined symbol: lua_objlen), wouldn’t it? It seems like maybe the code in the plugin is just incompatible with the version of Lua that WeeChat is being built against in the latest Nixpkgs master.

vcunat commented 5 years ago

The suggestion I meant was to check what upstream says about lua compatibility and perhaps use that version of lua (if that doesn't collide with something else – I haven't looked). Or... this function rename should be easy to fix by itself, but there are much worse incompatibilities between the language versions.

vcunat commented 5 years ago

Oh, can you re-test after #67382? I see it was using luaffi linked against lua-5.1 and the rest linked against lua-5.2.

bdesham commented 5 years ago

It still doesn’t seem to work, unfortunately 😕 Following the steps in the original post gives the same error as before.

stale[bot] commented 4 years ago

Thank you for your contributions. This has been automatically marked as stale because it has had no activity for 180 days. If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity. Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse. 3. Ask on the #nixos channel on irc.freenode.net.
teto commented 2 years ago

is it still relevant, looks like it's using an incorrect lua version.