Giter Club home page Giter Club logo

Comments (17)

Miniontoby avatar Miniontoby commented on August 16, 2024 1

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"])

from notify-rust.

hoodie avatar hoodie commented on August 16, 2024

Could be that the target configuration gets confused because you’re building on WSL.

from notify-rust.

AffectedArc07 avatar AffectedArc07 commented on August 16, 2024

Occurs on a real install as well
image

OS: Ubuntu 20.04.5 LTS x86_64

from notify-rust.

hoodie avatar hoodie commented on August 16, 2024

also when you leave out --all-features?

from notify-rust.

AffectedArc07 avatar AffectedArc07 commented on August 16, 2024

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.

AffectedArc07 avatar AffectedArc07 commented on August 16, 2024

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.

hoodie avatar hoodie commented on August 16, 2024

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.

AffectedArc07 avatar AffectedArc07 commented on August 16, 2024

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.

hoodie avatar hoodie commented on August 16, 2024

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.

AffectedArc07 avatar AffectedArc07 commented on August 16, 2024

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.

hoodie avatar hoodie commented on August 16, 2024

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.

AffectedArc07 avatar AffectedArc07 commented on August 16, 2024

z is a default features, you have to build it with no-default-features = true

https://github.com/hoodie/notify-rust#d

This worked, thank you

from notify-rust.

Miniontoby avatar Miniontoby commented on August 16, 2024

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.

hoodie avatar hoodie commented on August 16, 2024

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.

Miniontoby avatar Miniontoby commented on August 16, 2024

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?

Possibly yes, but idk... Btw when I just don't have the features = ["d"] it also accures!

from notify-rust.

hoodie avatar hoodie commented on August 16, 2024

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.

Miniontoby avatar Miniontoby commented on August 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.