Replies: 4 comments
-
|
Note, my 5.9.10 Linux kernel is custom built with the anthraxx/linux-hardened patches applied over the top. |
Beta Was this translation helpful? Give feedback.
-
|
I get the same issue with Ubuntu20 in WSL2. |
Beta Was this translation helpful? Give feedback.
-
|
@inossidabile can you show me the exact output you get? Thanks. |
Beta Was this translation helpful? Give feedback.
-
|
I had the same issue on Ubuntu 20.04 using also linuxbrew. It was caused by linuxbrew installing a previous version of kernel headers (4.4.80) whereas my kernel was 5.4.0. I spot the issue by listing the default include path in loading order with: So removing the old kernel headers was enough to compile the native gem. So in the end nothing is wrong in your code @ioquatix :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am indirectly using
nio4rvia the puma gem (I believe) for a Rails project.Versions are:
Versions 2.5.5 of
nio4rand earlier installed just fine, but 2.5.6 (and later do not).The main failure appears to be this:
In file included from ../libev/ev.c:3089:0, from nio4r_ext.c:6: ../libev/ev_iouring.c: At top level: ../libev/ev_iouring.c:113:5: error: unknown type name '__kernel_rwf_t' __kernel_rwf_t rw_flags; ^Seems like
__kernel_rwf_tis problematic in my case.This is the full build log:
% gem install nio4r -v 2.5.6 Building native extensions. This could take a while... ERROR: Error installing nio4r: ERROR: Failed to build gem native extension. current directory: /home/dennis/.gem/ruby/2.6.6/gems/nio4r-2.5.6/ext/nio4r /home/dennis/.rubies/ruby-2.6.6/bin/ruby -I /home/dennis/.rubies/ruby-2.6.6/lib/ruby/2.6.0 -r ./siteconf20210307-7187-mwbbh.rb extconf.rb checking for unistd.h... yes checking for linux/aio_abi.h... yes checking for linux/io_uring.h... yes checking for sys/select.h... yes checking for port_event_t in poll.h... no checking for sys/epoll.h... yes checking for sys/event.h... no checking for port_event_t in port.h... no checking for sys/resource.h... yes creating Makefile current directory: /home/dennis/.gem/ruby/2.6.6/gems/nio4r-2.5.6/ext/nio4r make "DESTDIR=" clean current directory: /home/dennis/.gem/ruby/2.6.6/gems/nio4r-2.5.6/ext/nio4r make "DESTDIR=" compiling bytebuffer.c compiling monitor.c compiling nio4r_ext.c In file included from nio4r_ext.c:6:0: ../libev/ev.c:573:48: warning: "/*" within comment [-Wcomment] /*#define MIN_INTERVAL 0.00000095367431640625 /* 1/2**20, good till 2200 */ ^ In file included from nio4r_ext.c:6:0: ../libev/ev.c: In function 'ecb_binary32_to_binary16': ../libev/ev.c:1510:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (e < (14 - 24)) /* might not be sharp, but is good enough */ ^ In file included from nio4r_ext.c:6:0: ../libev/ev.c: At top level: ../libev/ev.c:2136:31: warning: 'ev_default_loop_ptr' initialized and declared 'extern' EV_API_DECL struct ev_loop *ev_default_loop_ptr = 0; /* needs to be initialised to make it a definition despite extern */ ^ ../libev/ev.c: In function 'array_nextsize': ../libev/ev.c:2249:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (elem * ncur > MALLOC_ROUND - sizeof (void *) * 4) ^ In file included from ../libev/ev.c:3086:0, from nio4r_ext.c:6: ../libev/ev_linuxaio.c: In function 'linuxaio_modify': ../libev/ev_linuxaio.c:237:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] ANIOCBP iocb = linuxaio_iocbps [fd]; ^ ../libev/ev_linuxaio.c: In function 'linuxaio_poll': ../libev/ev_linuxaio.c:467:10: warning: suggest explicit braces to avoid ambiguous 'else' [-Wparentheses] if (ecb_expect_false (res < 0)) ^ In file included from ../libev/ev.c:3089:0, from nio4r_ext.c:6: ../libev/ev_iouring.c: At top level: ../libev/ev_iouring.c:113:5: error: unknown type name '__kernel_rwf_t' __kernel_rwf_t rw_flags; ^ In file included from ../libev/ev.c:220:0, from nio4r_ext.c:6: ../libev/ev_iouring.c: In function 'iouring_enter': ../libev/ev_iouring.c:240:78: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] assert (("libev: io_uring_enter did not consume all sqes", (res < 0 || res == iouring_to_submit))); ^ In file included from ../libev/ev.c:3089:0, from nio4r_ext.c:6: ../libev/ev_iouring.c: In function 'iouring_sqe_get': ../libev/ev_iouring.c:270:7: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] int res = iouring_enter (EV_A_ EV_TS_CONST (0.)); ^ ../libev/ev_iouring.c: In function 'iouring_sqe_submit': ../libev/ev_iouring.c:298:31: warning: "/*" within comment [-Wcomment] /*ECB_MEMORY_FENCE_RELEASE; /* for the time being we assume this is not needed */ ^ ../libev/ev_iouring.c:300:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^ ../libev/ev_iouring.c: In function 'iouring_internal_destroy': ../libev/ev_iouring.c:331:1: warning: no return statement in function returning non-void [-Wreturn-type] } ^ In file included from nio4r_ext.c:6:0: ../libev/ev.c: In function 'ev_io_start': ../libev/ev.c:4417:34: warning: suggest parentheses around arithmetic in operand of '|' [-Wparentheses] fd_change (EV_A_ fd, w->events & EV__IOFDSET | EV_ANFD_REIFY); ^ ../libev/ev.c: At top level: ../libev/ev.c:5682:27: warning: "/*" within comment [-Wcomment] /* EV_STAT 0x00001000 /* stat data changed */ ^ ../libev/ev.c:5683:27: warning: "/*" within comment [-Wcomment] /* EV_EMBED 0x00010000 /* embedded event loop needs sweep */ ^ cc1: warning: unrecognized command line option '-Wno-tautological-compare' cc1: warning: unrecognized command line option '-Wno-self-assign' cc1: warning: unrecognized command line option '-Wno-parentheses-equality' cc1: warning: unrecognized command line option '-Wno-constant-logical-operand' cc1: warning: unrecognized command line option '-Wno-cast-function-type' make: *** [Makefile:245: nio4r_ext.o] Error 1 make failed, exit code 2Any ideas how I can get around this?
For now I have downgraded to 2.5.5.
Best regards.
Beta Was this translation helpful? Give feedback.
All reactions