Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grpc: lipo: can't figure out the architecture type #1982

Closed
deepj opened this issue Mar 31, 2020 · 13 comments
Closed

grpc: lipo: can't figure out the architecture type #1982

deepj opened this issue Mar 31, 2020 · 13 comments

Comments

@deepj
Copy link

deepj commented Mar 31, 2020

truffleruby 20.1.0-dev-b09f04ee, like ruby 2.6.5, GraalVM CE Native [x86_64-darwin]

To reproduce

gem install grpc

Error:

Fetching google-protobuf-3.11.4.gem
Fetching googleapis-common-protos-types-1.0.4.gem
Fetching grpc-1.27.0.gem
Building native extensions. This could take a while...
Successfully installed google-protobuf-3.11.4
Successfully installed googleapis-common-protos-types-1.0.4
Building native extensions. This could take a while...
ERROR:  Error installing grpc:
	ERROR: Failed to build gem native extension.

    current directory: ~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc
~/.rubies/truffleruby-dev/bin/truffleruby -I ~/.rubies/truffleruby-dev/lib/mri -r ./siteconf20200331-87824-15xra5u.rb extconf.rb
[C]       Compiling third_party/zlib/adler32.c
[C]       Compiling third_party/zlib/crc32.c
[C]       Compiling third_party/zlib/deflate.c
[C]       Compiling third_party/zlib/compress.c
mkdir -p `dirname ~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/deflate.o`
mkdir -p `dirname ~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/crc32.o`
mkdir -p `dirname ~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/compress.o`
[C]       Compiling third_party/zlib/gzclose.c
mkdir -p `dirname ~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/gzclose.o`
[C]       Compiling third_party/zlib/gzlib.c
mkdir -p `dirname ~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/gzlib.o`
mkdir -p `dirname ~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/adler32.o`
[C]       Compiling third_party/zlib/gzread.c
mkdir -p `dirname ~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/gzread.o`
[C]       Compiling third_party/zlib/gzwrite.c
mkdir -p `dirname ~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/gzwrite.o`
~/.rubies/truffleruby-dev/lib/sulong/native/bin/graalvm-native-clang -Ithird_party/googletest/googletest/include -Ithird_party/googletest/googlemock/include -Ithird_party/boringssl/include -Ithird_party/cares -Ithird_party/cares/cares -Ithird_party/address_sorting/include -DGPR_BACKWARDS_COMPATIBILITY_MODE -g -Wall -Wextra -DOSATOMIC_USE_INLINED=1 -Ithird_party/abseil-cpp -Ithird_party/upb -Isrc/core/ext/upb-generated -O2 -Wframe-larger-than=16384 -fPIC -I. -Iinclude -I~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/gens -I/usr/local/include -DNDEBUG -DINSTALL_PREFIX=\"/usr/local\" -arch i386 -arch x86_64  -Ithird_party/zlib -std=c99  -g   -fvisibility=hidden -MMD -MF ~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/crc32.dep -c -o ~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/crc32.o third_party/zlib/crc32.c
~/.rubies/truffleruby-dev/lib/sulong/native/bin/graalvm-native-clang -Ithird_party/googletest/googletest/include -Ithird_party/googletest/googlemock/include -Ithird_party/boringssl/include -Ithird_party/cares -Ithird_party/cares/cares -Ithird_party/address_sorting/include -DGPR_BACKWARDS_COMPATIBILITY_MODE -g -Wall -Wextra -DOSATOMIC_USE_INLINED=1 -Ithird_party/abseil-cpp -Ithird_party/upb -Isrc/core/ext/upb-generated -O2 -Wframe-larger-than=16384 -fPIC -I. -Iinclude -I~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/gens -I/usr/local/include -DNDEBUG -DINSTALL_PREFIX=\"/usr/local\" -arch i386 -arch x86_64  -Ithird_party/zlib -std=c99  -g   -fvisibility=hidden -MMD -MF ~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/adler32.dep -c -o ~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/adler32.o third_party/zlib/adler32.c
~/.rubies/truffleruby-dev/lib/sulong/native/bin/graalvm-native-clang -Ithird_party/googletest/googletest/include -Ithird_party/googletest/googlemock/include -Ithird_party/boringssl/include -Ithird_party/cares -Ithird_party/cares/cares -Ithird_party/address_sorting/include -DGPR_BACKWARDS_COMPATIBILITY_MODE -g -Wall -Wextra -DOSATOMIC_USE_INLINED=1 -Ithird_party/abseil-cpp -Ithird_party/upb -Isrc/core/ext/upb-generated -O2 -Wframe-larger-than=16384 -fPIC -I. -Iinclude -I~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/gens -I/usr/local/include -DNDEBUG -DINSTALL_PREFIX=\"/usr/local\" -arch i386 -arch x86_64  -Ithird_party/zlib -std=c99  -g   -fvisibility=hidden -MMD -MF ~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/gzlib.dep -c -o ~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/gzlib.o third_party/zlib/gzlib.c
~/.rubies/truffleruby-dev/lib/sulong/native/bin/graalvm-native-clang -Ithird_party/googletest/googletest/include -Ithird_party/googletest/googlemock/include -Ithird_party/boringssl/include -Ithird_party/cares -Ithird_party/cares/cares -Ithird_party/address_sorting/include -DGPR_BACKWARDS_COMPATIBILITY_MODE -g -Wall -Wextra -DOSATOMIC_USE_INLINED=1 -Ithird_party/abseil-cpp -Ithird_party/upb -Isrc/core/ext/upb-generated -O2 -Wframe-larger-than=16384 -fPIC -I. -Iinclude -I~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/gens -I/usr/local/include -DNDEBUG -DINSTALL_PREFIX=\"/usr/local\" -arch i386 -arch x86_64  -Ithird_party/zlib -std=c99  -g   -fvisibility=hidden -MMD -MF ~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/gzread.dep -c -o ~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/gzread.o third_party/zlib/gzread.c
~/.rubies/truffleruby-dev/lib/sulong/native/bin/graalvm-native-clang -Ithird_party/googletest/googletest/include -Ithird_party/googletest/googlemock/include -Ithird_party/boringssl/include -Ithird_party/cares -Ithird_party/cares/cares -Ithird_party/address_sorting/include -DGPR_BACKWARDS_COMPATIBILITY_MODE -g -Wall -Wextra -DOSATOMIC_USE_INLINED=1 -Ithird_party/abseil-cpp -Ithird_party/upb -Isrc/core/ext/upb-generated -O2 -Wframe-larger-than=16384 -fPIC -I. -Iinclude -I~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/gens -I/usr/local/include -DNDEBUG -DINSTALL_PREFIX=\"/usr/local\" -arch i386 -arch x86_64  -Ithird_party/zlib -std=c99  -g   -fvisibility=hidden -MMD -MF ~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/gzwrite.dep -c -o ~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/gzwrite.o third_party/zlib/gzwrite.c
~/.rubies/truffleruby-dev/lib/sulong/native/bin/graalvm-native-clang -Ithird_party/googletest/googletest/include -Ithird_party/googletest/googlemock/include -Ithird_party/boringssl/include -Ithird_party/cares -Ithird_party/cares/cares -Ithird_party/address_sorting/include -DGPR_BACKWARDS_COMPATIBILITY_MODE -g -Wall -Wextra -DOSATOMIC_USE_INLINED=1 -Ithird_party/abseil-cpp -Ithird_party/upb -Isrc/core/ext/upb-generated -O2 -Wframe-larger-than=16384 -fPIC -I. -Iinclude -I~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/gens -I/usr/local/include -DNDEBUG -DINSTALL_PREFIX=\"/usr/local\" -arch i386 -arch x86_64  -Ithird_party/zlib -std=c99  -g   -fvisibility=hidden -MMD -MF ~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/gzclose.dep -c -o ~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/gzclose.o third_party/zlib/gzclose.c
~/.rubies/truffleruby-dev/lib/sulong/native/bin/graalvm-native-clang -Ithird_party/googletest/googletest/include -Ithird_party/googletest/googlemock/include -Ithird_party/boringssl/include -Ithird_party/cares -Ithird_party/cares/cares -Ithird_party/address_sorting/include -DGPR_BACKWARDS_COMPATIBILITY_MODE -g -Wall -Wextra -DOSATOMIC_USE_INLINED=1 -Ithird_party/abseil-cpp -Ithird_party/upb -Isrc/core/ext/upb-generated -O2 -Wframe-larger-than=16384 -fPIC -I. -Iinclude -I~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/gens -I/usr/local/include -DNDEBUG -DINSTALL_PREFIX=\"/usr/local\" -arch i386 -arch x86_64  -Ithird_party/zlib -std=c99  -g   -fvisibility=hidden -MMD -MF ~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/compress.dep -c -o ~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/compress.o third_party/zlib/compress.c
~/.rubies/truffleruby-dev/lib/sulong/native/bin/graalvm-native-clang -Ithird_party/googletest/googletest/include -Ithird_party/googletest/googlemock/include -Ithird_party/boringssl/include -Ithird_party/cares -Ithird_party/cares/cares -Ithird_party/address_sorting/include -DGPR_BACKWARDS_COMPATIBILITY_MODE -g -Wall -Wextra -DOSATOMIC_USE_INLINED=1 -Ithird_party/abseil-cpp -Ithird_party/upb -Isrc/core/ext/upb-generated -O2 -Wframe-larger-than=16384 -fPIC -I. -Iinclude -I~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/gens -I/usr/local/include -DNDEBUG -DINSTALL_PREFIX=\"/usr/local\" -arch i386 -arch x86_64  -Ithird_party/zlib -std=c99  -g   -fvisibility=hidden -MMD -MF ~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/deflate.dep -c -o ~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/deflate.o third_party/zlib/deflate.c
third_party/zlib/gzread.c:35:15: warning: implicit declaration of function 'read' is invalid in C99 [-Wimplicit-function-declaration]
        ret = read(state->fd, buf + *have, get);
              ^
third_party/zlib/gzwrite.c:89:20: warning: implicit declaration of function 'write' is invalid in C99 [-Wimplicit-function-declaration]
third_party/zlib/gzlib.c:252:9: warning: implicit declaration of function 'lseek' is invalid in C99 [-Wimplicit-function-declaration]
        LSEEK(state->fd, 0, SEEK_END);  /* so gzoffset() is correct */
        ^
third_party/zlib/gzlib.c:14:17: note: expanded from macro 'LSEEK'
#  define LSEEK lseek
                ^
third_party/zlib/gzlib.c:258:24: warning: implicit declaration of function 'lseek' is invalid in C99 [-Wimplicit-function-declaration]
        state->start = LSEEK(state->fd, 0, SEEK_CUR);
                       ^
third_party/zlib/gzlib.c:14:17: note: expanded from macro 'LSEEK'
#  define LSEEK lseek
                ^
third_party/zlib/gzread.c:651:11: warning: implicit declaration of function 'close' is invalid in C99 [-Wimplicit-function-declaration]
    ret = close(state->fd);
          ^
third_party/zlib/gzlib.c:359:9: warning: implicit declaration of function 'lseek' is invalid in C99 [-Wimplicit-function-declaration]
    if (LSEEK(state->fd, state->start, SEEK_SET) == -1)
        ^
third_party/zlib/gzlib.c:14:17: note: expanded from macro 'LSEEK'
#  define LSEEK lseek
                ^
third_party/zlib/gzlib.c:400:15: warning: implicit declaration of function 'lseek' is invalid in C99 [-Wimplicit-function-declaration]
        ret = LSEEK(state->fd, offset - state->x.have, SEEK_CUR);
              ^
third_party/zlib/gzlib.c:14:17: note: expanded from macro 'LSEEK'
#  define LSEEK lseek
                ^
third_party/zlib/gzlib.c:496:14: warning: implicit declaration of function 'lseek' is invalid in C99 [-Wimplicit-function-declaration]
    offset = LSEEK(state->fd, 0, SEEK_CUR);
             ^
third_party/zlib/gzlib.c:14:17: note: expanded from macro 'LSEEK'
#  define LSEEK lseek
                ^
            writ = write(state->fd, strm->next_in, put);
                   ^
third_party/zlib/gzwrite.c:110:24: warning: implicit declaration of function 'write' is invalid in C99 [-Wimplicit-function-declaration]
                writ = write(state->fd, state->x.next, put);
                       ^
third_party/zlib/gzwrite.c:661:9: warning: implicit declaration of function 'close' is invalid in C99 [-Wimplicit-function-declaration]
    if (close(state->fd) == -1)
        ^
5 warnings generated.
[C]       Compiling third_party/zlib/infback.c
mkdir -p `dirname ~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/infback.o`
~/.rubies/truffleruby-dev/lib/sulong/native/bin/graalvm-native-clang -Ithird_party/googletest/googletest/include -Ithird_party/googletest/googlemock/include -Ithird_party/boringssl/include -Ithird_party/cares -Ithird_party/cares/cares -Ithird_party/address_sorting/include -DGPR_BACKWARDS_COMPATIBILITY_MODE -g -Wall -Wextra -DOSATOMIC_USE_INLINED=1 -Ithird_party/abseil-cpp -Ithird_party/upb -Isrc/core/ext/upb-generated -O2 -Wframe-larger-than=16384 -fPIC -I. -Iinclude -I~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/gens -I/usr/local/include -DNDEBUG -DINSTALL_PREFIX=\"/usr/local\" -arch i386 -arch x86_64  -Ithird_party/zlib -std=c99  -g   -fvisibility=hidden -MMD -MF ~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/infback.dep -c -o ~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/infback.o third_party/zlib/infback.c
third_party/zlib/gzlib.c:252:9: warning: implicit declaration of function 'lseek' is invalid in C99 [-Wimplicit-function-declaration]
        LSEEK(state->fd, 0, SEEK_END);  /* so gzoffset() is correct */
        ^
third_party/zlib/gzlib.c:14:17: note: expanded from macro 'LSEEK'
#  define LSEEK lseek
                ^
third_party/zlib/gzlib.c:258:24: warning: implicit declaration of function 'lseek' is invalid in C99 [-Wimplicit-function-declaration]
        state->start = LSEEK(state->fd, 0, SEEK_CUR);
                       ^
third_party/zlib/gzlib.c:14:17: note: expanded from macro 'LSEEK'
#  define LSEEK lseek
                ^
fatal error: /Library/Developer/CommandLineTools/usr/bin/lipo: can't figure out the architecture type of: /var/folders/91/6gm6f_nj3qbfd3cj50801mwm0000gn/T/compress-87b073.o
3 warnings generated.
clang-9: error: lipo command failed with exit code 1 (use -v to see invocation)
make: *** [~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/compress.o] Error 1
make: *** Waiting for unfinished jobs....
2 warnings generated.
third_party/zlib/gzlib.c:359:9: warning: implicit declaration of function 'lseek' is invalid in C99 [-Wimplicit-function-declaration]
    if (LSEEK(state->fd, state->start, SEEK_SET) == -1)
        ^
third_party/zlib/gzlib.c:14:17: note: expanded from macro 'LSEEK'
#  define LSEEK lseek
                ^
third_party/zlib/gzlib.c:400:15: warning: implicit declaration of function 'lseek' is invalid in C99 [-Wimplicit-function-declaration]
        ret = LSEEK(state->fd, offset - state->x.have, SEEK_CUR);
              ^
third_party/zlib/gzlib.c:14:17: note: expanded from macro 'LSEEK'
#  define LSEEK lseek
                ^
third_party/zlib/gzlib.c:496:14: warning: implicit declaration of function 'lseek' is invalid in C99 [-Wimplicit-function-declaration]
    offset = LSEEK(state->fd, 0, SEEK_CUR);
             ^
third_party/zlib/gzlib.c:14:17: note: expanded from macro 'LSEEK'
#  define LSEEK lseek
                ^
third_party/zlib/gzread.c:35:15: warning: implicit declaration of function 'read' is invalid in C99 [-Wimplicit-function-declaration]
        ret = read(state->fd, buf + *have, get);
              ^
third_party/zlib/gzwrite.c:89:20: warning: implicit declaration of function 'write' is invalid in C99 [-Wimplicit-function-declaration]
            writ = write(state->fd, strm->next_in, put);
                   ^
third_party/zlib/gzwrite.c:110:24: warning: implicit declaration of function 'write' is invalid in C99 [-Wimplicit-function-declaration]
                writ = write(state->fd, state->x.next, put);
                       ^
third_party/zlib/gzread.c:651:11: warning: implicit declaration of function 'close' is invalid in C99 [-Wimplicit-function-declaration]
    ret = close(state->fd);
          ^
third_party/zlib/gzwrite.c:661:9: warning: implicit declaration of function 'close' is invalid in C99 [-Wimplicit-function-declaration]
    if (close(state->fd) == -1)
        ^
5 warnings generated.
fatal error: /Library/Developer/CommandLineTools/usr/bin/lipo: can't figure out the architecture type of: /var/folders/91/6gm6f_nj3qbfd3cj50801mwm0000gn/T/gzlib-95eea8.o
clang-9: error: lipo command failed with exit code 1 (use -v to see invocation)
make: *** [~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/gzlib.o] Error 1
fatal error: /Library/Developer/CommandLineTools/usr/bin/lipo: can't figure out the architecture type of: /var/folders/91/6gm6f_nj3qbfd3cj50801mwm0000gn/T/crc32-1fe5b1.o
clang-9: error: lipo command failed with exit code 1 (use -v to see invocation)
make: *** [~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/crc32.o] Error 1
3 warnings generated.
2 warnings generated.
fatal error: /Library/Developer/CommandLineTools/usr/bin/lipo: can't figure out the architecture type of: /var/folders/91/6gm6f_nj3qbfd3cj50801mwm0000gn/T/gzwrite-62ad66.o
clang-9: error: lipo command failed with exit code 1 (use -v to see invocation)
make: *** [~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/gzwrite.o] Error 1
fatal error: /Library/Developer/CommandLineTools/usr/bin/lipo: can't figure out the architecture type of: /var/folders/91/6gm6f_nj3qbfd3cj50801mwm0000gn/T/gzread-2a5da4.o
clang-9: error: lipo command failed with exit code 1 (use -v to see invocation)
make: *** [~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/gzread.o] Error 1
fatal error: /Library/Developer/CommandLineTools/usr/bin/lipo: can't figure out the architecture type of: /var/folders/91/6gm6f_nj3qbfd3cj50801mwm0000gn/T/infback-65891d.o
clang-9: error: lipo command failed with exit code 1 (use -v to see invocation)
make: *** [~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/infback.o] Error 1
fatal error: /Library/Developer/CommandLineTools/usr/bin/lipo: can't figure out the architecture type of: /var/folders/91/6gm6f_nj3qbfd3cj50801mwm0000gn/T/deflate-810568.o
clang-9: error: lipo command failed with exit code 1 (use -v to see invocation)
make: *** [~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/objs/opt/third_party/zlib/deflate.o] Error 1
*** 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=~/.rubies/truffleruby-dev/bin/truffleruby
log file does not exist
Building internal gRPC into ~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0/src/ruby/ext/grpc/libs/opt

extconf failed, exit code 1

Gem files will remain installed in ~/.gem/truffleruby/2.6.5/gems/grpc-1.27.0 for inspection.
Results logged to ~/.gem/truffleruby/2.6.5/extensions/x86_64-darwin/20.1.0-dev-b09f04ee/grpc-1.27.0/gem_make.out
@eregon eregon added the cexts label Mar 31, 2020
@eregon
Copy link
Member

eregon commented Mar 31, 2020

For comparison, does gem install --platform ruby grpc works on MRI on your computer?

@deepj
Copy link
Author

deepj commented Mar 31, 2020

@eregon

$ ruby -v 
ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin18]
$ gem install --platform ruby grpc
Fetching google-protobuf-3.11.4.gem
Fetching grpc-1.27.0.gem
Fetching googleapis-common-protos-types-1.0.4.gem
Building native extensions. This could take a while...
Successfully installed google-protobuf-3.11.4
Successfully installed googleapis-common-protos-types-1.0.4
Building native extensions. This could take a while...
Successfully installed grpc-1.27.0
3 gems installed

@deepj
Copy link
Author

deepj commented May 16, 2020

@eregon Is it possible to look at this in near future, please? I would like to try one big Rails app depends on this gem to run :)

@eregon eregon added the macos label May 16, 2020
@eregon
Copy link
Member

eregon commented May 16, 2020

This seems a platform-specific issue, on Linux it installs fine:

$ ruby -v
truffleruby 20.2.0-dev-b682c192, like ruby 2.6.5, GraalVM CE Native [x86_64-linux]
$ gem i grpc
Fetching google-protobuf-3.12.0.gem
Fetching googleapis-common-protos-types-1.0.5.gem
Fetching grpc-1.28.0.gem
Building native extensions. This could take a while...
Successfully installed google-protobuf-3.12.0
Successfully installed googleapis-common-protos-types-1.0.5
Building native extensions. This could take a while...
Successfully installed grpc-1.28.0
3 gems installed

@norswap norswap self-assigned this May 27, 2020
@norswap
Copy link
Contributor

norswap commented May 27, 2020

I was able to reproduce.
Changing the extconf.rb to replace
ENV['ARCH_FLAGS'] = '-arch i386 -arch x86_64' if RUBY_PLATFORM =~ /darwin/
by
ENV['ARCH_FLAGS'] = '-arch x86_64' if RUBY_PLATFORM =~ /darwin/
does let the build progress further, but it now fails with a lof of errors of the type:

error: /Library/Developer/CommandLineTools/usr/bin/libtool: file: /Users/norswap/work/ws
/truffleruby/mxbuild/truffleruby-jvm/jre/languages/ruby/lib/gems/gems/grpc-1.28.0/src/ruby
/ext/grpc/objs/opt/third_party/cares/cares/ares__read_line.o is not an object file (not allowed
 in a library)

@norswap
Copy link
Contributor

norswap commented May 28, 2020

Fixing the above leads to issues with ranlib, because it is called directly instead of through $(RANLIB), causes error like this:

error: /Library/Developer/CommandLineTools/usr/bin/ranlib: library member: /Users/norswap/work/src/grpc/tmp/x86_64-darwin19/grpc_c/2.6.5/libs/opt/libz.a(compress.o) is not an object file (not allowed in a library with multiple architectures)

This can be fixed by adding the LLVM toolchain binaries on the path (<truffleruby_repo>/mxbuild/truffleruby-jvm/jre/languages/llvm/native/bin).

Full write-up incoming.

@norswap
Copy link
Contributor

norswap commented May 28, 2020

I filed an issue with grpc: grpc/grpc#23069

In the mean time, the gem can be installed manually by doing this:

  1. Remove out all lines ending with if RUBY_PLATFORM =~ /darwin/ in extconf.rb.
  2. Remove the block starting with if grpc_config == 'opt' at the end of extconf.rb
  3. Add the path to our LLVM toolchain binaries on the path (<truffleruby_repo>/mxbuild/truffleruby-jvm/jre/languages/llvm/native/bin).
  4. Remove the -no_warning_for_no_symbols flags in the top-level Makefile of grpc.

Note that grpc currently does not run on TruffleRuby after installing (on any platform), but that is most likely due to a bug on our side which we have reported to the Sulong team.

@deepj deepj closed this as completed Jun 8, 2020
@eregon eregon reopened this Jun 19, 2020
@eregon
Copy link
Member

eregon commented Oct 13, 2020

As a note, on Linux, grpc installs but require 'grpc' fails (GR-23843):

$ ruby -rgrpc -e0                                                                                                                       
truffleruby: an exception escaped out of the interpreter - this is an implementation bug
org.graalvm.polyglot.PolyglotException: java.lang.AssertionError: Invalid ElementType of Vector: VariableBitWidthType
	at com.oracle.truffle.llvm.runtime.types.VectorType.setElementType(VectorType.java:77)
	at com.oracle.truffle.llvm.parser.listeners.Types.setType(Types.java:243)
	at com.oracle.truffle.llvm.parser.listeners.Types.record(Types.java:168)
	at com.oracle.truffle.llvm.parser.scanner.LLVMScanner.passRecordToParser(LLVMScanner.java:435)
	at com.oracle.truffle.llvm.parser.scanner.LLVMScanner.unabbreviatedRecord(LLVMScanner.java:451)
	at com.oracle.truffle.llvm.parser.scanner.LLVMScanner.scanToOffset(LLVMScanner.java:165)
	at com.oracle.truffle.llvm.parser.scanner.LLVMScanner.scanToEnd(LLVMScanner.java:144)
	at com.oracle.truffle.llvm.parser.scanner.LLVMScanner.parseBitcode(LLVMScanner.java:103)

@norswap
Copy link
Contributor

norswap commented Nov 3, 2020

grpc pull request: grpc/grpc#24632

@deepj
Copy link
Author

deepj commented Jan 28, 2021

Any news about this issue?

@norswap
Copy link
Contributor

norswap commented Jan 29, 2021

It's as you can see on the pull request - apparently the build timed out (because of the change? not sure), and I asked what I could do to help move the issue forward, but there has been no news. Feel free to chime in there, could serve as a reminder!

@eregon
Copy link
Member

eregon commented Oct 8, 2021

New PR for grpc, cleaned up and rebased on latest grpc: grpc/grpc#27660

@eregon eregon assigned eregon and unassigned norswap Oct 29, 2021
@eregon
Copy link
Member

eregon commented Jun 28, 2022

The PR to support building the grpc gem on TruffleRuby has been merged.
So I close this issue as it grpc should install fine by the next grpc release.
I will use #2247 to track issues with using grpc at runtime.

@eregon eregon closed this as completed Jun 28, 2022
@eregon eregon added this to the 22.2.0 milestone Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants