Skip to content
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

Expose raw handles for the Poller #39

Merged
merged 2 commits into from
Aug 18, 2022
Merged

Expose raw handles for the Poller #39

merged 2 commits into from
Aug 18, 2022

Conversation

notgull
Copy link
Member

@notgull notgull commented Aug 17, 2022

Most of the current Poller instances are wrappers around either a RawFd or a RawHandle. For these platforms, an AsRawFd or AsRawHandle implementation is implemented on Poller. Then, because I have absolutely no self control, I also went ahead and conditionally implemented AsFd and AsHandle as well on conditionally proper Rust versions through autocfg. See sunfishcode/io-lifetimes#38 for more information.

This is part of my attempt at getting smol-rs/async-io#39 to work

src/epoll.rs Show resolved Hide resolved
Copy link
Member

@zeenix zeenix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM otherwise.

@notgull notgull merged commit 323473e into smol-rs:master Aug 18, 2022
@taiki-e
Copy link
Collaborator

taiki-e commented Sep 5, 2022

This a Cargo-based project and I really don't see why we should sacrifice the readability of this project for possible users that use cargo-based projects w/o ensuring their build system is actually doing everything cargo-based project expects.

AFAIK, non-cargo build systems such as Bazel, Buck, and GN have helpers (e.g., cargo-raze, cargo-gnaw) to create manifests for that build system based on Cargo.toml and can support cargo-based projects. However, running arbitrary other rust code (autocfg) at build time may or may not be simple. Therefore, it is helpful to have reasonable defaults in case the build script is not run. (AFAIK, this was first proposed in serde-rs/serde#1593.)

I maintain several projects that sometimes receive feedback from fuchsia team (using GN, IIRC), so I usually prefer to use negative cfgs so that it works without friction in their code base. (Also, it seems some smol-rs projects are being used in fuchsia.)

@zeenix
Copy link
Member

zeenix commented Sep 5, 2022

@taiki-e Thanks so much for indulging and educating me. Much appreciated! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants