Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

weechat multiline.pl broken due to legacy Pod::Select being remove from perl #106506

Closed
yipengsun opened this issue Dec 10, 2020 · 7 comments
Closed
Labels
0.kind: bug Something is broken

Comments

@yipengsun
Copy link
Contributor

Describe the bug
I've been using multiline.pl in weechat for multi-line message support. After updating to NixOS 20.09 and weechat 2.9, the script no longer works.

When trying to load that script, weechat had the following error:

2020-12-10 02:38:00		perl: error: Can't locate Pod/Select.pm in @INC (you may need to install the Pod::Select module) (@INC contains: /nix/store/ifayp0kvijq0n4x0bv51iqrb0yzyz77g-perl-5.32.0/lib/perl5/site_perl/5.32.0/x86_64-linux-thread-multi /nix/store/ifayp0kvijq0n4x0bv51iqrb0yzyz77g-perl-5.32.0/lib/perl5/site_perl/5.32.0 /nix/store/ifayp0kvijq0n4x0bv51iqrb0yzyz77g-perl-5.32.0/lib/perl5/5.32.0/x86_64-linux-thread-multi /nix/store/ifayp0kvijq0n4x0bv51iqrb0yzyz77g-perl-5.32.0/lib/perl5/5.32.0) at /home/syp/.weechat/perl/autoload/multiline.pl line 240.
2020-12-10 02:38:00		perl: error: Can't locate Pod/Select.pm in @INC (you may need to install the Pod::Select module) (@INC contains: /nix/store/ifayp0kvijq0n4x0bv51iqrb0yzyz77g-perl-5.32.0/lib/perl5/site_perl/5.32.0/x86_64-linux-thread-multi /nix/store/ifayp0kvijq0n4x0bv51iqrb0yzyz77g-perl-5.32.0/lib/perl5/site_perl/5.32.0 /nix/store/ifayp0kvijq0n4x0bv51iqrb0yzyz77g-perl-5.32.0/lib/perl5/5.32.0/x86_64-linux-thread-multi /nix/store/ifayp0kvijq0n4x0bv51iqrb0yzyz77g-perl-5.32.0/lib/perl5/5.32.0) at /home/syp/.weechat/perl/autoload/multiline.pl line 240.
2020-12-10 02:38:00		BEGIN failed--compilation aborted at /home/syp/.weechat/perl/autoload/multiline.pl line 240.
2020-12-10 02:38:00	=!=	perl: function "register" not found (or failed) in file "/home/syp/.weechat/perl/autoload/multiline.pl"
2020-12-10 02:38:00		perl scripts loaded: highmon
2020-12-10 02:38:00		Plugins loaded: alias, buflist, charset, exec, fifo, fset, irc, logger, lua, perl, python, relay, script, spell, trigger, xfer
2020-12-10 02:38:00		python: loading script "/nix/store/mx91fb7q7vfvc0zc4l8fx9amhyq1nrcd-wee-slack-2.6.0/share/wee_slack.py"
2020-12-10 02:38:00		python: registered script "slack", version 2.6.0 (Extends weechat for typing notification/search/etc on slack.com)
2020-12-10 02:38:00		Connecting to 2 slack teams.
2020-12-10 02:38:49		fifo: pipe closed

To Reproduce
Steps to reproduce the behavior:

  1. Download the multiline.pl from the official weechat repo
  2. Make sure it's on NixOS 20.09 with weechat 2.9
  3. Copy the script to $HOME/.weechat/perl/autoload

Expected behavior
No error message on weechat startup, and the multi-line message works

Additional context
I found this issue is already reported at weechat/scripts#421. On Arch linux, this seems to be solved by install the Pod::Select manually.

Notify maintainers

@lovek323 @lheckemann

Metadata
Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

 - system: `"x86_64-linux"`
 - host os: `Linux 5.9.12, NixOS, 20.09.2152.e34208e1003 (Nightingale)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.3.9`
 - channels(root): `"nixos-20.09.2152.e34208e1003"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module:
@yipengsun yipengsun added the 0.kind: bug Something is broken label Dec 10, 2020
@aanderse
Copy link
Member

This script should probably be packaged for nixpkgs so it can have a proper perl environment. @stigtsp any thoughts on that? You wouldn't happen to be a weechat user, would you?

@stigtsp
Copy link
Member

stigtsp commented Dec 10, 2020

Pod::Select is provided by perlPackages.PodParser, you can get a nix-shell which includes this module in @INC by using nix-shell -p 'perl.withPackages(p:[p.PodParser])'

In the case of weechat you can do something like this to get a Perl which includes this module:

    (weechat.override {
      configure = { availablePlugins, ...}: {
        plugins = with availablePlugins; [
          (perl.withPackages(p: [ p.PodParser ]))
        ];
      };
    })

@yipengsun
Copy link
Contributor Author

yipengsun commented Dec 10, 2020

Thanks. I was able to get multiline.pl work again by overriding weechat in an overlay to add PodParser to perl:

   weechat = super.weechat.override {
    configure = { availablePlugins, ... }: {
      plugins = with availablePlugins; [
        (perl.withPackages (p: [ p.PodParser ]))
      ] ++ [ python ];
      scripts = with super.weechatScripts; [
        wee-slack
      ] ++ self.stdenv.lib.optionals (!self.stdenv.isDarwin) [ weechat-notify-send ];
    };
  };

Edit: Hopefully for better clarity.

@krzkrzkrz
Copy link

krzkrzkrz commented Jan 21, 2021

Im consfused, and for better clarity for others who come across the same issue. What is the solution exactly?

@krzkrzkrz
Copy link

For those wondering, on Arch, one should install perl-pod-parser. Also highlighted https://wiki.archlinux.org/index.php/WeeChat#Problem_loading_multiline.pl

@yipengsun
Copy link
Contributor Author

yipengsun commented Jan 21, 2021

My solution is to override weechat in an overlay. The relevant lines are these:

      plugins = with availablePlugins; [
        (perl.withPackages (p: [ p.PodParser ]))
      ] ++ [ python ];

Make sure you list all types of plugins (e.g. Perl and Python) that you intent to use, as this overrides that setting, instead of append to default values.

@codybuell
Copy link

On OSX installing Pod::Parser with cpan did the trick:

brew install perl
cpan install Pod::Parser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests

5 participants