Oj: 2.18.4 seems to break during install/compile

Created on 22 Mar 2017  路  14Comments  路  Source: ohler55/oj

Was previously using 2.18.3 with no problems. OSX.

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/vwoo/.gem/ruby/2.4.0/gems/oj-2.18.4/ext/oj
/Users/vwoo/.rubies/ruby-2.4.0/bin/ruby -r ./siteconf20170321-8755-1f362zk.rb extconf.rb
>>>>> Creating Makefile for ruby version 2.4.0 on x86_64-darwin16 <<<<<
creating Makefile

current directory: /Users/vwoo/.gem/ruby/2.4.0/gems/oj-2.18.4/ext/oj
make "DESTDIR=" clean

current directory: /Users/vwoo/.gem/ruby/2.4.0/gems/oj-2.18.4/ext/oj
make "DESTDIR="
compiling cache8.c
compiling circarray.c
compiling compat.c
compiling dump.c
dump.c:570:8: warning: implicit conversion loses integer precision: 'long' to 'int'
[-Wshorten-64-to-32]
        cnt = RSTRING_LEN(rstr);
            ~ ^~~~~~~~~~~~~~~~~
/Users/vwoo/.rubies/ruby-2.4.0/include/ruby-2.4.0/ruby/ruby.h:976:6: note: expanded from macro
'RSTRING_LEN'
     RSTRING_EMBED_LEN(str) : \
     ^~~~~~~~~~~~~~~~~~~~~~
/Users/vwoo/.rubies/ruby-2.4.0/include/ruby-2.4.0/ruby/ruby.h:972:6: note: expanded from macro
'RSTRING_EMBED_LEN'
     (long)((RBASIC(str)->flags >> RSTRING_EMBED_LEN_SHIFT) & \
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dump.c:570:8: warning: implicit conversion loses integer precision: 'long' to 'int'
[-Wshorten-64-to-32]
        cnt = RSTRING_LEN(rstr);
            ~ ^~~~~~~~~~~~~~~~~
/Users/vwoo/.rubies/ruby-2.4.0/include/ruby-2.4.0/ruby/ruby.h:977:28: note: expanded from macro
'RSTRING_LEN'
     RSTRING(str)->as.heap.len)
     ~~~~~~~~~~~~~~~~~~~~~~^~~
dump.c:2035:17: warning: implicit conversion loses integer precision: 'long' to 'int'
[-Wshorten-64-to-32]
            int         len = RSTRING_LEN(v);
                        ~~~   ^~~~~~~~~~~~~~
/Users/vwoo/.rubies/ruby-2.4.0/include/ruby-2.4.0/ruby/ruby.h:976:6: note: expanded from macro
'RSTRING_LEN'
     RSTRING_EMBED_LEN(str) : \
     ^~~~~~~~~~~~~~~~~~~~~~
/Users/vwoo/.rubies/ruby-2.4.0/include/ruby-2.4.0/ruby/ruby.h:972:6: note: expanded from macro
'RSTRING_EMBED_LEN'
     (long)((RBASIC(str)->flags >> RSTRING_EMBED_LEN_SHIFT) & \
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dump.c:2035:17: warning: implicit conversion loses integer precision: 'long' to 'int'
[-Wshorten-64-to-32]
            int         len = RSTRING_LEN(v);
                        ~~~   ^~~~~~~~~~~~~~
/Users/vwoo/.rubies/ruby-2.4.0/include/ruby-2.4.0/ruby/ruby.h:977:28: note: expanded from macro
'RSTRING_LEN'
     RSTRING(str)->as.heap.len)
     ~~~~~~~~~~~~~~~~~~~~~~^~~
4 warnings generated.
compiling dump_custom.c
dump_custom.c:6:10: fatal error: 'dump.h' file not found
#include "dump.h"
         ^
1 error generated.
make: *** [dump_custom.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/vwoo/.gem/ruby/2.4.0/gems/oj-2.18.4 for inspection.
Results logged to
/Users/vwoo/.gem/ruby/2.4.0/extensions/x86_64-darwin-16/2.4.0-static/oj-2.18.4/gem_make.out

An error occurred while installing oj (2.18.4), and Bundler cannot continue.
Make sure that `gem install oj -v '2.18.4'` succeeds before bundling.

Most helpful comment

Possibly. Anyway new release is up. Please check it. I was a pull in a clean environment just to make sure.

All 14 comments

I suspect it is a 2.4.0 issue. I'm checking now.

Works on my Mac. I might need you help getting this working. I'll put something up on GitHub if you don't mind trying with that.

I'm having the same problem (2.4.0 OSX). Where is the dump_custom.c file coming from? Is it supposed to be present? I don't see it in the repository (nor do I see dump.h in either the repo or my local failed build directory).

Those files are only in the rails-combat branch which currently in development.

Same issue here BTW

@ohler55 Hmm. They seem (well, some of them) to be present in whatever came from "gem update". I'll investigate further.

Odd since they are not in the master branch. Maybe I'll bump the version and release again.

@ohler55 I downloaded the .gem file from https://rubygems.org/gems/oj/versions/2.18.4 to verify and dump_custom.c does seem to be present in the archive.

I'll do another release and see if that fixes it. Something odd happened.

https://github.com/ohler55/oj/blob/master/oj.gemspec#L16
(s.files = Dir["{lib,ext,test}/**/*.{rb,h,c}"] + ['LICENSE', 'README.md'])

Indicates that the files packed in the gem at build are based off of whatever exists in the working copy at the time of rake build instead of the default idiom of git ls-files [etc etc reject] so maybe the working copy wasn't clean at the time?

Possibly. Anyway new release is up. Please check it. I was a pull in a clean environment just to make sure.

Successfully installed oj-2.18.5 can confirm it works now. Thanks very much!

Excellent, thanks guys.

2.18.5 installed just fine for me as well. Thanks @ohler55 !

Was this page helpful?
0 / 5 - 0 ratings

Related issues

coconup picture coconup  路  23Comments

michaeldiscala picture michaeldiscala  路  9Comments

gerrywastaken picture gerrywastaken  路  36Comments

dgollahon picture dgollahon  路  5Comments

orien picture orien  路  18Comments