notify-rust: Cant build on Ubuntu

OS: OS: Ubuntu 20.04.4 LTS on Windows 10 x86_64 (Yes I am running under WSL)

I have notify-rust imported into another project as

notify-rust = { version = "4.6.0", optional = true }

However, upon building I get the following error:

aa07@AA07-C:/mnt/c/Users/AffectedArc07/Documents/GitHub/Parastuff/rust-g/paradise-rust-g$ cargo build --release --all-features --target=i686-unknown-linux-gnu
   Compiling rust-g v1.2.0-P2 (/mnt/c/Users/AffectedArc07/Documents/GitHub/Parastuff/rust-g/paradise-rust-g)
   Compiling notify-rust v4.6.0
error[E0432]: unresolved import `zbus::MatchRule`
 --> /home/aa07/.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

error[E0599]: no method named `add_match_rule` found for struct `zbus::blocking::fdo::DBusProxy<'_>` in the current scope
   --> /home/aa07/.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
   --> /home/aa07/.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

Is this crate not compatible with i686-unknown-linux-gnu? Am I missing an extra compile dependency?

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 17 (7 by maintainers)

Most upvoted comments

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

That fixed it (even without features = ["d"])