Skip to content

[rebase] split off gps and cava modules into run-time loaded shared libraries#4735

Open
qbe wants to merge 9 commits intoAlexays:masterfrom
qbe:dynamic-modules-rebase
Open

[rebase] split off gps and cava modules into run-time loaded shared libraries#4735
qbe wants to merge 9 commits intoAlexays:masterfrom
qbe:dynamic-modules-rebase

Conversation

@qbe
Copy link
Contributor

@qbe qbe commented Dec 29, 2025

rebase of #4667 , a (proposed) fix for #4276

justification for this PR is discussed in the issue, dynamically loading modules allows a waybar build with cava and gps capabilities to be packaged in a way that allows for libgps, libcava and epoxy to be optional dependencies.

Another goal of this PR was to include as few modifications to module code as necessary. For this reason I decided to split off the cava and gps modules into shared libraries, and to load them in factory.cpp using dlopen() / dlsym() .

The first 4 commits deal with the fact that reap_mtx / reap were previously an "extern" reference deep within include/util/command.hpp , which is included in every module and thus prevents the split up. Passing reap_mtx / reap to the module constructors rectifies this, but necessarily touches lots of constructors. I recommend looking at a word-diff of these commits.

@qbe
Copy link
Contributor Author

qbe commented Dec 29, 2025

As to why this rebase was necessary, turns out using the wrong clang-format version caused a lot of noise, while at the same time some changes regarding cava were merged.

qbe added 2 commits February 5, 2026 00:00
lots of conflicts, almost all of them from the reap_mtx/reap params
@qbe
Copy link
Contributor Author

qbe commented Feb 5, 2026

@Alexays I am trying to resolve the merge conflicts (again), but I am struggling with the problem of having to pass reap_mtx / reap pairs to the handleGtkMenuEvent function (src/ALabel.cpp:193) which it now needs because it calls forkExec and that function needs the reap list.

Before I take a deep dive into this, can you please take a look at my PR so far ?

I have by now sunken quite a lot of time into this series, which would be worth it if you see the value in this PR in general, but if you are generally against splitting of modules and dynamically loading them then I can go do
something else with my free time.

compiles, but allocates a 3-pointer struct which might not be
deleted cleanly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant