cloocher / xmlhasher

Fast XML to Ruby Hash converter
MIT License
40 stars 21 forks source link

ERROR: Failed to build gem native extension #12

Closed arloan closed 6 years ago

arloan commented 6 years ago

Most recent commit changed ox version to 2.2.1, which will not compile on my system:

macOS Seirra 10.12.6
MRI ruby 2.4.3p205 (2017-12-14 revision 61247) [x86_64-darwin16]

compiling error occurs here:

obj_load.c:759:31: error: read-only variable is not assignable
                    RSTRUCT_PTR(ph->obj)[0] = h->obj;
                    ~~~~~~~~~~~~~~~~~~~~~~~ ^

Full build log:

stone$ gem install -N xmlhasher
Fetching: ox-2.2.1.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing xmlhasher:
    ERROR: Failed to build gem native extension.

    current directory: /usr/local/lib/ruby/gems/2.4.0/gems/ox-2.2.1/ext/ox
/usr/local/opt/ruby/bin/ruby -r ./siteconf20180816-73900-1rnv8x2.rb extconf.rb
>>>>> Creating Makefile for ruby version 2.4.3 on x86_64-darwin16 <<<<<
creating Makefile

current directory: /usr/local/lib/ruby/gems/2.4.0/gems/ox-2.2.1/ext/ox
make "DESTDIR=" clean

current directory: /usr/local/lib/ruby/gems/2.4.0/gems/ox-2.2.1/ext/ox
make "DESTDIR="
compiling base64.c
compiling cache.c
cache.c:30:25: warning: implicit conversion from 'int' to 'char' changes value from 255 to -1 [-Wconstant-conversion]
    *d = (255 <= len) ? 255 : len;
       ~                ^~~
1 warning generated.
compiling cache8.c
compiling cache8_test.c
compiling cache_test.c
compiling dump.c
dump.c:747:18: warning: 'rb_struct_ptr' is deprecated [-Wdeprecated-declarations]
            VALUE       beg = RSTRUCT_PTR(obj)[0];
                              ^
/usr/local/Cellar/ruby/2.4.3_1/include/ruby-2.4.0/ruby/ruby.h:1194:33: note: expanded from macro 'RSTRUCT_PTR'
#define RSTRUCT_PTR(st)         rb_struct_ptr(st)
                                ^
/usr/local/Cellar/ruby/2.4.3_1/include/ruby-2.4.0/ruby/intern.h:889:1: note: 'rb_struct_ptr' has been explicitly marked deprecated here
DEPRECATED(const VALUE *rb_struct_ptr(VALUE s));
^
/usr/local/Cellar/ruby/2.4.3_1/include/ruby-2.4.0/x86_64-darwin16/ruby/config.h:124:39: note: expanded from macro 'DEPRECATED'
#define DEPRECATED(x) __attribute__ ((__deprecated__)) x
                                      ^
dump.c:748:18: warning: 'rb_struct_ptr' is deprecated [-Wdeprecated-declarations]
            VALUE       end = RSTRUCT_PTR(obj)[1];
                              ^
/usr/local/Cellar/ruby/2.4.3_1/include/ruby-2.4.0/ruby/ruby.h:1194:33: note: expanded from macro 'RSTRUCT_PTR'
#define RSTRUCT_PTR(st)         rb_struct_ptr(st)
                                ^
/usr/local/Cellar/ruby/2.4.3_1/include/ruby-2.4.0/ruby/intern.h:889:1: note: 'rb_struct_ptr' has been explicitly marked deprecated here
DEPRECATED(const VALUE *rb_struct_ptr(VALUE s));
^
/usr/local/Cellar/ruby/2.4.3_1/include/ruby-2.4.0/x86_64-darwin16/ruby/config.h:124:39: note: expanded from macro 'DEPRECATED'
#define DEPRECATED(x) __attribute__ ((__deprecated__)) x
                                      ^
dump.c:749:19: warning: 'rb_struct_ptr' is deprecated [-Wdeprecated-declarations]
            VALUE       excl = RSTRUCT_PTR(obj)[2];
                               ^
/usr/local/Cellar/ruby/2.4.3_1/include/ruby-2.4.0/ruby/ruby.h:1194:33: note: expanded from macro 'RSTRUCT_PTR'
#define RSTRUCT_PTR(st)         rb_struct_ptr(st)
                                ^
/usr/local/Cellar/ruby/2.4.3_1/include/ruby-2.4.0/ruby/intern.h:889:1: note: 'rb_struct_ptr' has been explicitly marked deprecated here
DEPRECATED(const VALUE *rb_struct_ptr(VALUE s));
^
/usr/local/Cellar/ruby/2.4.3_1/include/ruby-2.4.0/x86_64-darwin16/ruby/config.h:124:39: note: expanded from macro 'DEPRECATED'
#define DEPRECATED(x) __attribute__ ((__deprecated__)) x
                                      ^
dump.c:769:23: warning: 'rb_struct_ptr' is deprecated [-Wdeprecated-declarations]
            for (i = 0, vp = RSTRUCT_PTR(obj); i < cnt; i++, vp++) {
                             ^
/usr/local/Cellar/ruby/2.4.3_1/include/ruby-2.4.0/ruby/ruby.h:1194:33: note: expanded from macro 'RSTRUCT_PTR'
#define RSTRUCT_PTR(st)         rb_struct_ptr(st)
                                ^
/usr/local/Cellar/ruby/2.4.3_1/include/ruby-2.4.0/ruby/intern.h:889:1: note: 'rb_struct_ptr' has been explicitly marked deprecated here
DEPRECATED(const VALUE *rb_struct_ptr(VALUE s));
^
/usr/local/Cellar/ruby/2.4.3_1/include/ruby-2.4.0/x86_64-darwin16/ruby/config.h:124:39: note: expanded from macro 'DEPRECATED'
#define DEPRECATED(x) __attribute__ ((__deprecated__)) x
                                      ^
dump.c:769:21: warning: assigning to 'VALUE *' (aka 'unsigned long *') from 'const VALUE *' (aka 'const unsigned long *') discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
            for (i = 0, vp = RSTRUCT_PTR(obj); i < cnt; i++, vp++) {
                           ^ ~~~~~~~~~~~~~~~~
5 warnings generated.
compiling err.c
compiling gen_load.c
compiling obj_load.c
obj_load.c:759:7: warning: 'rb_struct_ptr' is deprecated [-Wdeprecated-declarations]
                    RSTRUCT_PTR(ph->obj)[0] = h->obj;
                    ^
/usr/local/Cellar/ruby/2.4.3_1/include/ruby-2.4.0/ruby/ruby.h:1194:33: note: expanded from macro 'RSTRUCT_PTR'
#define RSTRUCT_PTR(st)         rb_struct_ptr(st)
                                ^
/usr/local/Cellar/ruby/2.4.3_1/include/ruby-2.4.0/ruby/intern.h:889:1: note: 'rb_struct_ptr' has been explicitly marked deprecated here
DEPRECATED(const VALUE *rb_struct_ptr(VALUE s));
^
/usr/local/Cellar/ruby/2.4.3_1/include/ruby-2.4.0/x86_64-darwin16/ruby/config.h:124:39: note: expanded from macro 'DEPRECATED'
#define DEPRECATED(x) __attribute__ ((__deprecated__)) x
                                      ^
obj_load.c:759:31: error: read-only variable is not assignable
                    RSTRUCT_PTR(ph->obj)[0] = h->obj;
                    ~~~~~~~~~~~~~~~~~~~~~~~ ^
obj_load.c:761:7: warning: 'rb_struct_ptr' is deprecated [-Wdeprecated-declarations]
                    RSTRUCT_PTR(ph->obj)[1] = h->obj;
                    ^
/usr/local/Cellar/ruby/2.4.3_1/include/ruby-2.4.0/ruby/ruby.h:1194:33: note: expanded from macro 'RSTRUCT_PTR'
#define RSTRUCT_PTR(st)         rb_struct_ptr(st)
                                ^
/usr/local/Cellar/ruby/2.4.3_1/include/ruby-2.4.0/ruby/intern.h:889:1: note: 'rb_struct_ptr' has been explicitly marked deprecated here
DEPRECATED(const VALUE *rb_struct_ptr(VALUE s));
^
/usr/local/Cellar/ruby/2.4.3_1/include/ruby-2.4.0/x86_64-darwin16/ruby/config.h:124:39: note: expanded from macro 'DEPRECATED'
#define DEPRECATED(x) __attribute__ ((__deprecated__)) x
                                      ^
obj_load.c:761:31: error: read-only variable is not assignable
                    RSTRUCT_PTR(ph->obj)[1] = h->obj;
                    ~~~~~~~~~~~~~~~~~~~~~~~ ^
obj_load.c:763:7: warning: 'rb_struct_ptr' is deprecated [-Wdeprecated-declarations]
                    RSTRUCT_PTR(ph->obj)[2] = h->obj;
                    ^
/usr/local/Cellar/ruby/2.4.3_1/include/ruby-2.4.0/ruby/ruby.h:1194:33: note: expanded from macro 'RSTRUCT_PTR'
#define RSTRUCT_PTR(st)         rb_struct_ptr(st)
                                ^
/usr/local/Cellar/ruby/2.4.3_1/include/ruby-2.4.0/ruby/intern.h:889:1: note: 'rb_struct_ptr' has been explicitly marked deprecated here
DEPRECATED(const VALUE *rb_struct_ptr(VALUE s));
^
/usr/local/Cellar/ruby/2.4.3_1/include/ruby-2.4.0/x86_64-darwin16/ruby/config.h:124:39: note: expanded from macro 'DEPRECATED'
#define DEPRECATED(x) __attribute__ ((__deprecated__)) x
                                      ^
obj_load.c:763:31: error: read-only variable is not assignable
                    RSTRUCT_PTR(ph->obj)[2] = h->obj;
                    ~~~~~~~~~~~~~~~~~~~~~~~ ^
3 warnings and 3 errors generated.
make: *** [obj_load.o] Error 1

make failed, exit code 2

Gem files will remain installed in /usr/local/lib/ruby/gems/2.4.0/gems/ox-2.2.1 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.4.0/extensions/x86_64-darwin-16/2.4.0/ox-2.2.1/gem_make.out
cloocher commented 6 years ago

upgraded to latest ox 2.10