Replies: 3 comments 4 replies
-
The way that notifications work on freedesktop systems (linux, bsd, etc) is that you send an RPC message to a desktop service provided by Gnome/KDE/etc. This API using DBUS. Doing notifications without zbus would be like "making a REST request" without a HTTP client. This crate has two options for talking to dbus: "zbus" and "dbus (the crate)". At the moment the later is considered deprecated and I've even received several requests to "finally remove it", however, there are certain tradeoffs. While zbus is the cool new thing and more actively developed, it is true that you have to build the entire dbus-stack yourself and hardlink it as part of your binary -> larger binary. As the Alternately we could investigate whether there is some room to slim down the zbus version of notify-rust by disabling some zbus features that we don't use here. |
Beta Was this translation helpful? Give feedback.
-
That makes sense, thanks for taking the time to reply on this! I'm having dependency creep in my projects and was looking at the 'biggest' dependencies I was user in an attempt to minimize this. But it seems unavoidable. |
Beta Was this translation helpful? Give feedback.
-
If it gets removed in the future it would be good to have an alternative (or fork) that keeps it. In tiny, zbus adds an entire async runtime to the binary and adds 90 new dependencies (102 to 192). The final release binary size is 8.2M (4.2 stripped) with zbus and 6.3M (2.8M stripped) with dbus. Statically linked, 8.5M (4.4M stripped) with zbus and 6.8M (3.1M stripped). |
Beta Was this translation helpful? Give feedback.
-
It looks like
notify-rust
enlarges the size of binaries by a lot, at least on Linux. I'm seeing a 8MB increase on simple builds when this crate is used. I'm also surprised by the number of dependencies required.The use of
zbus
seems to be the culprit.I wonder if notification handling can be implemented in a different manner to minimize this, both binary size and the number of dependencies. Can any thing be done to achieve this?
Sorry for the possibly vague issue. I am not too familiar with how this is implemented.
Beta Was this translation helpful? Give feedback.
All reactions