socketry / nio4r

Cross-platform asynchronous I/O primitives for scalable network clients and servers.
Other
965 stars 86 forks source link

Compilation error on Alpine #225

Closed mhenrixon closed 4 years ago

mhenrixon commented 5 years ago
/app # cat /usr/local/bundle/extensions/x86_64-linux/2.5.0-static/nio4r-2.5.1/gem_make.out
current directory: /usr/local/bundle/gems/nio4r-2.5.1/ext/nio4r
/usr/local/bin/ruby -r ./siteconf20190830-10819-sr2s6k.rb extconf.rb
checking for unistd.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: /usr/local/bundle/gems/nio4r-2.5.1/ext/nio4r
make "DESTDIR=" clean

current directory: /usr/local/bundle/gems/nio4r-2.5.1/ext/nio4r
make "DESTDIR="
compiling bytebuffer.c
compiling monitor.c
compiling nio4r_ext.c
In file included from nio4r_ext.c:7:0:
../libev/ev.c:519:48: warning: "/*" within comment [-Wcomment]
 /*#define MIN_INTERVAL  0.00000095367431640625 /* 1/2**20, good till 2200 */

In file included from nio4r_ext.c:7:0:
../libev/ev.c: In function 'ecb_binary32_to_binary16':
../libev/ev.c:1310:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
       if (e < (14 - 24)) /* might not be sharp, but is good enough */
             ^
../libev/ev.c: At top level:
../libev/ev.c:1620:73: fatal error: linux/aio_abi.h: No such file or directory
 # include <linux/aio_abi.h> /* probably only needed for aio_context_t */
                                                                         ^
compilation terminated.
make: *** [Makefile:242: nio4r_ext.o] Error 1

make failed, exit code 2
mhenrixon commented 5 years ago

Fixed with apk add linux-headers

esambo commented 4 years ago

This was introduced by version 2.5.0 (linux/aio_abi.h is include'd by ext/libev/ev.c and ext/libev/ev_linuxaio.c)

ioquatix commented 4 years ago

Do you propose a better solution?

esambo commented 4 years ago

mentioning it in the changelog would improve the visibility of it, and inform people ahead of time, rather than having to google the error

ioquatix commented 4 years ago

I just wondered if we can detect if that header exists and avoid compiling that code if not, to avoid any problem at all.

ioquatix commented 4 years ago

I'll use extconf.rb to detect if the headers are available and conditionally compile ev_linuxaio.c.

ioquatix commented 4 years ago

Okay this has been released in v2.5.2. It was live streamed https://youtu.be/YqYYrpvGWo4

In the future please create new issues for bugs like this.

esambo commented 4 years ago

It would be nice to maintain the CHANGES.md file