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

Created on 22 Jul 2019  Â·  13Comments  Â·  Source: NixOS/nixpkgs

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

  • system: "x86_64-linux"
  • host os: Linux 4.4.0-151-generic, Ubuntu, 16.04.6 LTS (Xenial Xerus)
  • multi-user?: no
  • sandbox: yes
  • version: nix-env (Nix) 2.2.2
  • channels(bdesham): "nixpkgs-19.09pre185473.31c38894c90"
  • nixpkgs: /home/bdesham/.nix-defexpr/channels/nixpkgs

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute: weechat-matrix-bridge
bug stale lua

All 13 comments

maintainers: @ma27

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:

  • The package doesn't support encryption of new Matrix rooms which is why I hardly use this anymore. I'm actually thinking about removing this entirely and look for alternatives in case they don't get to implement this.

  • On master some internal stuff for the lua packages changed (including the cjson package for lua), I'm pretty certain that it's somehow related to this change, will try to investigate and provide a fix :)

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.)

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 :)

@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 :)

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

Function lua_objlen was renamed lua_rawlen.

@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.

Have you also checked what @vcunat suggested? :)

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.

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.

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.

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

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.
Was this page helpful?
0 / 5 - 0 ratings

Related issues

teto picture teto  Â·  3Comments

langston-barrett picture langston-barrett  Â·  3Comments

matthiasbeyer picture matthiasbeyer  Â·  3Comments

spacekitteh picture spacekitteh  Â·  3Comments

grahamc picture grahamc  Â·  3Comments