gliderlabs / docker-alpine

Alpine Linux Docker image. Win at minimalism!
http://gliderlabs.viewdocs.io/docker-alpine
BSD 2-Clause "Simplified" License
5.71k stars 531 forks source link

alpine-3.8 breaks grpc gem installation #424

Open stefanandres opened 6 years ago

stefanandres commented 6 years ago

When using the 3.8 image, gem install grpc fails. The same command worked in 3.7

$ docker run -it alpine:3.8 sh
Unable to find image 'alpine:3.8' locally
3.8: Pulling from library/alpine
Digest: sha256:7043076348bf5040220df6ad703798fd8593a0918d06d3ce30c6c93be117e430
Status: Downloaded newer image for alpine:3.8
/ # apk add alpine-sdk ruby ruby-dev
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
(1/49) Installing fakeroot (1.22-r0)
(2/49) Installing sudo (1.8.23-r2)
(3/49) Installing libcap (2.25-r1)
(4/49) Installing pax-utils (1.2.3-r0)
(5/49) Installing libressl (2.7.4-r0)
(6/49) Installing libattr (2.4.47-r7)
(7/49) Installing attr (2.4.47-r7)
(8/49) Installing tar (1.30-r0)
(9/49) Installing pkgconf (1.5.1-r0)
(10/49) Installing patch (2.7.6-r2)
(11/49) Installing libgcc (6.4.0-r8)
(12/49) Installing libstdc++ (6.4.0-r8)
(13/49) Installing lzip (1.20-r0)
(14/49) Installing ca-certificates (20171114-r3)
(15/49) Installing nghttp2-libs (1.32.0-r0)
(16/49) Installing libssh2 (1.8.0-r3)
(17/49) Installing libcurl (7.60.0-r1)
(18/49) Installing curl (7.60.0-r1)
(19/49) Installing abuild (3.2.0-r0)
Executing abuild-3.2.0-r0.pre-install
(20/49) Installing binutils (2.30-r5)
(21/49) Installing libmagic (5.32-r0)
(22/49) Installing file (5.32-r0)
(23/49) Installing gmp (6.1.2-r1)
(24/49) Installing isl (0.18-r0)
(25/49) Installing libgomp (6.4.0-r8)
(26/49) Installing libatomic (6.4.0-r8)
(27/49) Installing mpfr3 (3.1.5-r1)
(28/49) Installing mpc1 (1.0.3-r1)
(29/49) Installing gcc (6.4.0-r8)
(30/49) Installing musl-dev (1.1.19-r10)
(31/49) Installing libc-dev (0.7.1-r0)
(32/49) Installing g++ (6.4.0-r8)
(33/49) Installing make (4.2.1-r2)
(34/49) Installing fortify-headers (0.9-r0)
(35/49) Installing build-base (0.5-r1)
(36/49) Installing expat (2.2.5-r0)
(37/49) Installing pcre2 (10.31-r0)
(38/49) Installing git (2.18.0-r0)
(39/49) Installing alpine-sdk (1.0-r0)
(40/49) Installing ncurses-terminfo-base (6.1-r0)
(41/49) Installing ncurses-terminfo (6.1-r0)
(42/49) Installing ncurses-libs (6.1-r0)
(43/49) Installing readline (7.0.003-r0)
(44/49) Installing yaml (0.1.7-r0)
(45/49) Installing ruby-libs (2.5.1-r2)
(46/49) Installing ruby (2.5.1-r2)
(47/49) Installing libgmpxx (6.1.2-r1)
(48/49) Installing gmp-dev (6.1.2-r1)
(49/49) Installing ruby-dev (2.5.1-r2)
Executing busybox-1.28.4-r0.trigger
Executing ca-certificates-20171114-r3.trigger
OK: 205 MiB in 62 packages
/ # gem install grpc
Fetching: google-protobuf-3.6.0.gem (100%)
Building native extensions. This could take a while...
Successfully installed google-protobuf-3.6.0
Fetching: multipart-post-2.0.0.gem (100%)
Successfully installed multipart-post-2.0.0
Fetching: faraday-0.15.2.gem (100%)
Successfully installed faraday-0.15.2
Fetching: little-plugger-1.1.4.gem (100%)
Successfully installed little-plugger-1.1.4
Fetching: multi_json-1.13.1.gem (100%)
Successfully installed multi_json-1.13.1
Fetching: logging-2.2.2.gem (100%)
Successfully installed logging-2.2.2
Fetching: jwt-2.1.0.gem (100%)
Successfully installed jwt-2.1.0
Fetching: memoist-0.16.0.gem (100%)
Successfully installed memoist-0.16.0
Fetching: os-0.9.6.gem (100%)
Successfully installed os-0.9.6
Fetching: public_suffix-3.0.2.gem (100%)
Successfully installed public_suffix-3.0.2
Fetching: addressable-2.5.2.gem (100%)
Successfully installed addressable-2.5.2
Fetching: signet-0.8.1.gem (100%)
Successfully installed signet-0.8.1
Fetching: googleauth-0.6.2.gem (100%)
Successfully installed googleauth-0.6.2
Fetching: googleapis-common-protos-types-1.0.1.gem (100%)
Successfully installed googleapis-common-protos-types-1.0.1
Fetching: grpc-1.12.0.gem (100%)
Building native extensions. This could take a while...
ERROR:  Error installing grpc:
    ERROR: Failed to build gem native extension.

    current directory: /usr/lib/ruby/gems/2.5.0/gems/grpc-1.12.0/src/ruby/ext/grpc
/usr/bin/ruby -r ./siteconf20180709-13-1pfayyn.rb extconf.rb
/usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- etc (LoadError)
    from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
    from extconf.rb:15:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /usr/lib/ruby/gems/2.5.0/gems/grpc-1.12.0 for inspection.
Results logged to /usr/lib/ruby/gems/2.5.0/extensions/x86_64-linux/2.5.0/grpc-1.12.0/gem_make.out
/ #
msanfilippof commented 6 years ago

same issue.

asayamakk commented 6 years ago

@stefanandres @marcosanfilippo Trying gem update --system might help you. This worked for me.

/ # gem -v
2.7.6
/ # gem install grpc
Fetching: google-protobuf-3.6.1.gem (100%)
Building native extensions. This could take a while...
Successfully installed google-protobuf-3.6.1
Fetching: googleapis-common-protos-types-1.0.2.gem (100%)
Successfully installed googleapis-common-protos-types-1.0.2
Fetching: grpc-1.15.0.gem (100%)
Building native extensions. This could take a while...
ERROR:  Error installing grpc:
    ERROR: Failed to build gem native extension.

    current directory: /usr/lib/ruby/gems/2.5.0/gems/grpc-1.15.0/src/ruby/ext/grpc
/usr/bin/ruby -r ./siteconf20181010-18-1puk867.rb extconf.rb
/usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- etc (LoadError)
current directory: /usr/lib/ruby/gems/2.5.0/gems/grpc-1.15.0/src/ruby/ext/grpc
/usr/bin/ruby -r ./siteconf20181010-81-tyqyjy.rb extconf.rb
/usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require': cannot load such file -- etc (LoadError)
    from /usr/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
    from extconf.rb:15:in `<main>'

extconf failed, exit code 1

/ # gem update --no-document --system
Updating rubygems-update
Successfully installed rubygems-update-2.7.7
Installing RubyGems 2.7.7
Bundler 1.16.2 installed
RubyGems 2.7.7 installed
Regenerating binstubs

=== 2.7.7 / 2018-05-08

Minor enhancements:

* [RequestSet] Only suggest a gem version with an installable platform.
  Pull request #2175 by Samuel Giddins.
* Fixed no assignment variables about default gems installation. Pull
  request #2181 by SHIBATA Hiroshi.
* Backport improvements for test-case from Ruby core. Pull request #2189
  by SHIBATA Hiroshi.
* Fix ruby warnings in test suite. Pull request #2205 by Colby Swandale.
* To use Gem::Specification#bindir of bundler instead of hard coded path.
  Pull request #2208 by SHIBATA Hiroshi.
* Update gem push --help description. Pull request #2215 by Luis
  Sagastume.
* Backport ruby core commits. Pull request #2264 by SHIBATA Hiroshi.

Bug fixes:

* Frozen string fix - lib/rubygems/bundler_version_finder.rb. Pull request
  #2115 by MSP-Greg.
* Fixed tempfile leak for RubyGems 2.7.6. Pull request #2194 by SHIBATA
  Hiroshi.
* Add missing requires. Pull request #2196 by David Rodríguez.
* Fix Gem::Version.correct?. Pull request #2203 by Masato Nakamura.
* Fix verify_entry regex for metadata. Pull request #2212 by Luis
  Sagastume.
* Fix path checks for case insensitive filesystem. Pull request #2211 by
  Lars Kanis.

Compatibility changes:

* Deprecate unused code before removing them at #1524. Pull request #2197
  by SHIBATA Hiroshi.
* Deprecate for rubygems 3. Pull request #2214 by SHIBATA Hiroshi.
* Mark deprecation to `ubygems.rb` for RubyGems 4. Pull request #2269 by
  SHIBATA Hiroshi.
* Update bundler-1.16.2. Pull request #2291 by SHIBATA Hiroshi.

RubyGems system software updated
/ # gem -v
2.7.7
/ # gem install grpc --no-document
Successfully installed grpc-1.15.0-x86_64-linux
1 gem installed

Installing grpc fails because somewhy gem install grpc does not use use precompiled extensions. Updating gem itself may solve this problem.

See this issue for further information https://github.com/grpc/grpc/issues/6525

stefanandres commented 6 years ago

Yes, that works. Thanks.

Though then the alpine's gem version should be updated to gem-2.7.7 from gem-2.7.6

archonic commented 5 years ago

I had issues with alpine 3.9, gem 3.0.3 and grpc 1.19. I could gem install grpc 1.21 no problem but I couldn't get it to update in the context of having a gemfile despite running bundle update stackdriver. I've removed stackdriver from the gemfile and will report back if I find a way to reinstall it.