socketry / async-http

MIT License
298 stars 45 forks source link

Can't install async-http #66

Closed aalemanq closed 3 years ago

aalemanq commented 3 years ago

Hello, I don't know what happens today, but is imposible build my custom image from fluentd.

Build fail when have to install async-http

I tried to install manually in local and same error, seems that nobody can install async-http?

sudo gem install async-http
Building native extensions. This could take a while...
ERROR:  Error installing async-http:
    ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/2.7.0/gems/nio4r-2.5.5/ext/nio4r
/usr/bin/ruby2.7 -I /usr/lib/ruby/2.7.0 -r ./siteconf20210208-16212-1cxszlg.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

You might have to install separate package for the ruby development
environment, ruby-dev or ruby-devel for example.

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.7.0/gems/nio4r-2.5.5 for inspection.
Results logged to /var/lib/gems/2.7.0/extensions/x86_64-linux/2.7.0/nio4r-2.5.5/gem_make.out

Same error building image on gitlab/CI-CD

ERROR:  Error installing async-http:
    ERROR: Failed to build gem native extension.

    current directory: /usr/lib/ruby/gems/2.5.0/gems/nio4r-2.5.5/ext/nio4r
/usr/bin/ruby -r ./siteconf20210208-219-1wxohev.rb extconf.rb
checking for unistd.h... yes
checking for linux/aio_abi.h... no
checking for linux/io_uring.h... no
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/lib/ruby/gems/2.5.0/gems/nio4r-2.5.5/ext/nio4r
make "DESTDIR=" clean

current directory: /usr/lib/ruby/gems/2.5.0/gems/nio4r-2.5.5/ext/nio4r
make "DESTDIR="
compiling bytebuffer.c
compiling monitor.c
compiling nio4r_ext.c
In file included from nio4r_ext.c:6:
../libev/ev.c:479:11: fatal error: linux/version.h: No such file or directory
 # include <linux/version.h>
           ^~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:243: nio4r_ext.o] Error 1

make failed, exit code 2

Gem files will remain installed in /usr/lib/ruby/gems/2.5.0/gems/nio4r-2.5.5 for inspection.
Results logged to /usr/lib/ruby/gems/2.5.0/extensions/x86_64-linux/2.5.0/nio4r-2.5.5/gem_make.out
The command '/bin/sh -c apk --no-cache --update add                             build-base                             ca-certificates                             ruby ruby-dev ruby-irb ruby-etc ruby-webrick                 tini                            curl                             jq                             gnupg                             bind-tools                             bash                             geoip                             geoip-dev                             libmaxminddb                             libtool                             automake                             autoconf                             zlib zlib-dev              tzdata &&     echo 'gem: --no-document' >> /etc/gemrc &&     gem install oj -v 3.3.10 &&     gem install json -v 2.2.0 &&     gem install async-http -v 0.46.3 &&     gem install fluentd -v 1.6.0 &&     gem install bigdecimal -v 1.3.5 &&     gem install fluent-plugin-elasticsearch &&     gem install fluent-plugin-geoip &&     gem install fluent-plugin-rewrite-tag-filter &&     gem install fluent-plugin-route &&     apk del build-base ruby-dev &&     rm -rf /tmp/* /var/tmp/* /var/cache/apk/* /usr/lib/ruby/gems/*/cache/*.gem' returned a non-zero code: 1
ERROR: Job failed: exit code 1

Any solution?

aalemanq commented 3 years ago

I see that in local, If I install ruby-dev is working, but in my CI, this package is installed before this gem, and a same error:

Sending build context to Docker daemon  135.7kB

Step 1/25 : FROM alpine:3.9
3.9: Pulling from library/alpine
Digest: sha256:414e0518bb9228d35e4cd5165567fb91d26c6a214e9c95899e1e056fcd349011
Status: Image is up to date for alpine:3.9
 ---> 78a2ce922f86
Step 2/25 : LABEL Description="Fluentd docker image" Vendor="Fluent Organization" Version="1.1"
 ---> Running in 685502772ea0
Removing intermediate container 685502772ea0
 ---> 8ef589926a4b
Step 3/25 : LABEL app=fluentd-collector
 ---> Running in 2519b2387e5f
Removing intermediate container 2519b2387e5f
 ---> 85656431d11b
Step 4/25 : RUN apk --no-cache --update add                             build-base                             ca-certificates                             ruby ruby-dev ruby-irb ruby-etc ruby-webrick                 tini                            curl                             jq                             gnupg                             bind-tools                             bash                             geoip                             geoip-dev                             libmaxminddb                             libtool                             automake                             autoconf                             zlib zlib-dev              tzdata &&     echo 'gem: --no-document' >> /etc/gemrc &&     gem install oj -v 3.3.10 &&     gem install json -v 2.2.0 &&     gem install async-http -v 0.46.3 &&     gem install fluentd -v 1.6.0 &&     gem install bigdecimal -v 1.3.5 &&     gem install fluent-plugin-elasticsearch &&     gem install fluent-plugin-geoip &&     gem install fluent-plugin-rewrite-tag-filter &&     gem install fluent-plugin-route &&     apk del build-base ruby-dev &&     rm -rf /tmp/* /var/tmp/* /var/cache/apk/* /usr/lib/ruby/gems/*/cache/*.gem
 ---> Running in c04595f36d8b
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.9/community/x86_64/APKINDEX.tar.gz
(1/82) Upgrading musl (1.1.20-r5 -> 1.1.20-r6)
(2/82) Installing m4 (1.4.18-r1)
(3/82) Installing libbz2 (1.0.6-r7)
(4/82) Installing perl (5.26.3-r1)
(5/82) Installing autoconf (2.69-r2)
(6/82) Installing automake (1.16.1-r0)
(7/82) Installing ncurses-terminfo-base (6.1_p20190105-r0)
(8/82) Installing ncurses-terminfo (6.1_p20190105-r0)
(9/82) Installing ncurses-libs (6.1_p20190105-r0)
(10/82) Installing readline (7.0.003-r1)
(11/82) Installing bash (4.4.19-r1)
Executing bash-4.4.19-r1.post-install
(12/82) Installing libgcc (8.3.0-r0)
(13/82) Installing krb5-conf (1.0-r1)
(14/82) Installing libcom_err (1.44.5-r2)
(15/82) Installing keyutils-libs (1.6-r0)
(16/82) Installing libverto (0.3.0-r1)
(17/82) Installing krb5-libs (1.15.5-r1)
(18/82) Installing json-c (0.13.1-r1)
(19/82) Installing libxml2 (2.9.9-r3)
(20/82) Installing bind-libs (9.12.4_p2-r0)
(21/82) Installing bind-tools (9.12.4_p2-r0)
(22/82) Installing binutils (2.31.1-r2)
(23/82) Installing libmagic (5.36-r1)
(24/82) Installing file (5.36-r1)
(25/82) Installing gmp (6.1.2-r1)
(26/82) Installing isl (0.18-r0)
(27/82) Installing libgomp (8.3.0-r0)
(28/82) Installing libatomic (8.3.0-r0)
(29/82) Installing mpfr3 (3.1.5-r1)
(30/82) Installing mpc1 (1.0.3-r1)
(31/82) Installing libstdc++ (8.3.0-r0)
(32/82) Installing gcc (8.3.0-r0)
(33/82) Installing musl-dev (1.1.20-r6)
(34/82) Installing libc-dev (0.7.1-r0)
(35/82) Installing g++ (8.3.0-r0)
(36/82) Installing make (4.2.1-r2)
(37/82) Installing fortify-headers (1.0-r0)
(38/82) Installing build-base (0.5-r1)
(39/82) Installing ca-certificates (20191127-r2)
(40/82) Installing nghttp2-libs (1.35.1-r2)
(41/82) Installing libssh2 (1.9.0-r1)
(42/82) Installing libcurl (7.64.0-r5)
(43/82) Installing curl (7.64.0-r5)
(44/82) Installing geoip (1.6.12-r1)
(45/82) Installing pkgconf (1.6.0-r0)
(46/82) Installing geoip-dev (1.6.12-r1)
(47/82) Installing libgpg-error (1.33-r0)
(48/82) Installing libassuan (2.5.1-r0)
(49/82) Installing libcap (2.26-r0)
(50/82) Installing pinentry (1.1.0-r0)
Executing pinentry-1.1.0-r0.post-install
(51/82) Installing libgcrypt (1.8.5-r0)
(52/82) Installing nettle (3.4.1-r0)
(53/82) Installing libffi (3.2.1-r6)
(54/82) Installing p11-kit (0.23.14-r0)
(55/82) Installing libtasn1 (4.14-r0)
(56/82) Installing libunistring (0.9.10-r0)
(57/82) Installing gnutls (3.6.15-r0)
(58/82) Installing libksba (1.3.5-r0)
(59/82) Installing db (5.3.28-r1)
(60/82) Installing libsasl (2.1.27-r2)
(61/82) Installing libldap (2.4.48-r2)
(62/82) Installing npth (1.6-r0)
(63/82) Installing sqlite-libs (3.28.0-r3)
(64/82) Installing gnupg (2.2.19-r0)
(65/82) Installing oniguruma (6.9.4-r1)
(66/82) Installing jq (1.6-r0)
(67/82) Upgrading musl-utils (1.1.20-r5 -> 1.1.20-r6)
(68/82) Installing libmaxminddb (1.3.2-r0)
(69/82) Installing libltdl (2.4.6-r5)
(70/82) Installing libtool (2.4.6-r5)
(71/82) Installing yaml (0.2.1-r0)
(72/82) Installing ruby-libs (2.5.8-r0)
(73/82) Installing ruby (2.5.8-r0)
(74/82) Installing libgmpxx (6.1.2-r1)
(75/82) Installing gmp-dev (6.1.2-r1)
(76/82) Installing ruby-dev (2.5.8-r0)
(77/82) Installing ruby-etc (2.5.8-r0)
(78/82) Installing ruby-irb (2.5.8-r0)
(79/82) Installing ruby-webrick (2.5.8-r0)
(80/82) Installing tini (0.18.0-r0)
(81/82) Installing tzdata (2020c-r1)
(82/82) Installing zlib-dev (1.2.11-r1)
Executing busybox-1.29.3-r10.trigger
Executing ca-certificates-20191127-r2.trigger
OK: 259 MiB in 94 packages
Building native extensions. This could take a while...
Successfully installed oj-3.3.10
1 gem installed
Building native extensions. This could take a while...
Successfully installed json-2.2.0
1 gem installed
Successfully installed fiber-local-1.0.0
Successfully installed console-1.10.1
Building native extensions. This could take a while...
ERROR:  Error installing async-http:
    ERROR: Failed to build gem native extension.

    current directory: /usr/lib/ruby/gems/2.5.0/gems/nio4r-2.5.5/ext/nio4r
/usr/bin/ruby -r ./siteconf20210208-219-1wvyijh.rb extconf.rb
checking for unistd.h... yes
checking for linux/aio_abi.h... no
checking for linux/io_uring.h... no
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/lib/ruby/gems/2.5.0/gems/nio4r-2.5.5/ext/nio4r
make "DESTDIR=" clean

current directory: /usr/lib/ruby/gems/2.5.0/gems/nio4r-2.5.5/ext/nio4r
make "DESTDIR="
compiling bytebuffer.c
compiling monitor.c
compiling nio4r_ext.c
In file included from nio4r_ext.c:6:
../libev/ev.c:479:11: fatal error: linux/version.h: No such file or directory
 # include <linux/version.h>
           ^~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:243: nio4r_ext.o] Error 1

make failed, exit code 2

Gem files will remain installed in /usr/lib/ruby/gems/2.5.0/gems/nio4r-2.5.5 for inspection.
Results logged to /usr/lib/ruby/gems/2.5.0/extensions/x86_64-linux/2.5.0/nio4r-2.5.5/gem_make.out
The command '/bin/sh -c apk --no-cache --update add                             build-base                             ca-certificates                             ruby ruby-dev ruby-irb ruby-etc ruby-webrick                 tini                            curl                             jq                             gnupg                             bind-tools                             bash                             geoip                             geoip-dev                             libmaxminddb                             libtool                             automake                             autoconf                             zlib zlib-dev              tzdata &&     echo 'gem: --no-document' >> /etc/gemrc &&     gem install oj -v 3.3.10 &&     gem install json -v 2.2.0 &&     gem install async-http -v 0.46.3 &&     gem install fluentd -v 1.6.0 &&     gem install bigdecimal -v 1.3.5 &&     gem install fluent-plugin-elasticsearch &&     gem install fluent-plugin-geoip &&     gem install fluent-plugin-rewrite-tag-filter &&     gem install fluent-plugin-route &&     apk del build-base ruby-dev &&     rm -rf /tmp/* /var/tmp/* /var/cache/apk/* /usr/lib/ruby/gems/*/cache/*.gem' returned a non-zero code: 1
ERROR: Job failed: exit code 1
olleolleolle commented 3 years ago

Some interesting notes here: they won't fix your issue - something more Alpine-specific might be a better search, but it explains what's missing: https://askubuntu.com/questions/390995/help-locating-linux-version-h

olleolleolle commented 3 years ago

Perhaps a RUN apk add linux-headers in there?

aalemanq commented 3 years ago

Thanks so much, seems that with linux-headers is working in alpine. I don't know what was changed!

Is so so weird, last Friday I was doing my deploys without any error.

Thanks so much!!!

olleolleolle commented 3 years ago

Alright, I'll label this issue "Invalid", due to the fact that "Alpine needs linux-headers to install nio4r" is not about things that async-http can influence. Thanks for the report, though!

Ciao for now! 👋