Skip to content

v0.7.14 fails to compile with libc v0.2.110 on FreeBSD 12 #1539

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
messense opened this issue Dec 10, 2021 · 5 comments
Closed

v0.7.14 fails to compile with libc v0.2.110 on FreeBSD 12 #1539

messense opened this issue Dec 10, 2021 · 5 comments

Comments

@messense
Copy link

error[E0063]: missing field `ext` in initializer of `kevent`
   --> /.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/mio-0.7.14/src/sys/unix/selector/kqueue.rs:56:9
    |
56  |         libc::kevent {
    |         ^^^^^^^^^^^^ missing `ext`
...
138 |             let kevent = kevent!(fd, libc::EVFILT_WRITE, flags, token.0);
    |                          ----------------------------------------------- in this macro invocation
    |
    = note: this error originates in the macro `kevent` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0063]: missing field `ext` in initializer of `kevent`
   --> /.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/mio-0.7.14/src/sys/unix/selector/kqueue.rs:56:9
    |
56  |         libc::kevent {
    |         ^^^^^^^^^^^^ missing `ext`
...
144 |             let kevent = kevent!(fd, libc::EVFILT_READ, flags, token.0);
    |                          ---------------------------------------------- in this macro invocation
    |
    = note: this error originates in the macro `kevent` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0063]: missing field `ext` in initializer of `kevent`
   --> /.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/mio-0.7.14/src/sys/unix/selector/kqueue.rs:56:9
    |
56  |         libc::kevent {
    |         ^^^^^^^^^^^^ missing `ext`
...
183 |             kevent!(fd, libc::EVFILT_WRITE, write_flags, token.0),
    |             ----------------------------------------------------- in this macro invocation
    |
    = note: this error originates in the macro `kevent` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0063]: missing field `ext` in initializer of `kevent`
   --> /.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/mio-0.7.14/src/sys/unix/selector/kqueue.rs:56:9
    |
56  |         libc::kevent {
    |         ^^^^^^^^^^^^ missing `ext`
...
184 |             kevent!(fd, libc::EVFILT_READ, read_flags, token.0),
    |             --------------------------------------------------- in this macro invocation
    |
    = note: this error originates in the macro `kevent` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0063]: missing field `ext` in initializer of `kevent`
   --> /.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/mio-0.7.14/src/sys/unix/selector/kqueue.rs:56:9
    |
56  |         libc::kevent {
    |         ^^^^^^^^^^^^ missing `ext`
...
205 |             kevent!(fd, libc::EVFILT_WRITE, flags, 0),
    |             ----------------------------------------- in this macro invocation
    |
    = note: this error originates in the macro `kevent` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0063]: missing field `ext` in initializer of `kevent`
   --> /.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/mio-0.7.14/src/sys/unix/selector/kqueue.rs:56:9
    |
56  |         libc::kevent {
    |         ^^^^^^^^^^^^ missing `ext`
...
206 |             kevent!(fd, libc::EVFILT_READ, flags, 0),
    |             ---------------------------------------- in this macro invocation
    |
    = note: this error originates in the macro `kevent` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0063]: missing field `ext` in initializer of `kevent`
   --> /.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/mio-0.7.14/src/sys/unix/selector/kqueue.rs:56:9
    |
56  |           libc::kevent {
    |           ^^^^^^^^^^^^ missing `ext`
...
226 |           let mut kevent = kevent!(
    |  __________________________-
227 | |             0,
228 | |             libc::EVFILT_USER,
229 | |             libc::EV_ADD | libc::EV_CLEAR | libc::EV_RECEIPT,
230 | |             token.0
231 | |         );
    | |_________- in this macro invocation
    |
    = note: this error originates in the macro `kevent` (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0063]: missing field `ext` in initializer of `kevent`
   --> /.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/mio-0.7.14/src/sys/unix/selector/kqueue.rs:56:9
    |
56  |           libc::kevent {
    |           ^^^^^^^^^^^^ missing `ext`
...
245 |           let mut kevent = kevent!(
    |  __________________________-
246 | |             0,
247 | |             libc::EVFILT_USER,
248 | |             libc::EV_ADD | libc::EV_RECEIPT,
249 | |             token.0
250 | |         );
    | |_________- in this macro invocation
    |
    = note: this error originates in the macro `kevent` (in Nightly builds, run with -Z macro-backtrace for more info)
For more information about this error, try `rustc --explain E0063`.
error: could not compile `mio` due to 8 previous errors
warning: build failed, waiting for other jobs to finish...
error: build failed
  1. kevent definition in libc crate for FreeBSD 12: https://github.com/rust-lang/libc/blob/6b9d5099d103df9b076778d97c3607b2ed2729a9/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs#L20-L28
  2. CI failure: https://cirrus-ci.com/task/5565875227983872?logs=build#L78
@messense
Copy link
Author

Possibly caused by rust-lang/libc#2581

@Thomasdezeeuw
Copy link
Collaborator

Related code is here

libc::kevent {
ident: $id as libc::uintptr_t,
filter: $filter as Filter,
flags: $flags,
fflags: 0,
data: 0,
udata: $data as UData,
}
. Should we add .. Default::default() or maybe .. mem::zeroed()?

@Darksonn
Copy link
Contributor

It seems like it doesn't implement Default, so you'd need to use mem::zeroed.

@asomers
Copy link
Collaborator

asomers commented Dec 10, 2021

It's a libc bug. I'm going to work with libc to get it fixed.

@Thomasdezeeuw
Copy link
Collaborator

As a workaround people can add libc = { version "=0.2.109" }, locking it to v0.2.109 (v0.2.110 introduced the problem as far as I can tell).

@asomers fix is here rust-lang/libc#2585.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants