Skip to content

9.0: installation of grpc gem fails on OpenBSD

Summary

Since I'm on OpenBSD, I have to install GitLab from source, following the instructions here: https://docs.gitlab.com/ce/install/installation.html

but instead of using 8.17.0-stable, I tried to use the 9.0.0-stable branch.

Steps to reproduce

When it comes to the step installing the gems: https://docs.gitlab.com/ce/install/installation.html#install-gems

I run:

bundle install --deployment --without development test mysql aws kerberos that takes a while, then it fails with:

    current directory: /var/www/gitlab/.gem/ruby/2.3/gems/grpc-0.15.0/src/ruby/ext/grpc
/usr/local/bin/ruby23 -r ./siteconf20170316-88036-b52pk3.rb extconf.rb
Building internal gRPC into /var/www/gitlab/.gem/ruby/2.3/gems/grpc-0.15.0/src/ruby/ext/grpc/libs/opt
make: Entering directory '/var/www/gitlab/.gem/ruby/2.3/gems/grpc-0.15.0'
[C]       Compiling third_party/zlib/adler32.c
[C]       Compiling third_party/zlib/compress.c
[C]       Compiling third_party/zlib/crc32.c
[C]       Compiling third_party/zlib/deflate.c
cc1: error: unrecognized command line option "-Wsign-conversion"
cc1: error: unrecognized command line option "-Wno-sign-conversion"
[C]       Compiling third_party/zlib/gzclose.c
cc1: error: unrecognized command line option "-Wsign-conversion"
cc1: error: unrecognized command line option "-Wno-sign-conversion"
cc1: error: unrecognized command line option "-Wsign-conversion"
cc1: error: unrecognized command line option "-Wno-sign-conversion"
[C]       Compiling third_party/zlib/gzlib.c
make: *** [Makefile:2152: /var/www/gitlab/.gem/ruby/2.3/gems/grpc-0.15.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/crc32.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [Makefile:2152: /var/www/gitlab/.gem/ruby/2.3/gems/grpc-0.15.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/compress.o] Error 1
make: *** [Makefile:2152: /var/www/gitlab/.gem/ruby/2.3/gems/grpc-0.15.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/adler32.o] Error 1
cc1: error: unrecognized command line option "-Wsign-conversion"
cc1: error: unrecognized command line option "-Wno-sign-conversion"
make: *** [Makefile:2153: /var/www/gitlab/.gem/ruby/2.3/gems/grpc-0.15.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/deflate.o] Error 1
cc1: error: unrecognized command line option "-Wsign-conversion"
cc1: error: unrecognized command line option "-Wno-sign-conversion"
make: *** [Makefile:2153: /var/www/gitlab/.gem/ruby/2.3/gems/grpc-0.15.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/gzclose.o] Error 1
cc1: error: unrecognized command line option "-Wsign-conversion"
cc1: error: unrecognized command line option "-Wno-sign-conversion"
make: *** [Makefile:2153: /var/www/gitlab/.gem/ruby/2.3/gems/grpc-0.15.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/gzlib.o] Error 1
make: Leaving directory '/var/www/gitlab/.gem/ruby/2.3/gems/grpc-0.15.0'
*** 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.

default compiler on OpenBSD is:

cc --version
cc (GCC) 4.2.1 20070719

I tricked it to use clang, but then I ran into a different error:

clang --version
clang version 3.9.1 (tags/RELEASE_391/final)
Target: amd64-unknown-openbsd6.0
Thread model: posix
InstalledDir: /usr/local/bin/ruby23


running the command again:

    current directory: /var/www/gitlab/.gem/ruby/2.3/gems/grpc-1.1.2/src/ruby/ext/grpc
/usr/local/bin/ruby23 -r ./siteconf20170316-86767-uizwby.rb extconf.rb
Building internal gRPC into /var/www/gitlab/.gem/ruby/2.3/gems/grpc-1.1.2/src/ruby/ext/grpc/libs/opt
make: Entering directory '/var/www/gitlab/.gem/ruby/2.3/gems/grpc-1.1.2'
[C]       Compiling third_party/zlib/adler32.c
[C]       Compiling third_party/zlib/compress.c
[C]       Compiling third_party/zlib/crc32.c
[C]       Compiling third_party/zlib/deflate.c
[C]       Compiling third_party/zlib/gzclose.c
[C]       Compiling third_party/zlib/gzlib.c
[C]       Compiling third_party/zlib/gzread.c
[C]       Compiling third_party/zlib/gzwrite.c
[C]       Compiling third_party/zlib/infback.c
[C]       Compiling third_party/zlib/inffast.c
[C]       Compiling third_party/zlib/inflate.c
[C]       Compiling third_party/zlib/inftrees.c
[C]       Compiling third_party/zlib/trees.c
[C]       Compiling third_party/zlib/uncompr.c
[C]       Compiling third_party/zlib/zutil.c
[C]       Compiling src/boringssl/err_data.c
[C]       Compiling third_party/boringssl/crypto/aes/aes.c
[C]       Compiling third_party/boringssl/crypto/aes/mode_wrappers.c
third_party/zlib/inflate.c:1507:61: error: shifting a negative signed value is undefined [-Werror,-Wshift-negative-value]
    if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16;
                                                        ~~~ ^
1 error generated.
[C]       Compiling third_party/boringssl/crypto/asn1/a_bitstr.c
[C]       Compiling third_party/boringssl/crypto/asn1/a_bool.c
make: *** [Makefile:2291: /var/www/gitlab/.gem/ruby/2.3/gems/grpc-1.1.2/src/ruby/ext/grpc/objs/opt/third_party/zlib/inflate.o] Error 1
make: *** Waiting for unfinished jobs....
[C]       Compiling third_party/boringssl/crypto/asn1/a_d2i_fp.c
make: Leaving directory '/var/www/gitlab/.gem/ruby/2.3/gems/grpc-1.1.2'
*** 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.

What is the current bug behavior?

installation of dependent gems fails

What is the expected correct behavior?

a successful installation of the gems.

Possible fixes

For the time being, I downgraded to 8.17.3 which does install the required gems, and works fine so far.