-
Notifications
You must be signed in to change notification settings - Fork 70
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
Support for the ESP-IDF framework #128
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.
I don't like the way that the alternating pipe
/eventfd
code is scattered throughout the module. It would be better if there was a single Notifier
type that contained either the pipe on non-ESP and the eventfd on ESP. I did a similar thing in kqueue.rs
to switch between pipes and user events.
Looks good otherwise.
OK. Will schedule some time over the weekend to do that. |
I merged #123 because I don't want to build up changes that are going to get stale. Just a heads up. This also takes care of the rustix v0.38 port. |
Ah, thanks, did not see that it was already pending! |
73f43c9
to
4d26dba
Compare
@notgull Two additional follow up questions:
I'm in favor of a minimal variant where |
|
OK it should be ready for another review.
|
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.
Overall this looks good to me. Can you add a test to CI to make sure this code builds when targeting ESP-IDF? Even a simple cargo check
would be enough.
Ignore the Wine and Cross failures in CI, they aren't your fault.
So if you are OK with "Caveat 1", yes, I'll work on that. |
0667185
to
7f5603f
Compare
OK, CI is ready. For now (and until |
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.
Thanks!
NetBSD failure looks spurious to me, not sure why that's happening.
(This has been long supported in a fork of the
polling
crate, but the fork was against an ancient version. So I finally jumped the gun to rebase it against the latestpolling
and try to upstream now.)ESP IDF already does support the
poll
syscall, so this PR is only necessary because - ESP IDF being an embedded OS (or toolkit?) - does not support anything process-related, including thepipe
syscall.However it does support a subset of the
eventfd
syscall API, so what this PR does is to augment thepoll
module - specifically for ESP IDF - with an alternativeeventfd
codepath to wherepipe
is usually utilized. The same idea (useeventfd
for the ESP IDF) was I believe re-used by @jasta in the recently upstreamed support for ESP IDF in tokio's reactor.In terms of changes, two main items:
poll
module is augmented with alternative code-path based oneventfd
rustix
dependency from0.37.X
to0.38.X
as the support for ESP IDF inrustix
(including theeventfd
syscall) lands in the0.38.X
version. I hope you don't mind and I noticed other crates in thesmol
ecosystem already userustix
0.38.X
so I guess it was just a matter of time and somebody taking the effort to update it for this crate as wellrustix
version are really mainly addressing latestrustix
shuffling code around (the newevent
module). Two changes worth noting are this one and this one where I believe in the latter, the cast totime_t
was incorrect in the first place.