Skip to content

Can not install 2.5.6 or 2.5.7 on Linux Mint 20.1 with custom 5.9.10 kernel. #270

@bluz71

Description

@bluz71

Hello,

I am indirectly using nio4r via the puma gem (I believe) for a Rails project.

Versions are:

  • Rails 6.1.3
  • Puma 5.2.2
  • Ruby 2.6.6 (ruby-install built)

Versions 2.5.5 of nio4r and 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_t is 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 2

Any ideas how I can get around this?

For now I have downgraded to 2.5.5.

Best regards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions