Comments (17)
then the feature seems to be enabled some other way. Do you pull in notify-rust directly or via a different dependency? I think this thing might fix the issue: #180
I just use cargo! I don't pull it or so. Btw I just was looking on the internet and it seems like
no-default-features = true
is incorrect, butdefault-features = false
is the correct maybe... So I will just try that and see what happens
That fixed it (even without features = ["d"]
)
from notify-rust.
Could be that the target configuration gets confused because you’re building on WSL.
from notify-rust.
Occurs on a real install as well
OS: Ubuntu 20.04.5 LTS x86_64
from notify-rust.
also when you leave out --all-features
?
from notify-rust.
also when you leave out
--all-features
?
Let me modify the library to build the feature that needs notify-rust
by default and ill get back to you.
from notify-rust.
Update - nada
root@AA07-S-UBUNTU:~/code/para-rust-g/paradise-rust-g# cargo build --release --target=i686-unknown-linux-gnu
Compiling hyper-rustls v0.23.0
Compiling git2 v0.14.4
Compiling notify-rust v4.6.0
error[E0432]: unresolved import `zbus::MatchRule`
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/notify-rust-4.6.0/src/xdg/zbus_rs.rs:2:34
|
2 | use zbus::{blocking::Connection, MatchRule};
| ^^^^^^^^^ no `MatchRule` in the root
Compiling reqwest v0.11.11
error[E0599]: no method named `add_match_rule` found for struct `zbus::blocking::fdo::DBusProxy<'_>` in the current scope
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/notify-rust-4.6.0/src/xdg/zbus_rs.rs:152:11
|
152 | proxy.add_match_rule(action_signal_rule).unwrap();
| ^^^^^^^^^^^^^^ help: there is a method with a similar name: `add_match`
error[E0599]: no method named `add_match_rule` found for struct `zbus::blocking::fdo::DBusProxy<'_>` in the current scope
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/notify-rust-4.6.0/src/xdg/zbus_rs.rs:161:11
|
161 | proxy.add_match_rule(close_signal_rule).unwrap();
| ^^^^^^^^^^^^^^ help: there is a method with a similar name: `add_match`
Some errors have detailed explanations: E0432, E0599.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `notify-rust` due to 3 previous errors
from notify-rust.
I don't really have a clue how to explain this at this point. I can however assume that building it on WSL won't do what you expect, because the linux binary will not talk to the windows api. it will try to send a notification to dbus, which you probably don't run on windows unless you have a linux desktop environment as well.
as for why some parts of the zbus library aren't there: 🤷
from notify-rust.
I don't really have a clue how to explain this at this point. I can however assume that building it on WSL won't do what you expect, because the linux binary will not talk to the windows api. it will try to send a notification to dbus, which you probably don't run on windows unless you have a linux desktop environment as well. as for why some parts of the zbus library aren't there: 🤷
All builds after the first were performed on a real baremetal ubuntu server install that I use purely as a compile host. I should probably give some background to what I am achieving here to simplify things.
I maintain an open source game project (SS13), and while development happens entirely on windows (client only runs on windows), you can run the dedicated server on windows and linux. This library is used in an external rust DLL (or .so on linux) that is called from the main game, and my intention is for notification support while running on windows, but I dont need any support in the slightest on linux, other than "it compiles", hence me trying to compile it on a headless OS.
Do you know of a libzbus-dev
or similarly named package that has the developer stuff to compile with without the full support?
from notify-rust.
Thanks for the clarification.
You could try to disable the default "z"
feature and turn on the "d"
feature, which switches the underlying dbus library from the cool pure-rust zbus, to the good'ole libdbus-somethingsomething. That should simplify your builds, but you need libdbus in your pkg-conf somewhere. If you don't need the feature at all on linux you might wanna try out something like #[cfg(target_os = "windows")]
or similar, to not pull in the lib (notify-rust) at all unless you're on windows.
from notify-rust.
Thanks for the clarification. You could try to disable the default
"z"
feature and turn on the"d"
feature, which switches the underlying dbus library from the cool pure-rust zbus, to the good'ole libdbus-somethingsomething. That should simplify your builds, but you need libdbus in your pkg-conf somewhere. If you don't need the feature at all on linux you might wanna try out something like#[cfg(target_os = "windows")]
or similar, to not pull in the lib (notify-rust) at all unless you're on windows.
root@AA07-S-UBUNTU:~/code/para-rust-g/paradise-rust-g# cargo build --release --target=i686-unknown-linux-gnu
Compiling notify-rust v4.6.0
error[E0432]: unresolved import `zbus::MatchRule`
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/notify-rust-4.6.0/src/xdg/zbus_rs.rs:2:34
|
2 | use zbus::{blocking::Connection, MatchRule};
| ^^^^^^^^^ no `MatchRule` in the root
|
help: consider importing this struct instead
|
2 | use zbus::{blocking::Connection, dbus::message::MatchRule;
| ~~~~~~~~~~~~~~~~~~~~~~~~~
error[E0599]: no method named `into_i32` found for enum `timeout::Timeout` in the current scope
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/notify-rust-4.6.0/src/xdg/zbus_rs.rs:81:38
|
81 | notification.timeout.into_i32(),
| ^^^^^^^^ method not found in `timeout::Timeout`
|
::: /root/.cargo/registry/src/github.com-1ecc6299db9ec823/notify-rust-4.6.0/src/timeout.rs:3:1
|
3 | pub enum Timeout {
| ---------------- method `into_i32` not found for this enum
error[E0599]: no method named `add_match_rule` found for struct `zbus::blocking::fdo::DBusProxy<'_>` in the current scope
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/notify-rust-4.6.0/src/xdg/zbus_rs.rs:152:11
|
152 | proxy.add_match_rule(action_signal_rule).unwrap();
| ^^^^^^^^^^^^^^ help: there is a method with a similar name: `add_match`
error[E0599]: no method named `add_match_rule` found for struct `zbus::blocking::fdo::DBusProxy<'_>` in the current scope
--> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/notify-rust-4.6.0/src/xdg/zbus_rs.rs:161:11
|
161 | proxy.add_match_rule(close_signal_rule).unwrap();
| ^^^^^^^^^^^^^^ help: there is a method with a similar name: `add_match`
When using
notify-rust = { version = "4.6.0", optional = true, features = ["d"] }
Do tell me if I scuffed something up with this
As for making this crate only load in if windows is targeted, that is an option and something I could do, will let you know how that goes.
from notify-rust.
z
is a default features, you have to build it with no-default-features = true
https://github.com/hoodie/notify-rust#d
from notify-rust.
z
is a default features, you have to build it withno-default-features = true
This worked, thank you
from notify-rust.
Hey guys,
I can also not build on ubuntu (using github actions) because of an error error[E0599]: no method named `into_i32` found for enum `timeout::Timeout` in the current scope
I already created an issue over at notify-rs/notify#469 (see the full logs over there). But this seemed to be the better place to post it.
I have tried the notify-rust = { version = "4", no-default-features = true, features = ["d"] }
but it didn't work.
Maybe I implemented it incorrectly?
Btw I don't even know if I really need that features = ["d"]
section for my case to work.
from notify-rust.
I think this issue occurs when you try to build with both the z
and d
features.
d
explicitly turns off this implementation and z
includes code that needs it. These two features were not intended to be used together, but are also not explicitly mutually exclusive. I think I ought to fix that one day.
As for your concrete issue: I assume that you didn't turn off the z
default-feature correctly somehow, maybe a typo or something?
from notify-rust.
I think this issue occurs when you try to build with both the
z
andd
features.d
explicitly turns off this implementation andz
includes code that needs it. These two features were not intended to be used together, but are also not explicitly mutually exclusive. I think I ought to fix that one day.As for your concrete issue: I assume that you didn't turn off the
z
default-feature correctly somehow, maybe a typo or something?
Possibly yes, but idk... Btw when I just don't have the features = ["d"]
it also accures!
from notify-rust.
then the feature seems to be enabled some other way. Do you pull in notify-rust directly or via a different dependency? I think this thing might fix the issue:
#180
from notify-rust.
then the feature seems to be enabled some other way. Do you pull in notify-rust directly or via a different dependency? I think this thing might fix the issue: #180
I just use cargo! I don't pull it or so. Btw I just was looking on the internet and it seems like no-default-features = true
is incorrect, but default-features = false
is the correct maybe... So I will just try that and see what happens
from notify-rust.
Related Issues (20)
- ZBus Error HOT 5
- [Feature Request] A way to ask for permission for notifications HOT 1
- trying to send a notification with a image loaded from include_bytes!() macro HOT 1
- macOs notification listeners HOT 1
- winrt-notification is not maintained HOT 5
- Recent msrv change should have been in a minor release instead of a patch HOT 4
- Zbus error when running under systemd HOT 2
- Drop dbus crate support HOT 4
- Tag and CHANGELOG for 4.6 HOT 1
- [Question] There is any wait to show the notification on multiple monitors with this lib?
- Big binary size and lots of dependencies
- Typo in the About description HOT 1
- A controllable way to add timeouts HOT 6
- Suggestion to add GIFs/screenshots to the README HOT 2
- Notification Listeners for Mac and Windows HOT 17
- Need some help and guidance in ZBus error on Linux
- Link to Gnome does not work HOT 1
- Restore NotificationHandle HOT 1
- Allow an on_close handler without consuming the NotificationHandle HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from notify-rust.