NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.59k stars 13.07k forks source link

Temporary ABI incompatibility between plugins built for upstream rofi and rofi-wayland #298539

Open Myned opened 3 months ago

Myned commented 3 months ago

Describe the bug

Plugins that are built for release rofi (1.7.5) are ABI incompatible with rofi-wayland (1.7.5+wayland2/3) until the next upstream release, resulting in runtime errors when attempting to run rofi with those plugins enabled (namely rofi-calc):

(process:124485): Rofi-WARNING **: 23:02:32.891: ABI version of plugin: 'calc.so' does not match: 00000006 expecting: 00000007

Those plugins need to be built against rofi-wayland instead of upstream rofi. This can be worked around in nixpkgs by overriding the rofi-unwrapped package in the plugin module:

(pkgs.rofi-calc.override {
  rofi-unwrapped = rofi-wayland-unwrapped;
})

Steps To Reproduce

  1. Build rofi-wayland with rofi-calc plugin (overlay or home-manager)
  2. Execute rofi -modes calc -show calc in terminal
  3. Observe error message "Mode calc is not found." with above warning printed in terminal

Expected behavior

  1. Observe rofi-calc operating normally

Additional context

This is more a reference for those encountering the bug than an actionable issue.

The incompatibility should only last until the next rofi release, but something of this nature that requires different build inputs for plugins may occur again in the future considering that rofi-wayland strays behind upstream by design. In which case, anything that can be done through nixpkgs would be welcome, though home-manager seems like it would be the best place to handle that as it already exposes options for plugins.

Notify maintainers

rofi(-wayland): @bew rofi-calc: @luc65r @albakham

Metadata

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.8.0-zen1, NixOS, 24.05 (Uakari), 24.05.20240323.44d0940`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.2`
 - nixpkgs: `/nix/store/amxd2p02wx78nyaa4bkb0hjvgwhz1dq7-source`

Add a :+1: reaction to issues you find important.

BbIXOD commented 3 months ago

Can I do something on distro other than NixOS or it is better just to wait?

Myned commented 3 months ago

For other distros, you can build rofi-calc from source using rofi-wayland headers, or probably downgrade rofi-wayland to version 1.7.5+wayland1, but the latter is untested and you may run into other issues that are fixed with recent versions.

sdaqo commented 2 weeks ago

Maybe related (?): I get a collision error when using any plugin

> error: collision between `/nix/store/yi64...-rofi-1.7.5+wayland3/bin/rofi' and `/nix/store/sr361...-rofi-1.7.5+wayland3/bin/rofi'
pkgs.rofi-wayland.override { plugins = [pkgs.rofi-calc]; };

Tried with override:

(final: prev: {
    rofi-calc = prev.rofi-calc.override {rofi-unwrapped = prev.rofi-wayland-unwrapped;};
})

Should I open a separate Issue for this?

Myned commented 1 week ago

@sdaqo

A collision is likely due to different derivations of rofi being used in your configuration, which is not this issue:

/nix/store/yi64...-rofi-1.7.5+wayland3/bin/rofi /nix/store/sr361...-rofi-1.7.5+wayland3/bin/rofi

In this case, you may have references to pkgs.rofi-wayland that are not overridden to include plugins. I use the home-manager options instead of overrides myself, so I may be reading the situation incorrectly.