WayfireWM / WayfireWM/wayfire

wayfire-plugin meson libdir can be incorrect (Ubuntu 24.04)

Open
#3,124 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C++
Stars
3.1k
Forks
237
Avg merge
1h 43m
Merged PRs (30d)
1

Description

Wayfire version

0.12 (latest git)

GPU / Driver

Not relevant

Describe the bug

I'm trying out the new wayfire-plugin command with my plugins, but ran into some problems. Specifically, I'm trying to follow the instructions here to adjust the build of a plugin.

To Reproduce

Steps to reproduce the behavior:

  1. Write a simple plugin that uses meson
  2. Use the recommended command to install, e.g.
scale_ipc_filter_lib = shared_module('scale_ipc_filter', sources,
    dependencies: [wayfire],
    install: true,
    install_dir: get_option('prefix') / get_option('libdir') / 'wayfire',
    cpp_args: ['-Wno-unused-parameter', '-Wno-format-security','-DWAYFIRE_PLUGIN'],
    link_args: '-rdynamic')
  1. Plugin gets installed under: ~/.local/share/wayfire/plugin-manager/install/lib/x86_64-linux-gnu/wayfire/
  2. Wayfire cannot load it as it is looking for plugins under ~/.local/share/wayfire/plugin-manager/install/lib/wayfire -- see here

Note: the plugin shows up as correctly installed with wayfire-plugin:

wayfire-plugin list
wayfire-scale-ipc: 0.12.0 ABI 20260801

Expected behavior

Wayfire can find and load the plugin.

Apparently, on Ubuntu (and I assume Debian as well), get_option('libdir') expands to lib/x86_64-linux-gnu by default. Everything works as expected if I change the meson install command to include:

install_dir: get_option('prefix') / 'lib' / 'wayfire',

I suggest to either:

  • update the doc to suggest using 'lib' as that is where Wayfire will look for (and there does not seems to be a downside of a hardcoded path, since this is a directory only used by Wayfire)
  • change the path discovery to use the "libdir" that meson does via config.h (that now only contains a full path to system plugins)

Let me know which solution is preferred, and I can create a PR.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with docs/wayfire-plugin-author.md and src/core/plugin-loader.cpp around line 329, then reproduce the Meson installation on Ubuntu 24.04 using the command shown. Determine whether the documentation or plugin path discovery should change, and verify that a plugin installed with wayfire-plugin can be found and loaded.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.