voelin-platform: zbus on async-io alone in every binary (notify-rust z), and a test for the order of ashpd's callers

ashpd 0.13.13 keeps one session connection per process (a static in its
proxy.rs), and zbus 5.19 picks that connection's executor once, from
Handle::try_current() on the thread that builds it, when both its `tokio` and
`async-io` features are compiled in. The first ashpd caller therefore decided
the executor of every later portal call: a tokio caller first, then a caller
with no runtime (a GPUI foreground task), panics with "there is no reactor
running" (get_property("version") sets up zbus's property cache, which calls
tokio::task::spawn). The merged binary was safe only because GPUI's
colour-scheme call builds the connection before the engine's portal calls.

voelin-platform's notify-rust asks for `z` (async-io) in place of
`z-with-tokio`, and the stand-in portal's zbus dev-dependency for `async-io`
instead of `tokio`: a test binary with both features shows the panic even when
the binaries do not have it. `cargo tree -e features -i zbus` now names
`tokio` nowhere; Cargo.lock loses zbus's tokio edge and tokio's tracing edge
(THIRD_PARTY_NOTICES.md is unchanged).

tests/proxy.rs gets the gate's probe shape on a private dbus-run-session bus
(skipped with a printed reason where none can be made): a tokio caller first,
then a caller with no runtime. It fails with the panic on the tree before this
change, and still did with only notify-rust moved, which is why the
dev-dependency moved too.

The four records that described the move wrongly are corrected:
docs/design/gpui-spikes.md "Dependencies", the comment of
PortalCapture::start, voelin-media's Cargo.toml and CHANGELOG.md (whose
Slint-only sentence goes: the Slint app's zbus connections move to async-io
threads too).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
faumarayandClaude Sonnet 5.5 committed 2026-10-27 12:24:19 +03:00
1 parent 3f4dc700af
commit ed49c283a2
7 files changed
+102 -45

No files matched your search

+22 -8
View File
@@ -468,14 +468,28 @@ the raw source's `for n in 0u64..` in `spikes/gpui/video/src/main.rs`, now
and `voelin-gpui` holds both (it depends on `voelin-core` with
`media-desktop`, which brings PipeWire, and on `voelin-platform` with its
portal feature). What zbus 5.19 does with the features (read in its
source): with `async-io` and `tokio` both compiled in it picks per
connection, tokio when a tokio runtime is current on the calling thread and
`async-io` with an I/O thread of its own otherwise. The workspace has both
on already (notify-rust asks for `tokio`, others for the defaults), so the
engine's portal calls inside its runtime still run on tokio and a caller
with no runtime (a GPUI foreground task) gets the thread; a test in
voelin-platform (`tests/proxy.rs`) calls ashpd from a thread with no tokio
runtime and gets the answer.
source): with `async-io` and `tokio` both compiled in it picks an executor
once per connection, tokio when a tokio runtime is current on the thread that
builds it and `async-io` with an I/O thread of its own otherwise. ashpd keeps
one session connection for the whole process (a static in its `proxy.rs`), so
the first ashpd caller decides the executor of every later portal call: when
a tokio caller builds it first, a later `Proxy::new` from a thread with no
runtime (a GPUI foreground task) panics with "there is no reactor running"
(`get_property("version")` sets up zbus's property cache, which calls
`tokio::task::spawn`). The move of e325b65 left both compiled in
(voelin-platform's notify-rust asked zbus for `tokio`, `z-with-tokio`), and
the merged binary was safe only because GPUI's colour-scheme call builds the
connection before the engine's portal calls do. *Fixed* (the Opus gate's
option a): notify-rust asks for `z` (`async-io`), so zbus is compiled with
`async-io` alone in every binary, the Slint app's included, and every
connection has an I/O thread of its own whoever builds it first
(`cargo tree -e features -i zbus` names `tokio` nowhere; voelin-platform's
own test dependency on zbus is `async-io` as well, since a test binary with
both features shows the panic again). Two tests in voelin-platform
(`tests/proxy.rs`, each on a private D-Bus bus) call ashpd from a thread
with no tokio runtime and get the answer, the second after a tokio caller
built the connection; that one fails with the panic above on the tree
before the change.
- **Size and compile time.** In the root workspace, which already carries
Slint's and the codecs' dependencies, gpui-kit adds 279 entries to
`Cargo.lock` (208 new names; about 195 packages on Linux), and cargo deny