Skip to content

Talk to Orca and logind through GIO instead of glibmm - #137

Closed
trypsynth wants to merge 4 commits into
ethindp:masterfrom
trypsynth:feat/orca-and-power-on-gio
Closed

trypsynth wants to merge 4 commits into
ethindp:masterfrom
trypsynth:feat/orca-and-power-on-gio

Conversation

@trypsynth

@trypsynth trypsynth commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

The Orca backend and the Linux power notifier are prism's only users of glibmm, giomm and libsigc++. Full desktops such as Ubuntu's ship them, but minimal installs, containers and CI runners often don't. Where prism is built with them, libprism.so links them directly, so a machine without them can't load prism at all. GIO is already on every system that has glibmm, since glibmm is built on it, so going through GIO's C API drops three libraries from the link without losing anything.

The Orca bridge in winelibs/orca already speaks Orca's D-Bus protocol, both dialects, in plain GIO C for the Wine build.

What this does

  • On Linux the Orca backend compiles winelibs/orca/bridge.c in and uses the same bridge-based OrcaBackend as Windows, so both platforms share one implementation. The Wine check stays Windows-only. PRISM_ORCA_BRIDGE_NATIVE drops the bridge's ms_abi attribute, which only matters under Wine.
  • The power notifier subscribes to logind's PrepareForSleep through GIO's C API, on its own main context as before.
  • Both now need gio-2.0 instead of glibmm-2.68 and giomm-2.68. Gio::init() goes from prism_init, flake.nix drops glibmm and libsigc++, the wheel build stops building them, and the README's Linux note is updated.
  • On Windows, initialize now returns PRISM_ERROR_BACKEND_NOT_AVAILABLE if ntdll.dll can't be found, where it used to return an internal error.

Testing

On Ubuntu 24.04 (GitHub's runner) with libglib2.0-dev and no glibmm:

  • Configure reports orca=on.
  • ldd libprism.so shows libgio-2.0, libgobject-2.0, libglib-2.0 and libstdc++, and nothing from glibmm, giomm or sigc++.
  • Orca registers, and with no Orca running, initialize returns Backend not available.
  • prism_availability_auto_power_supported returns true, and a context with an availability callback and automatic power management starts and shuts down cleanly.

Windows x64, x86 and ARM64 and macOS still build and pass the same .NET suite. Not tested against a running Orca, since CI has no desktop session with Orca in it.

@ethindp

ethindp commented Sep 22, 2026

Copy link
Copy Markdown
Owner

The Orca backend and the Linux power notifier are prism's only users of glibmm and giomm, which many Linux systems don't install.

Really? I thought this was pulled in with pretty much any desktop environment except for maybe the pure console ones?

@trypsynth

Copy link
Copy Markdown
Contributor Author

You're right for the big desktops. I checked the Ubuntu desktop ISO manifests for 24.04, 25.10 and 26.04, and all three ship libglibmm-2.68 along with Orca and speech-dispatcher. Where it's missing is outside a full desktop: minimal installs, containers, CI runners and other non-desktop setups. The GitHub ubuntu-latest runner doesn't have giomm, for example, so prism built there quietly drops Orca and the power notifier.

So I'd frame this as fewer dependencies more than as a fix. GIO is already on every system that has glibmm, since glibmm is built on it. Going through GIO's C API drops glibmm, giomm and libsigc++ from the link without losing anything. If you'd rather keep glibmm, I'm fine closing this. I've updated the description so it doesn't claim more than that.

@ethindp

ethindp commented Sep 23, 2026

Copy link
Copy Markdown
Owner

So, Orca moving into the winebridge is a problem here. This will disrupt my future plans to add potentially extensive logging into the backend. I'm not super clear how exactly this would also allow us to, in future, grant the backend private internal access to functionality it may need in future via this mechanism.

@trypsynth
trypsynth force-pushed the feat/orca-and-power-on-gio branch from 5a1f09e to ec09090 Compare September 26, 2026 22:32
@ethindp

ethindp commented Sep 26, 2026

Copy link
Copy Markdown
Owner

@trypsynth How exactly would we annotate the native backend with logging stuff (or anything else taht requires Prism's internals) should this PR be merged as-is? Right now bridges cannot directly use Prism's internals (which is intentional -- it would risk a load loop).

@trypsynth

Copy link
Copy Markdown
Contributor Author

@ethindp fair enough, I need to think about this a good bit more I think.

@trypsynth trypsynth closed this Sep 27, 2026
@ethindp

ethindp commented Sep 27, 2026

Copy link
Copy Markdown
Owner

@trypsynth Sounds good, thank you for your contributions so far! I think it's about time we cut another release, to be honest.

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.

2 participants