-
-
Notifications
You must be signed in to change notification settings - Fork 90
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
⬆️ zb: Swtich to new smol-rs crates #494
Conversation
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.
Looks good otherwise. You may want to refer to #479 in the description btw.
There aren't any other outdated smol crates, right? |
Maybe not at the moment but all crates are being updated. async-broadcast for example has been update already for event-listener 3 but not yet released. I should roll out a release soon.. |
|
Didn't know you were involved in smol-rs :) |
Not as much as I should be or want to be. :) async-broadcast 0.6.0 now out btw. |
I don't understand how CI successfully completed on everything except |
Gives you a clue at least that it's some timing issue? Also, better this than the other way around. Locally reproducible issues are much easier to debug/solve. |
Something's wrong with the tests, even on master... I remember they used to pass, but now
(the output is from |
Ah yes, this one I've seen happening on my machine too. It disappears after a while though. I'd suggest skipping it as it shouldn't be affected by this PR. |
@MaxVerevkin seems like an event-listener regression on Windows:
|
@MaxVerevkin @notgull pointed out that the |
Even if |
Yes because even though https://matrix.to/#/#zbus:matrix.org |
Thanks for fixing! One last reservation though: If we only bump our direct event-listener dep, we'll now end up with 2 event-listener versions in our deps, the other through other smol-rs deps. Perhaps it'd make sense to resolve #479 completely in one PR? |
Can't it do so the first time it is polled? |
Perhaps, please comment on smol-rs/event-listener#89 |
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.
Nice! Great to see you going the extra mile. 👍 Apart from the nit:
- Just like in case of event-hander, async-broadcast now provides new API to avoid allocation when sending. We should either try to switch to that already here or leave a
FIXME
comment in the code and commit message about that. - We still have a bunch more crates I think: async-io (it was just released I believe) and async-process I think.
f58cac3
to
ba1a0c2
Compare
I found only one place where this can be done. Done. By the way, the changelog didn't mention this at all, so... |
I did not update async-io because it involves unsafe code, which I would like to avoid in this PR. |
I don't think that's a good reason to split the whole PR (it's the exactly same topic/general change) but if you prefer it that way, sure. In that case, please do edit the description again to not get #479 closed with this merged. |
Hm.. would this mean we'll be depending on multiple versions of event-listener? If so, I'd have to go back on my word and ask you to already port to async-io in this PR. Otherwise, we can merge already. |
@@ -108,7 +108,7 @@ nix = { version = "0.27", default-features = false, features = [ | |||
[target.'cfg(target_os = "macos")'.dependencies] | |||
# FIXME: This should only be enabled if async-io feature is enabled but currently | |||
# Cargo doesn't provide a way to do that for only specific target OS: https://github.com/rust-lang/cargo/issues/1197. | |||
async-process = "1.7.0" | |||
async-process = "2.0.0" |
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.
Did not and can not test this change.
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.
Me neither. :) I think some tests cover this so CI will tell us.
@MaxVerevkin Hey, event-listener 4 was released that removes the footgun you encountered and its dependent smol-rs crates have been updated too. Do you think you'll be able to finish this PR soon with those updates? |
Thanks for notifying, will look into it!
I hope :) I'll have some time later today. |
@zeenix what do you think |
If our examples work with |
Just a heads up, |
Return what exactly? Returning unpinned EventListener is pointless but returning pinned listener defeats the improvements of |
How so? You can .await it, can't you? If it was a useless type on its own, the new API of
Yeah, hence the preference to return |
Thanks, I got ahead of myself. :) |
pub fn monitor_activity(&self) -> EventListener {
EventListener::new()
} |
Do you want me to update event-listener in a new commit or override the previous one? |
Ah right, I forgot the exact semantics of the weird new API. :( Yes, I think we have to go with
No point in keeping the current one if we're going to change it in the same PR. :) So the latter. |
Is it ok to leave both? I don't want to mess up the entire git history 😆 |
Ntot sure whats going on in the CI... |
You won't be messing up anything, only minimizing commits but sure, no biggie if you don't want to do it.
Well you have to debug obviously. There is some error from the low-level with async-io: https://github.com/dbus2/zbus/actions/runs/6988036119/job/19015207530?pr=494#step:6:705 |
I don't know anything about low-level workings of zbus+async-io and honestly don't really want to dig in that direction. I think I'm not the right person to fix this :( |
AFAICT the main errors were from the compiler so I'm sure there were much lowlevel stuff involved.
You came so close so it's sad to see you give up on what seems to be last hurdle w/o trying. Of course, it's your decision in the end. Just that I spent time reviewing too. Hopefully that helps me complete the work though. |
By the way to anyone who wants to continue from where I left off, feel free to reuse my commits, no attribution needed. |
closes #479.