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

smol fails to build on OpenBSD (nix crate related issue) #146

Closed
nickpelone opened this issue May 26, 2020 · 5 comments
Closed

smol fails to build on OpenBSD (nix crate related issue) #146

nickpelone opened this issue May 26, 2020 · 5 comments

Comments

@nickpelone
Copy link

Hey there! Excited to see this project.

It looks like it doesn't build on OpenBSD:

error[E0599]: no associated item named `EV_RECEIPT` found for struct `nix::sys::event::EventFlag` in the current scope
   --> src/reactor.rs:550:69
    |
550 |             let mut read_flags = EventFlag::EV_ONESHOT | EventFlag::EV_RECEIPT;
    |                                                                     ^^^^^^^^^^ associated item not found in `nix::sys::event::EventFlag`

error[E0599]: no associated item named `EV_RECEIPT` found for struct `nix::sys::event::EventFlag` in the current scope
   --> src/reactor.rs:551:70
    |
551 |             let mut write_flags = EventFlag::EV_ONESHOT | EventFlag::EV_RECEIPT;
    |                                                                      ^^^^^^^^^^ associated item not found in `nix::sys::event::EventFlag`

error[E0599]: no associated item named `EV_RECEIPT` found for struct `nix::sys::event::EventFlag` in the current scope
   --> src/reactor.rs:597:36
    |
597 |             let flags = EventFlag::EV_RECEIPT | EventFlag::EV_DELETE;
    |                                    ^^^^^^^^^^ associated item not found in `nix::sys::event::EventFlag`

error[E0599]: no variant or associated item named `EVFILT_USER` found for enum `nix::sys::event::EventFilter` in the current scope
   --> src/reactor.rs:630:53
    |
630 |             let event = KEvent::new(0, EventFilter::EVFILT_USER, flags, FFLAGS, 0, 0);
    |                                                     ^^^^^^^^^^^
    |                                                     |
    |                                                     variant or associated item not found in `nix::sys::event::EventFilter`
    |                                                     help: there is a variant with a similar name: `EVFILT_TIMER`

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0599`.
error: could not compile `smol`.

From the messages, it's missing some EventFlag and EventFilter items - EV_RECEIPT for example has been excluded from nix for a while, even though it has since landed in OpenBSD. However, we don't have EVFILT_USER at all - so I dunno what to do or say there.

I guess the first one, the EV_RECEIPT thing - that's more to raise with nix maintainers, which I'll try to do next - but any thoughts on how to work around there being no EVFILT_USER?

@nickpelone
Copy link
Author

I opened nix-rust/nix#1252 over at the nix crate, and then building with those changes, it's just down to the EVFILT_USER issue:

error[E0599]: no variant or associated item named `EVFILT_USER` found for enum `nix::sys::event::EventFilter` in the current scope
   --> src/reactor.rs:630:53
    |
630 |             let event = KEvent::new(0, EventFilter::EVFILT_USER, flags, FFLAGS, 0, 0);
    |                                                     ^^^^^^^^^^^
    |                                                     |
    |                                                     variant or associated item not found in `nix::sys::event::EventFilter`
    |                                                     help: there is a variant with a similar name: `EVFILT_TIMER`

error: aborting due to previous error

I could look into what you're supposed to do on OpenBSD and offer a fix after my PR (hopefully) lands over at nix.

@nickpelone
Copy link
Author

Doing some further digging, other things have had to do alternate, pipe-based implementations on platforms without EVFILT_USER:

Thomasdezeeuw/gaea#69
Thomasdezeeuw/gaea@b359eb2

I intend to try my hand at this and get a working Reactor on OpenBSD.

@dignifiedquire
Copy link
Contributor

nix was replaced with custom syscalls on master, should male this easier to work with

@nickpelone
Copy link
Author

It certainly builds and can do some basic async hello world stuff now! Thanks.

I'm going to do some more thorough testing and then if everything looks good I'll close this issue.

Peeked the PR, thanks for the work you did on this.

@nickpelone
Copy link
Author

Sorry, I forgot to come back to this. With the new release that just uses libc, I am able to build smol / async-std / etc. If any runtime issues pop up, I'll file new issues.

Thanks!

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

No branches or pull requests

2 participants