Skip to content

Error when building native extension #2

@chanks

Description

@chanks

Hi -

Super excited for this faster parser, but I'm running into a problem when I try to install it. This may have been my own error, since I don't know a ton about C, but I managed to make and install libgraphqlparser without any apparent issue, so I'm not sure what the problem is. This is on Linux Mint, btw.

$ gem install graphql-libgraphqlparser -v '0.1.3'
Building native extensions.  This could take a while...
ERROR:  Error installing graphql-libgraphqlparser:
    ERROR: Failed to build gem native extension.

    current directory: /home/chris/.rvm/gems/ruby-2.3.0/gems/graphql-libgraphqlparser-0.1.3/ext/libgraphqlparser
/home/chris/.rvm/rubies/ruby-2.3.0/bin/ruby -r ./siteconf20160307-19445-1ux8w1r.rb extconf.rb
checking for main() in -lgraphqlparser... yes
creating Makefile

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

  /home/chris/.rvm/gems/ruby-2.3.0/extensions/x86_64-linux/2.3.0/graphql-libgraphqlparser-0.1.3/mkmf.log

current directory: /home/chris/.rvm/gems/ruby-2.3.0/gems/graphql-libgraphqlparser-0.1.3/ext/libgraphqlparser
make "DESTDIR=" clean

current directory: /home/chris/.rvm/gems/ruby-2.3.0/gems/graphql-libgraphqlparser-0.1.3/ext/libgraphqlparser
make "DESTDIR="
compiling libgraphqlparser.c
compiling visitor_functions.c
visitor_functions.c: In function ‘enum_value_begin_visit’:
visitor_functions.c:281:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
   const char* str_value = GraphQLAstEnumValue_get_value(node);
   ^
linking shared-object libgraphqlparser.so
./libgraphqlparser.so: file not recognized: File truncated
collect2: error: ld returned 1 exit status
make: *** [libgraphqlparser.so] Error 1

make failed, exit code 2

Gem files will remain installed in /home/chris/.rvm/gems/ruby-2.3.0/gems/graphql-libgraphqlparser-0.1.3 for inspection.
Results logged to /home/chris/.rvm/gems/ruby-2.3.0/extensions/x86_64-linux/2.3.0/graphql-libgraphqlparser-0.1.3/gem_make.out

The log it directs me to reads:

$ cat /home/chris/.rvm/gems/ruby-2.3.0/extensions/x86_64-linux/2.3.0/graphql-libgraphqlparser-0.1.3/mkmf.log
have_library: checking for main() in -lgraphqlparser... -------------------- yes

"gcc -o conftest -I/home/chris/.rvm/rubies/ruby-2.3.0/include/ruby-2.3.0/x86_64-linux -I/home/chris/.rvm/rubies/ruby-2.3.0/include/ruby-2.3.0/ruby/backward -I/home/chris/.rvm/rubies/ruby-2.3.0/include/ruby-2.3.0 -I. -I/usr/local/include/graphqlparser     -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat  -fPIC conftest.c  -L. -L/home/chris/.rvm/rubies/ruby-2.3.0/lib -Wl,-R/home/chris/.rvm/rubies/ruby-2.3.0/lib -L/usr/local/lib -Wl,-R/usr/local/lib -L. -fstack-protector -rdynamic -Wl,-export-dynamic     -Wl,-R/home/chris/.rvm/rubies/ruby-2.3.0/lib -L/home/chris/.rvm/rubies/ruby-2.3.0/lib -lruby  -lpthread -ldl -lcrypt -lm   -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

"gcc -o conftest -I/home/chris/.rvm/rubies/ruby-2.3.0/include/ruby-2.3.0/x86_64-linux -I/home/chris/.rvm/rubies/ruby-2.3.0/include/ruby-2.3.0/ruby/backward -I/home/chris/.rvm/rubies/ruby-2.3.0/include/ruby-2.3.0 -I. -I/usr/local/include/graphqlparser     -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -Wdeprecated-declarations -Wno-packed-bitfield-compat  -fPIC conftest.c  -L. -L/home/chris/.rvm/rubies/ruby-2.3.0/lib -Wl,-R/home/chris/.rvm/rubies/ruby-2.3.0/lib -L/usr/local/lib -Wl,-R/usr/local/lib -L. -fstack-protector -rdynamic -Wl,-export-dynamic     -Wl,-R/home/chris/.rvm/rubies/ruby-2.3.0/lib -L/home/chris/.rvm/rubies/ruby-2.3.0/lib -lruby -lgraphqlparser  -lpthread -ldl -lcrypt -lm   -lc"
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: /*top*/
 4: extern int t(void);
 5: int main(int argc, char **argv)
 6: {
 7:   if (argc > 1000000) {
 8:     printf("%p", &t);
 9:   }
10: 
11:   return 0;
12: }
13: int t(void) { void ((*volatile p)()); p = (void ((*)()))main; return !p; }
/* end */

--------------------

If anyone has some advice on where to look or what to try, it'd be much appreciated.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions