-
-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove dbus prefix #496
remove dbus prefix #496
Conversation
Oh, is it possible I misread it initially? You want the attributes to be prefixed with |
No, just
Correct. |
Also kindly squash fixups to the relevant commits and force push, as per the contribution guide. |
I will sqash in the AM (MDT) |
I know life can get in the way so no pressure but just wanted to ping you, in case your forgot. :) |
btw, there's also a formatting issue breaking the CI. |
Ddn't forget, jus time getting away from me. |
5ba12ee
to
ea7defd
Compare
I notice you mention in some of the |
Ah, I missed one thing, let me fix that up. |
Not sure which TODOs you are referring to but in this case, you'd notice that serde uses |
ea7defd
to
3aa412a
Compare
Ok, so I know you want me to keep the |
3aa412a
to
5fc1eb9
Compare
Do you want both so it's not a breaking change? So attributes could be either |
Yes. I want these changes to be non-breaking. We should also emit a warning for use of existing names that they're deprecated. See commit 5db2d13 where we did something similar using |
Alright, all done for Is using |
Nice! Thanks.
Actually |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will take a deeper look once the CI succeeds but in the meantime please fix the commit log of the first commit. It would also be good to have Fix #ISSUE
in each commit (as per the commit message guidelines linked in the contributors guide).
Yes, that's right. I fear that may be the only solution for |
ed7e5b0
to
c87c4d3
Compare
Ok, it looks like a clippy warning might be coming from
|
Of course, it's easy to just remove the exports... but it looks purposeful. |
Oh, nobody said anything about
I think I fixed these recently. Can you try rebasing on current main and see if it helps? |
Oh, I see you squashed both commits now. :( This should be at least 2 commits, with their own justification and |
Seems you did that already? The CI passes now. 🥳 Now, if only you hadn't squashed the 2 commits and instead addressed my comments, I could have merged already. Could you please split the commits and redo the logs for each? While at it, you might also want to add emoji prefixes as the contribution guide. :) |
@TTWNO Not only diff --git a/zbus/tests/e2e.rs b/zbus/tests/e2e.rs
index 730d576b..ddb81ff5 100644
--- a/zbus/tests/e2e.rs
+++ b/zbus/tests/e2e.rs
@@ -22,10 +22,9 @@ use zbus::{
use zvariant::{DeserializeDict, Optional, OwnedValue, SerializeDict, Str, Type, Value};
use zbus::{
- connection, interface,
+ connection, dbus_proxy, interface,
message::Header,
object_server::{InterfaceRef, SignalContext},
- proxy,
proxy::CacheProperties,
Connection, ObjectServer,
};
@@ -52,7 +51,7 @@ pub struct RefType<'a> {
field1: Str<'a>,
}
-#[proxy(assume_defaults = true, gen_blocking = true)]
+#[dbus_proxy(assume_defaults = true, gen_blocking = true)]
trait MyIface {
fn ping(&self) -> zbus::Result<u32>;
I get this: The `#[dbus_proxy(...)]` attribute of proxy has been deprecated in favor of `#[zbus(...)]`.
The `#[dbus_proxy(...)]` attribute of proxy has been deprecated in favor of `#[zbus(...)]`.
// Repeats 149 times!
error: use of deprecated macro `dbus_proxy`: Use #[proxy(...)] instead.
--> zbus/tests/e2e.rs:54:3
|
54 | #[dbus_proxy(assume_defaults = true, gen_blocking = true)]
| ^^^^^^^^^^
|
= note: `-D deprecated` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(deprecated)]`
error: implementation of `Deserialize` is not general enough
--> zbus/tests/e2e.rs:54:1
|
54 | #[dbus_proxy(assume_defaults = true, gen_blocking = true)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ implementation of `Deserialize` is not general enough
|
= note: `RefType<'_>` must implement `Deserialize<'0>`, for any lifetime `'0`...
= note: ...but `RefType<'_>` actually implements `Deserialize<'1>`, for some specific lifetime `'1`
error[E0599]: no method named `cached_count` found for struct `MyIfaceProxy` in the current scope
--> zbus/tests/e2e.rs:653:22
|
54 | #[dbus_proxy(assume_defaults = true, gen_blocking = true)]
| ---------------------------------------------------------- method `cached_count` not found for this struct
...
653 | assert_eq!(proxy.cached_count()?, None);
| ^^^^^^^^^^^^ help: there is a method with a similar name: `set_count`
error[E0599]: no method named `receive_count_changed` found for struct `MyIfaceProxy` in the current scope
--> zbus/tests/e2e.rs:772:18
|
54 | #[dbus_proxy(assume_defaults = true, gen_blocking = true)]
| ---------------------------------------------------------- method `receive_count_changed` not found for this struct
...
772 | my_obj_proxy.receive_count_changed().await;
| ^^^^^^^^^^^^^^^^^^^^^ method not found in `MyIfaceProxy<'_>`
error[E0599]: no method named `cached_count` found for struct `MyIfaceProxy` in the current scope
--> zbus/tests/e2e.rs:775:18
|
54 | #[dbus_proxy(assume_defaults = true, gen_blocking = true)]
| ---------------------------------------------------------- method `cached_count` not found for this struct
...
775 | my_obj_proxy.cached_count()?;
| ^^^^^^^^^^^^ help: there is a method with a similar name: `set_count`
error[E0599]: no method named `cached_count` found for struct `MyIfaceProxy` in the current scope
--> zbus/tests/e2e.rs:777:29
|
54 | #[dbus_proxy(assume_defaults = true, gen_blocking = true)]
| ---------------------------------------------------------- method `cached_count` not found for this struct
...
777 | assert_eq!(my_obj_proxy.cached_count()?, Some(0));
| ^^^^^^^^^^^^ help: there is a method with a similar name: `set_count` |
BTW, I moved both issue back on the agenda for 4.0, which I really want to rollout early-mid next week (I took the week off from work for that) as I realized it won't be nice to deprecate the most commonly used API in a stable release and we're close here, despite the issues. I think something that would help is:
@TTWNO Can you handle that before next week? If not, let me know and I'll see if I can do the rest. I'll not touch your branch anymore until you let me know. |
@TTWNO oh and feel free to add commits on top. I'll squash them into the appropriate commit for you. Please just try your best to keep them as small as possible, so it's easy to squash. |
Yes. It may come in at the last minute. But this will be done before Sunday evening (MST). Super happy to see 4.0 coming together :) |
Awesome. I hope you don't hate me for this but thinking more about the new plan, I think it's now just one commit since we're no longer renaming the attribute for existing macros. So don't worry about splitting commits anymore. I wish I had come up with this plan before but I only got the idea after I tried the changes. |
On this right now :) |
Done for interface and proxy macros. That error macro has me stumped. |
Great, thanks. The CI is still failing though. Also, I'm sure you can squash commits into 1 (you did that recently). 😉
You mean what I commented or how to handle it? 🤔 |
How to handle it. |
If you could elaborate a little, I might be able to help. |
I think I know what you mean. Given that we're not renaming |
And this one can and should go in a separate commit. |
Got it. I'll get that dome this morning. The rename for the derive should be to |
👍
Just to be sure, I don't end up causing any misunderstanding:
|
Thanks for being patient. Answering you in class to make sure this gets into 4.0 :) |
This is now a breaking change, due to |
Thanks for your patience too. I'm guessing I should handle the git surgery? :)
👍 |
@TTWNO btw, I would invite you to our matrix channel as there are communications that are best handled on chat, rather than here. |
91e0482
to
ac69466
Compare
Since typically people don't use `DBusError`, it's not a big deal to not provide backwards compatibility here. Co-author: Zeeshan Ali Khan <[email protected]>
This new API facilitates the use of alternative attributes in the same proc macro code. We'll use this in a following commit to handle both `dbus_proxy` and `proxy` macro with different attribute names using the same expansion code.
We'll need to use the newly added API in a following commit.
The prefix as very much redundant. We also rename the item attributes of the macro to `zbus` as its more conventional practice and also compatible with `zvariant` derive macros' attributes. Since this is the typical API most users directly use, we also provide the old macros but deprecate them. Known issues: While users can still use the old macros, they can not use the old item attributes with the new macros and vice versa. Perhaps this could be fixed later. Co-author: Zeeshan Ali Khan <[email protected]> Fixes dbus2#477, dbus2#478.
ac69466
to
2189e16
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that I've modified your changes and split into commits, I approve it. :)
This looks better! Thank you for being patient with me and helping getting it over the finish line. |
This removes the
dbus_
prefix before macros and macro attributes.Fixes #477
Fixes #478