fluent-plugins-nursery / fluent-plugin-systemd

This is a fluentd input plugin. It reads logs from the systemd journal.
Apache License 2.0
153 stars 43 forks source link

`checking for ffi.h... *** extconf.rb failed ***` #82

Closed chrissound closed 4 years ago

chrissound commented 4 years ago
FROM fluent/fluentd:v1.10-debian

USER root 

RUN apt update
RUN apt install -y libffi-dev
RUN apt install -y libsystemd0

RUN gem install fluent-plugin-systemd -v 1.0.1 || true
RUN echo "test"
RUN cat /usr/local/bundle/extensions/x86_64-linux/2.6.0/ffi-1.13.1/gem_make.out 

USER fluent
 docker build -t fld .
Sending build context to Docker daemon  83.89MB
Step 1/9 : FROM fluent/fluentd:v1.10-debian
 ---> a8898cd41b95
Step 2/9 : USER root
 ---> Using cache
 ---> 96bf61600028
Step 3/9 : RUN apt update
 ---> Using cache
 ---> c81580e5433f
Step 4/9 : RUN apt install -y libffi-dev
 ---> Using cache
 ---> 8877b4ec056c
Step 5/9 : RUN apt install -y libsystemd0
 ---> Running in 1017ac975fed

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

Reading package lists...
Building dependency tree...
Reading state information...
The following packages will be upgraded:
  libsystemd0
1 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
Need to get 331 kB of archives.
After this operation, 1024 B of additional disk space will be used.
Get:1 http://deb.debian.org/debian buster/main amd64 libsystemd0 amd64 241-7~deb10u4 [331 kB]
debconf: delaying package configuration, since apt-utils is not installed
Fetched 331 kB in 0s (1557 kB/s)
(Reading database ... 8571 files and directories currently installed.)
Preparing to unpack .../libsystemd0_241-7~deb10u4_amd64.deb ...
Unpacking libsystemd0:amd64 (241-7~deb10u4) over (241-7~deb10u3) ...
Setting up libsystemd0:amd64 (241-7~deb10u4) ...
Processing triggers for libc-bin (2.28-10) ...
Removing intermediate container 1017ac975fed
 ---> f69ba7460617
Step 6/9 : RUN gem install fluent-plugin-systemd -v 1.0.1 || true
 ---> Running in 2aa1b03a4aac
Building native extensions. This could take a while...
ERROR:  Error installing fluent-plugin-systemd:
    ERROR: Failed to build gem native extension.

    current directory: /usr/local/bundle/gems/ffi-1.13.1/ext/ffi_c
/usr/local/bin/ruby -I /usr/local/lib/ruby/2.6.0 -r ./siteconf20200616-6-1uy72yx.rb extconf.rb
checking for ffi.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/usr/local/bin/$(RUBY_BASE_NAME)
    --with-ffi_c-dir
    --without-ffi_c-dir
    --with-ffi_c-include
    --without-ffi_c-include=${ffi_c-dir}/include
    --with-ffi_c-lib
    --without-ffi_c-lib=${ffi_c-dir}/lib
    --enable-system-libffi
    --disable-system-libffi
    --with-libffi-config
    --without-libffi-config
    --with-pkg-config
    --without-pkg-config
/usr/local/lib/ruby/2.6.0/mkmf.rb:467:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from /usr/local/lib/ruby/2.6.0/mkmf.rb:601:in `try_cpp'
    from /usr/local/lib/ruby/2.6.0/mkmf.rb:1109:in `block in have_header'
    from /usr/local/lib/ruby/2.6.0/mkmf.rb:959:in `block in checking_for'
    from /usr/local/lib/ruby/2.6.0/mkmf.rb:361:in `block (2 levels) in postpone'
    from /usr/local/lib/ruby/2.6.0/mkmf.rb:331:in `open'
    from /usr/local/lib/ruby/2.6.0/mkmf.rb:361:in `block in postpone'
    from /usr/local/lib/ruby/2.6.0/mkmf.rb:331:in `open'
    from /usr/local/lib/ruby/2.6.0/mkmf.rb:357:in `postpone'
    from /usr/local/lib/ruby/2.6.0/mkmf.rb:958:in `checking_for'
    from /usr/local/lib/ruby/2.6.0/mkmf.rb:1108:in `have_header'
    from extconf.rb:10:in `system_libffi_usable?'
    from extconf.rb:42:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /usr/local/bundle/extensions/x86_64-linux/2.6.0/ffi-1.13.1/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /usr/local/bundle/gems/ffi-1.13.1 for inspection.
Results logged to /usr/local/bundle/extensions/x86_64-linux/2.6.0/ffi-1.13.1/gem_make.out
Removing intermediate container 2aa1b03a4aac
 ---> 12f73b2ac698
Step 7/9 : RUN echo "test"
 ---> Running in 17c67d27b2e8
test
Removing intermediate container 17c67d27b2e8
 ---> b36b9d804837
Step 8/9 : RUN cat /usr/local/bundle/extensions/x86_64-linux/2.6.0/ffi-1.13.1/gem_make.out
 ---> Running in c169523e07c5
current directory: /usr/local/bundle/gems/ffi-1.13.1/ext/ffi_c
/usr/local/bin/ruby -I /usr/local/lib/ruby/2.6.0 -r ./siteconf20200616-6-1uy72yx.rb extconf.rb
checking for ffi.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/usr/local/bin/$(RUBY_BASE_NAME)
    --with-ffi_c-dir
    --without-ffi_c-dir
    --with-ffi_c-include
    --without-ffi_c-include=${ffi_c-dir}/include
    --with-ffi_c-lib
    --without-ffi_c-lib=${ffi_c-dir}/lib
    --enable-system-libffi
    --disable-system-libffi
    --with-libffi-config
    --without-libffi-config
    --with-pkg-config
    --without-pkg-config
/usr/local/lib/ruby/2.6.0/mkmf.rb:467:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from /usr/local/lib/ruby/2.6.0/mkmf.rb:601:in `try_cpp'
    from /usr/local/lib/ruby/2.6.0/mkmf.rb:1109:in `block in have_header'
    from /usr/local/lib/ruby/2.6.0/mkmf.rb:959:in `block in checking_for'
    from /usr/local/lib/ruby/2.6.0/mkmf.rb:361:in `block (2 levels) in postpone'
    from /usr/local/lib/ruby/2.6.0/mkmf.rb:331:in `open'
    from /usr/local/lib/ruby/2.6.0/mkmf.rb:361:in `block in postpone'
    from /usr/local/lib/ruby/2.6.0/mkmf.rb:331:in `open'
    from /usr/local/lib/ruby/2.6.0/mkmf.rb:357:in `postpone'
    from /usr/local/lib/ruby/2.6.0/mkmf.rb:958:in `checking_for'
    from /usr/local/lib/ruby/2.6.0/mkmf.rb:1108:in `have_header'
    from extconf.rb:10:in `system_libffi_usable?'
    from extconf.rb:42:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /usr/local/bundle/extensions/x86_64-linux/2.6.0/ffi-1.13.1/mkmf.log

extconf failed, exit code 1
Removing intermediate container c169523e07c5
 ---> 1f220ec273b6
Step 9/9 : USER fluent
 ---> Running in 0910aba9f78b
Removing intermediate container 0910aba9f78b
 ---> d1c1151d58d9
Successfully built d1c1151d58d9
Successfully tagged fld:latest
chrissound commented 4 years ago

I was missing build-essential... apt install -y build-essential