Giter Site home page Giter Site logo

ruby-unf_ext's Issues

Failing to compile on macOS/Ruby 2.7.1 but not sure why

This is what I have in my logs for installing unf_ext. I'm not sure why this isn't working, it seems to be pointing to a source-code issue only, not failing to find other files, etc

If I can provide any other information, please let me know.

Installing unf_ext 0.0.7.7 (was 0.0.7.6) with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/Csuhta/.gem/ruby/2.7.1/gems/unf_ext-0.0.7.7/ext/unf_ext
/Users/Csuhta/.rubies/ruby-2.7.1/bin/ruby -I /Users/Csuhta/.rubies/ruby-2.7.1/lib/ruby/2.7.0 -r ./siteconf20200401-85002-qhwila.rb extconf.rb
checking for -lstdc++... yes
creating Makefile

current directory: /Users/Csuhta/.gem/ruby/2.7.1/gems/unf_ext-0.0.7.7/ext/unf_ext
make "DESTDIR=" clean

current directory: /Users/Csuhta/.gem/ruby/2.7.1/gems/unf_ext-0.0.7.7/ext/unf_ext
make "DESTDIR="
compiling unf.cc
In file included from unf.cc:3:
In file included from /Users/Csuhta/.rubies/ruby-2.7.1/include/ruby-2.7.0/ruby.h:33:
In file included from /Users/Csuhta/.rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/ruby.h:29:
In file included from /Users/Csuhta/.rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/defines.h:171:
In file included from /Users/Csuhta/.rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/missing.h:25:
/usr/local/include/jemalloc/jemalloc.h:226:28: error: exception specification in declaration does not match previous declaration
    void JEMALLOC_NOTHROW       *je_malloc(size_t size)
                                 ^
/usr/local/include/jemalloc/jemalloc.h:69:21: note: expanded from macro 'je_malloc'
#  define je_malloc malloc
                    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h:40:7: note: previous declaration is here
void    *malloc(size_t __size) __result_use_check __alloc_size(1);
         ^
In file included from unf.cc:3:
In file included from /Users/Csuhta/.rubies/ruby-2.7.1/include/ruby-2.7.0/ruby.h:33:
In file included from /Users/Csuhta/.rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/ruby.h:29:
In file included from /Users/Csuhta/.rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/defines.h:171:
In file included from /Users/Csuhta/.rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/missing.h:25:
/usr/local/include/jemalloc/jemalloc.h:229:28: error: exception specification in declaration does not match previous declaration
    void JEMALLOC_NOTHROW       *je_calloc(size_t num, size_t size)
                                 ^
/usr/local/include/jemalloc/jemalloc.h:63:21: note: expanded from macro 'je_calloc'
#  define je_calloc calloc
                    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h:41:7: note: previous declaration is here
void    *calloc(size_t __count, size_t __size) __result_use_check __alloc_size(1,2);
         ^
In file included from unf.cc:3:
In file included from /Users/Csuhta/.rubies/ruby-2.7.1/include/ruby-2.7.0/ruby.h:33:
In file included from /Users/Csuhta/.rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/ruby.h:29:
In file included from /Users/Csuhta/.rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/defines.h:171:
In file included from /Users/Csuhta/.rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/missing.h:25:
/usr/local/include/jemalloc/jemalloc.h:231:38: error: exception specification in declaration does not match previous declaration
JEMALLOC_EXPORT int JEMALLOC_NOTHROW    je_posix_memalign(void **memptr,
                                        ^
/usr/local/include/jemalloc/jemalloc.h:77:29: note: expanded from macro 'je_posix_memalign'
#  define je_posix_memalign posix_memalign
                            ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h:52:7: note: previous declaration is here
int      posix_memalign(void **__memptr, size_t __alignment, size_t __size) __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_0);
         ^
In file included from unf.cc:3:
In file included from /Users/Csuhta/.rubies/ruby-2.7.1/include/ruby-2.7.0/ruby.h:33:
In file included from /Users/Csuhta/.rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/ruby.h:29:
In file included from /Users/Csuhta/.rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/defines.h:171:
In file included from /Users/Csuhta/.rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/missing.h:25:
/usr/local/include/jemalloc/jemalloc.h:238:28: error: exception specification in declaration does not match previous declaration
    void JEMALLOC_NOTHROW       *je_realloc(void *ptr, size_t size)
                                 ^
/usr/local/include/jemalloc/jemalloc.h:79:22: note: expanded from macro 'je_realloc'
#  define je_realloc realloc
                     ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h:43:7: note: previous declaration is here
void    *realloc(void *__ptr, size_t __size) __result_use_check __alloc_size(2);
         ^
In file included from unf.cc:3:
In file included from /Users/Csuhta/.rubies/ruby-2.7.1/include/ruby-2.7.0/ruby.h:33:
In file included from /Users/Csuhta/.rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/ruby.h:29:
In file included from /Users/Csuhta/.rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/defines.h:171:
In file included from /Users/Csuhta/.rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/missing.h:25:
/usr/local/include/jemalloc/jemalloc.h:240:39: error: exception specification in declaration does not match previous declaration
JEMALLOC_EXPORT void JEMALLOC_NOTHROW   je_free(void *ptr)
                                        ^
/usr/local/include/jemalloc/jemalloc.h:65:19: note: expanded from macro 'je_free'
#  define je_free free
                  ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h:42:7: note: previous declaration is here
void     free(void *);
         ^
In file included from unf.cc:3:
In file included from /Users/Csuhta/.rubies/ruby-2.7.1/include/ruby-2.7.0/ruby.h:33:
In file included from /Users/Csuhta/.rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/ruby.h:29:
In file included from /Users/Csuhta/.rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/defines.h:171:
In file included from /Users/Csuhta/.rubies/ruby-2.7.1/include/ruby-2.7.0/ruby/missing.h:25:
/usr/local/include/jemalloc/jemalloc.h:279:28: error: exception specification in declaration does not match previous declaration
    void JEMALLOC_NOTHROW       *je_valloc(size_t size) JEMALLOC_CXX_THROW
                                 ^
/usr/local/include/jemalloc/jemalloc.h:83:21: note: expanded from macro 'je_valloc'
#  define je_valloc valloc
                    ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:735:7: note: previous declaration is here
void    *valloc(size_t);                        
         ^
6 errors generated.
make: *** [unf.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/Csuhta/.gem/ruby/2.7.1/gems/unf_ext-0.0.7.7 for inspection.
Results logged to /Users/Csuhta/.gem/ruby/2.7.1/extensions/x86_64-darwin-19/2.7.0-static/unf_ext-0.0.7.7/gem_make.out

An error occurred while installing unf_ext (0.0.7.7), and Bundler cannot continue.
Make sure that `gem install unf_ext -v '0.0.7.7' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  discordrb was resolved to 3.3.0, which depends on
    discordrb-webhooks was resolved to 3.3.0, which depends on
      rest-client was resolved to 2.1.0, which depends on
        http-cookie was resolved to 1.0.3, which depends on
          domain_name was resolved to 0.5.20190701, which depends on
            unf was resolved to 0.1.4, which depends on
              unf_ext

invalid compile options unf_ext 0.0.7.5

Trying to install unf_ext on amazon linux with g++ version 4.8.5, but the Makefile that gets created has compiler options that are not valid. How do I get around this issue?

$ g++ --version
g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11)

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

current directory: /usr/local/rvm/gems/ruby-2.5.1@learning-api/gems/unf_ext-0.0.7.5/ext/unf_ext

/usr/local/rvm/rubies/ruby-2.5.1/bin/ruby -r ./siteconf20180426-16315-546h8p.rb extconf.rb
checking for -lstdc++... yes
creating Makefile

current directory: /usr/local/rvm/gems/ruby-2.5.1@learning-api/gems/unf_ext-0.0.7.5/ext/unf_ext
make "DESTDIR=" clean

current directory: /usr/local/rvm/gems/ruby-2.5.1@learning-api/gems/unf_ext-0.0.7.5/ext/unf_ext
make "DESTDIR="
compiling unf.cc
g++: error: unrecognized command line option ‘-Wmisleading-indentation’
g++: error: unrecognized command line option ‘-Wimplicit-fallthrough=0’
g++: error: unrecognized command line option ‘-Wduplicated-cond’
g++: error: unrecognized command line option ‘-Wrestrict’
make: *** [unf.o] Error 1

make failed, exit code 2

Gem files will remain installed in /usr/local/rvm/gems/ruby-2.5.1@learning-api/gems/unf_ext-0.0.7.5 for inspection.
Results logged to /usr/local/rvm/gems/ruby-2.5.1@learning-api/extensions/x86_64-linux/2.5.0/unf_ext-0.0.7.5/gem_make.out

0.0.6 build fails for ruby 1.8.7 with gcc 4.8.2

I've been unable to build 0.0.6 (or any earlier version) on Fedora 20 for ruby 1.8.7 with gcc 4.8.2. gcc 4.8.2 + ruby 2.0.0 builds as expected. I used a Gentoo box and was able to get 0.0.6 to build for ruby 1.8.7 using gcc 4.7.2.

gcc version (fedora 20):

$ gcc -v
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.2/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-isl=/builddir/build/BUILD/gcc-4.8.2-20131212/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.2-20131212/obj-x86_64-redhat-linux/cloog-install --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.2 20131212 (Red Hat 4.8.2-7) (GCC) 

Build error:

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /home/jhoblitt/.rvm/rubies/ruby-1.8.7-p374/bin/ruby extconf.rb 
checking for main() in -lstdc++... yes
checking for ruby/encoding.h... yes
creating Makefile
CXX is automatically set to g++

make
g++ -I. -I. -I/home/jhoblitt/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/1.8/x86_64-linux -I. -DHAVE_RUBY_ENCODING_H    -fPIC -O2 -fno-tree-dce -fno-optimize-sibling-calls  -fPIC    -c unf.cc
In file included from unf.cc:5:0:
/usr/include/ruby/encoding.h:102:68: error: expected identifier before numeric constant
 PRINTF_ARGS(VALUE rb_enc_sprintf(rb_encoding *, const char*, ...), 2, 3);
                                                                    ^
/usr/include/ruby/encoding.h:102:68: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/ruby/encoding.h:102:73: error: expected constructor, destructor, or type conversion before ‘;’ token
 PRINTF_ARGS(VALUE rb_enc_sprintf(rb_encoding *, const char*, ...), 2, 3);
                                                                         ^
/usr/include/ruby/encoding.h:115:99: error: expected identifier before numeric constant
 PRINTF_ARGS(NORETURN(void rb_enc_raise(rb_encoding *, VALUE, const char*, ...)), 3, 4);
                                                                                                   ^
/usr/include/ruby/encoding.h:115:99: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/ruby/encoding.h:115:104: error: expected constructor, destructor, or type conversion before ‘;’ token
 PRINTF_ARGS(NORETURN(void rb_enc_raise(rb_encoding *, VALUE, const char*, ...)), 3, 4);
                                                                                                        ^
In file included from unf.cc:5:0:
/usr/include/ruby/encoding.h:216:65: error: declaration of C function ‘long int rb_memsearch(const void*, long int, const void*, long int, rb_encoding*)’ conflicts with
 long rb_memsearch(const void*,long,const void*,long,rb_encoding*);
                                                                 ^
In file included from /home/jhoblitt/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/1.8/x86_64-linux/ruby.h:756:0,
                 from unf.cc:3:
/home/jhoblitt/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/1.8/x86_64-linux/intern.h:387:6: error: previous declaration ‘long int rb_memsearch(const void*, long int, const void*, long int)’ here
 long rb_memsearch _((const void*,long,const void*,long));
      ^
make: *** [unf.o] Error 1


Gem files will remain installed in /home/jhoblitt/github/puppetlabs-concat/.bundle/ruby/1.8/gems/unf_ext-0.0.6 for inspection.
Results logged to /home/jhoblitt/github/puppetlabs-concat/.bundle/ruby/1.8/gems/unf_ext-0.0.6/ext/unf_ext/gem_make.out
An error occurred while installing unf_ext (0.0.6), and Bundler cannot continue.
Make sure that `gem install unf_ext -v '0.0.6'` succeeds before bundling.

update to support ruby 3.0

unf_ext-0.0.7.7-x64-mingw32 requires ruby version >= 2.2, < 2.8.dev, which is
incompatible with the current version, ruby 3.0.0p0

0.0.7.2 fails to build on arm with gcc 6.3.0

i try installing in raspberry pi
and get:

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

unf/table.hh:13539:25: error: narrowing conversion of ‘-113’ from ‘int’ to ‘char’ inside { } [Wnarrowing] unf/table.hh:13539:25: error: narrowing conversion of ‘-81’ from ‘int’ to ‘char’ inside { } [-Wnarrowing] unf/table.hh:13539:25: error: narrowing conversion of ‘-27’ from ‘int’ to ‘char’ inside { } [-Wnarrowing] unf/table.hh:13539:25: error: narrowing conversion of ‘-66’ from ‘int’ to ‘char’ inside { } [-Wnarrowing] unf/table.hh:13539:25: error: narrowing conversion of ‘-105’ from ‘int’ to ‘char’ inside { } [-Wnarrowing] unf/table.hh:13539:25: error: narrowing conversion of ‘-27’ from ‘int’ to ‘char’ inside { } [-Wnarrowing] unf/table.hh:13539:25: error: narrowing conversion of ‘-106’ from ‘int’ to ‘char’ inside { } [-Wnarrowing]

Ruby version: ruby 2.1.5p273 (2014-11-13 revision 48405) [armv7l-linux-eabihf]
Bundler version: Bundler version 1.16.0 (2017-10-31 commit 10f20fa33)

Failed to build gem native extension OSX 10.10.3

running:

gem install unf_ext -v '0.0.7.1'

results in the following error

ERROR:  Error installing unf_ext:
ERROR: Failed to build gem native extension.

[snip]/rubies/ruby-1.9.3-p547/bin/ruby extconf.rb checking for main() in -lstdc++...     *** 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.

The stack trace is:

[snip]/.rvm/rubies/ruby-1.9.3-p547/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from [snip]/.rvm/rubies/ruby-1.9.3-p547/lib/ruby/1.9.1/mkmf.rb:461:in `try_link0'
from [snip]/.rvm/rubies/ruby-1.9.3-p547/lib/ruby/1.9.1/mkmf.rb:476:in `try_link'
from [snip]/.rvm/rubies/ruby-1.9.3-p547/lib/ruby/1.9.1/mkmf.rb:619:in `try_func'
from [snip]/.rvm/rubies/ruby-1.9.3-p547/lib/ruby/1.9.1/mkmf.rb:845:in `block in have_library'
from [snip]/.rvm/rubies/ruby-1.9.3-p547/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
from [snip]/.rvm/rubies/ruby-1.9.3-p547/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
from [snip]/.rvm/rubies/ruby-1.9.3-p547/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from [snip]/.rvm/rubies/ruby-1.9.3-p547/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
from [snip]/.rvm/rubies/ruby-1.9.3-p547/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from [snip]/.rvm/rubies/ruby-1.9.3-p547/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
from [snip]/.rvm/rubies/ruby-1.9.3-p547/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
from [snip]/.rvm/rubies/ruby-1.9.3-p547/lib/ruby/1.9.1/mkmf.rb:840:in `have_library'
from extconf.rb:6:in `<main>'

A number of similar issues discuss installing different versions of command line tools. I downgraded to 6.2 and then reupgraded to 6.3 and 6.3.1 with no change.

My xcode-select version is 2339, and I just did a complete install of xcode 6.3.1 with no change.

Failing to build on ARM64 Linux (Apple M1 running Debian in a VM)

This is probably quite a niche request, but i'm trying to set up a development env on my new M1 Mac - we use Vagrant, which is not yet fully supported / working, so i'm doing a bit of a DIY Vagrant box using Debian for ARM64.

The compile is failing with multiple errors about narrowing conversion, e.g.

unf/table.hh:13539:25: error: narrowing conversion of '-40' from 'int' to 'char' inside { } [-Wnarrowing]
unf/table.hh:13539:25: error: narrowing conversion of '-77' from 'int' to 'char' inside { } [-Wnarrowing]
unf/table.hh:13539:25: error: narrowing conversion of '-39' from 'int' to 'char' inside { } [-Wnarrowing]

Switching the compiler to clang just renders the same error slightly differently:

./unf/table.hh:6301:6: error: constant expression evaluates to -113 which cannot
      be narrowed to type 'char' [-Wc++11-narrowing]
 -27,-113, -81, -27, -66,-105, -27,-106, -74, -25,-108, -77, -26, -70,-1...
     ^~~~
./unf/table.hh:6301:6: note: insert an explicit cast to silence this issue
 -27,-113, -81, -27, -66,-105, -27,-106, -74, -25,-108, -77, -26, -70,-1...
     ^~~~
     static_cast<char>( )

The clang compiler at least suggests than an explicit cast might help, but i'm not sure if thats the case?

Can't install 0.0.8.2 on Windows

Our build system picked up the new version of the gem today and immediately blows up on Windows with the following output:

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

current directory:
C:/opscode/chef/embedded/lib/ruby/gems/3.0.0/gems/unf_ext-0.0.8.2/ext/unf_ext
C:/opscode/chef/embedded/bin/ruby.exe -I C:/opscode/chef/embedded/lib/ruby/3.0.0
-r ./siteconf20220526-[492](https://github.com/chef/chef/runs/6603559553?check_suite_focus=true#step:5:493)4-poz92f.rb extconf.rb
checking for -lstdc++... yes
creating Makefile

current directory:
C:/opscode/chef/embedded/lib/ruby/gems/3.0.0/gems/unf_ext-0.0.8.2/ext/unf_ext
make DESTDIR\= clean

current directory:
C:/opscode/chef/embedded/lib/ruby/gems/3.0.0/gems/unf_ext-0.0.8.2/ext/unf_ext
make DESTDIR\=
generating unf_ext-x64-mingw32.def
compiling unf.cc
In file included from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/internal/anyargs.h:83:0,
from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/ruby.h:24,
                 from c:/opscode/chef/embedded/include/ruby-3.0.0/ruby.h:38,
                 from unf.cc:3:
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp:98:69:
error: 'std::nullptr_t' has not been declared
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp: In
function 'void ruby::backward::cxxanyargs::rb_define_virtual_variable(const
char*, VALUE (*)(ID, VALUE*), int)':
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp:100:41:
error: invalid conversion from 'int' to 'void (*)(VALUE, ID, VALUE*) {aka void
(*)(long long unsigned int, long long unsigned int, long long unsigned int*)}'
[-fpermissive]
In file included from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp:24:0,
from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/internal/anyargs.h:83,
from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/ruby.h:24,
                 from c:/opscode/chef/embedded/include/ruby-3.0.0/ruby.h:38,
                 from unf.cc:3:
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/internal/variable.h:49:6:
error:   initializing argument 3 of 'void rb_define_virtual_variable(const
char*, VALUE (*)(ID, VALUE*), void (*)(VALUE, ID, VALUE*))' [-fpermissive]
In file included from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/internal/anyargs.h:83:0,
from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/ruby.h:24,
                 from c:/opscode/chef/embedded/include/ruby-3.0.0/ruby.h:38,
                 from unf.cc:3:
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp: At
global scope:
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp:105:57:
error: 'std::nullptr_t' has not been declared
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp: In
function 'void ruby::backward::cxxanyargs::rb_define_virtual_variable(const
char*, VALUE (*)(...), int)':
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp:108:41:
error: invalid conversion from 'int' to 'void (*)(VALUE, ID, VALUE*) {aka void
(*)(long long unsigned int, long long unsigned int, long long unsigned int*)}'
[-fpermissive]
In file included from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp:24:0,
from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/internal/anyargs.h:83,
from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/ruby.h:24,
                 from c:/opscode/chef/embedded/include/ruby-3.0.0/ruby.h:38,
                 from unf.cc:3:
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/internal/variable.h:49:6:
error:   initializing argument 3 of 'void rb_define_virtual_variable(const
char*, VALUE (*)(ID, VALUE*), void (*)(VALUE, ID, VALUE*))' [-fpermissive]
In file included from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/internal/anyargs.h:83:0,
from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/ruby.h:24,
                 from c:/opscode/chef/embedded/include/ruby-3.0.0/ruby.h:38,
                 from unf.cc:3:
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp: At
global scope:
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp:112:48:
error: 'std::nullptr_t' has not been declared
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp: In
function 'void ruby::backward::cxxanyargs::rb_define_virtual_variable(const
char*, int, void (*)(VALUE, ID, VALUE*))':
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp:114:41:
error: invalid conversion from 'int' to 'VALUE (*)(ID, VALUE*) {aka long long
unsigned int (*)(long long unsigned int, long long unsigned int*)}'
[-fpermissive]
In file included from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp:24:0,
from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/internal/anyargs.h:83,
from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/ruby.h:24,
                 from c:/opscode/chef/embedded/include/ruby-3.0.0/ruby.h:38,
                 from unf.cc:3:
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/internal/variable.h:49:6:
error:   initializing argument 2 of 'void rb_define_virtual_variable(const
char*, VALUE (*)(ID, VALUE*), void (*)(VALUE, ID, VALUE*))' [-fpermissive]
In file included from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/internal/anyargs.h:83:0,
from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/ruby.h:24,
                 from c:/opscode/chef/embedded/include/ruby-3.0.0/ruby.h:38,
                 from unf.cc:3:
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp: At
global scope:
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp:119:48:
error: 'std::nullptr_t' has not been declared
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp: In
function 'void ruby::backward::cxxanyargs::rb_define_virtual_variable(const
char*, int, void (*)(...))':
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp:122:41:
error: invalid conversion from 'int' to 'VALUE (*)(ID, VALUE*) {aka long long
unsigned int (*)(long long unsigned int, long long unsigned int*)}'
[-fpermissive]
In file included from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp:24:0,
from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/internal/anyargs.h:83,
from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/ruby.h:24,
                 from c:/opscode/chef/embedded/include/ruby-3.0.0/ruby.h:38,
                 from unf.cc:3:
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/internal/variable.h:49:6:
error:   initializing argument 2 of 'void rb_define_virtual_variable(const
char*, VALUE (*)(ID, VALUE*), void (*)(VALUE, ID, VALUE*))' [-fpermissive]
In file included from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/internal/anyargs.h:83:0,
from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/ruby.h:24,
                 from c:/opscode/chef/embedded/include/ruby-3.0.0/ruby.h:38,
                 from unf.cc:3:
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp: At
global scope:
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp:161:78:
error: 'std::nullptr_t' has not been declared
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp: In
function 'void ruby::backward::cxxanyargs::rb_define_hooked_variable(const
char*, VALUE*, VALUE (*)(ID, VALUE*), int)':
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp:163:43:
error: invalid conversion from 'int' to 'void (*)(VALUE, ID, VALUE*) {aka void
(*)(long long unsigned int, long long unsigned int, long long unsigned int*)}'
[-fpermissive]
In file included from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp:24:0,
from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/internal/anyargs.h:83,
from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/ruby.h:24,
                 from c:/opscode/chef/embedded/include/ruby-3.0.0/ruby.h:38,
                 from unf.cc:3:
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/internal/variable.h:50:6:
error:   initializing argument 4 of 'void rb_define_hooked_variable(const char*,
VALUE*, VALUE (*)(ID, VALUE*), void (*)(VALUE, ID, VALUE*))' [-fpermissive]
In file included from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/internal/anyargs.h:83:0,
from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/ruby.h:24,
                 from c:/opscode/chef/embedded/include/ruby-3.0.0/ruby.h:38,
                 from unf.cc:3:
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp: At
global scope:
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp:168:66:
error: 'std::nullptr_t' has not been declared
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp: In
function 'void ruby::backward::cxxanyargs::rb_define_hooked_variable(const
char*, VALUE*, VALUE (*)(...), int)':
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp:171:43:
error: invalid conversion from 'int' to 'void (*)(VALUE, ID, VALUE*) {aka void
(*)(long long unsigned int, long long unsigned int, long long unsigned int*)}'
[-fpermissive]
In file included from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp:24:0,
from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/internal/anyargs.h:83,
from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/ruby.h:24,
                 from c:/opscode/chef/embedded/include/ruby-3.0.0/ruby.h:38,
                 from unf.cc:3:
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/internal/variable.h:50:6:
error:   initializing argument 4 of 'void rb_define_hooked_variable(const char*,
VALUE*, VALUE (*)(ID, VALUE*), void (*)(VALUE, ID, VALUE*))' [-fpermissive]
In file included from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/internal/anyargs.h:83:0,
from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/ruby.h:24,
                 from c:/opscode/chef/embedded/include/ruby-3.0.0/ruby.h:38,
                 from unf.cc:3:
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp: At
global scope:
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp:175:57:
error: 'std::nullptr_t' has not been declared
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp: In
function 'void ruby::backward::cxxanyargs::rb_define_hooked_variable(const
char*, VALUE*, int, void (*)(VALUE, ID, VALUE*))':
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp:177:43:
error: invalid conversion from 'int' to 'VALUE (*)(ID, VALUE*) {aka long long
unsigned int (*)(long long unsigned int, long long unsigned int*)}'
[-fpermissive]
In file included from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp:24:0,
from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/internal/anyargs.h:83,
from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/ruby.h:24,
                 from c:/opscode/chef/embedded/include/ruby-3.0.0/ruby.h:38,
                 from unf.cc:3:
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/internal/variable.h:50:6:
error:   initializing argument 3 of 'void rb_define_hooked_variable(const char*,
VALUE*, VALUE (*)(ID, VALUE*), void (*)(VALUE, ID, VALUE*))' [-fpermissive]
In file included from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/internal/anyargs.h:83:0,
from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/ruby.h:24,
                 from c:/opscode/chef/embedded/include/ruby-3.0.0/ruby.h:38,
                 from unf.cc:3:
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp: At
global scope:
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp:182:57:
error: 'std::nullptr_t' has not been declared
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp: In
function 'void ruby::backward::cxxanyargs::rb_define_hooked_variable(const
char*, VALUE*, int, void (*)(...))':
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp:185:43:
error: invalid conversion from 'int' to 'VALUE (*)(ID, VALUE*) {aka long long
unsigned int (*)(long long unsigned int, long long unsigned int*)}'
[-fpermissive]
In file included from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp:24:0,
from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/internal/anyargs.h:83,
from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/ruby.h:24,
                 from c:/opscode/chef/embedded/include/ruby-3.0.0/ruby.h:38,
                 from unf.cc:3:
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/internal/variable.h:50:6:
error:   initializing argument 3 of 'void rb_define_hooked_variable(const char*,
VALUE*, VALUE (*)(ID, VALUE*), void (*)(VALUE, ID, VALUE*))' [-fpermissive]
In file included from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/internal/anyargs.h:83:0,
from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/ruby.h:24,
                 from c:/opscode/chef/embedded/include/ruby-3.0.0/ruby.h:38,
                 from unf.cc:3:
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp: At
global scope:
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp:212:42:
error: 'std::nullptr_t' has not been declared
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp: In
function 'VALUE ruby::backward::cxxanyargs::rb_iterate(VALUE (*)(VALUE), VALUE,
int, VALUE)':
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp:214:35:
error: invalid conversion from 'int' to 'rb_block_call_func_t {aka long long
unsigned int (*)(long long unsigned int, long long unsigned int, int, const long
long unsigned int*, long long unsigned int)}' [-fpermissive]
In file included from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/internal/intern/cont.h:25:0,
from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp:15,
from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/internal/anyargs.h:83,
from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/ruby.h:24,
                 from c:/opscode/chef/embedded/include/ruby-3.0.0/ruby.h:38,
                 from unf.cc:3:
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/internal/iterator.h:47:7:
error:   initializing argument 3 of 'VALUE rb_iterate(VALUE (*)(VALUE), VALUE,
rb_block_call_func_t, VALUE)' [-fpermissive]
In file included from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/internal/anyargs.h:83:0,
from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/ruby.h:24,
                 from c:/opscode/chef/embedded/include/ruby-3.0.0/ruby.h:38,
                 from unf.cc:3:
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp: At
global scope:
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp:238:58:
error: 'std::nullptr_t' has not been declared
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp: In
function 'VALUE ruby::backward::cxxanyargs::rb_block_call(VALUE, ID, int, const
VALUE*, int, VALUE)':
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp:240:44:
error: invalid conversion from 'int' to 'rb_block_call_func_t {aka long long
unsigned int (*)(long long unsigned int, long long unsigned int, int, const long
long unsigned int*, long long unsigned int)}' [-fpermissive]
In file included from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/internal/intern/cont.h:25:0,
from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp:15,
from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/internal/anyargs.h:83,
from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/ruby.h:24,
                 from c:/opscode/chef/embedded/include/ruby-3.0.0/ruby.h:38,
                 from unf.cc:3:
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/internal/iterator.h:48:7:
error:   initializing argument 5 of 'VALUE rb_block_call(VALUE, ID, int, const
VALUE*, rb_block_call_func_t, VALUE)' [-fpermissive]
In file included from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/internal/anyargs.h:83:0,
from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/ruby.h:24,
                 from c:/opscode/chef/embedded/include/ruby-3.0.0/ruby.h:38,
                 from unf.cc:3:
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp: At
global scope:
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp:337:30:
error: 'std::nullptr_t' has not been declared
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp: In
function 'VALUE ruby::backward::cxxanyargs::rb_catch(const char*, int, VALUE)':
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp:339:30:
error: invalid conversion from 'int' to 'rb_block_call_func_t {aka long long
unsigned int (*)(long long unsigned int, long long unsigned int, int, const long
long unsigned int*, long long unsigned int)}' [-fpermissive]
In file included from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/internal/intern/cont.h:25:0,
from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/backward/cxxanyargs.hpp:15,
from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/internal/anyargs.h:83,
from
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/ruby.h:24,
                 from c:/opscode/chef/embedded/include/ruby-3.0.0/ruby.h:38,
                 from unf.cc:3:
c:/opscode/chef/embedded/include/ruby-3.0.0/ruby/internal/iterator.h:54:7:
error:   initializing argument 2 of 'VALUE rb_catch(const char*,
rb_block_call_func_t, VALUE)' [-fpermissive]
make: *** [unf.o] Error 1

make failed, exit code 2

Gem files will remain installed in
C:/opscode/chef/embedded/lib/ruby/gems/3.0.0/gems/unf_ext-0.0.8.2 for
inspection.
Results logged to
C:/opscode/chef/embedded/lib/ruby/gems/3.0.0/extensions/x64-mingw32/3.0.0/unf_ext-0.0.8.2/gem_make.out

  C:/opscode/chef/embedded/lib/ruby/3.0.0/rubygems/ext/builder.rb:93:in `run'
C:/opscode/chef/embedded/lib/ruby/3.0.0/rubygems/ext/builder.rb:44:in `block
in make'
  C:/opscode/chef/embedded/lib/ruby/3.0.0/rubygems/ext/builder.rb:36:in `each'
  C:/opscode/chef/embedded/lib/ruby/3.0.0/rubygems/ext/builder.rb:36:in `make'
C:/opscode/chef/embedded/lib/ruby/3.0.0/rubygems/ext/ext_conf_builder.rb:63:in
`block in build'
  C:/opscode/chef/embedded/lib/ruby/3.0.0/tempfile.rb:317:in `open'
C:/opscode/chef/embedded/lib/ruby/3.0.0/rubygems/ext/ext_conf_builder.rb:26:in
`build'
C:/opscode/chef/embedded/lib/ruby/3.0.0/rubygems/ext/builder.rb:159:in
`build_extension'
C:/opscode/chef/embedded/lib/ruby/3.0.0/rubygems/ext/builder.rb:193:in `block
in build_extensions'
  C:/opscode/chef/embedded/lib/ruby/3.0.0/rubygems/ext/builder.rb:190:in `each'
C:/opscode/chef/embedded/lib/ruby/3.0.0/rubygems/ext/builder.rb:190:in
`build_extensions'
C:/opscode/chef/embedded/lib/ruby/3.0.0/rubygems/installer.rb:845:in
`build_extensions'
C:/opscode/chef/embedded/lib/ruby/3.0.0/bundler/rubygems_gem_installer.rb:71:in
`build_extensions'
C:/opscode/chef/embedded/lib/ruby/3.0.0/bundler/rubygems_gem_installer.rb:28:in
`install'
C:/opscode/chef/embedded/lib/ruby/3.0.0/bundler/source/rubygems.rb:200:in
`install'
C:/opscode/chef/embedded/lib/ruby/3.0.0/bundler/installer/gem_installer.rb:54:in
`install'
C:/opscode/chef/embedded/lib/ruby/3.0.0/bundler/installer/gem_installer.rb:16:in
`install_from_spec'
C:/opscode/chef/embedded/lib/ruby/3.0.0/bundler/installer/parallel_installer.rb:186:in
`do_install'
C:/opscode/chef/embedded/lib/ruby/3.0.0/bundler/installer/parallel_installer.rb:177:in
`block in worker_pool'
  C:/opscode/chef/embedded/lib/ruby/3.0.0/bundler/worker.rb:62:in `apply_func'
C:/opscode/chef/embedded/lib/ruby/3.0.0/bundler/worker.rb:57:in `block in
process_queue'
  C:/opscode/chef/embedded/lib/ruby/3.0.0/bundler/worker.rb:54:in `loop'
C:/opscode/chef/embedded/lib/ruby/3.0.0/bundler/worker.rb:54:in
`process_queue'
C:/opscode/chef/embedded/lib/ruby/3.0.0/bundler/worker.rb:91:in `block (2
levels) in create_threads'

An error occurred while installing unf_ext (0.0.8.2), and Bundler cannot
continue.

In Gemfile:
  kitchen-inspec was resolved to 2.5.2, which depends on
    inspec was resolved to 4.56.20, which depends on
      train was resolved to 3.9.2, which depends on
        azure_graph_rbac was resolved to 0.17.2, which depends on
          ms_rest_azure was resolved to 0.12.0, which depends on
            faraday-cookie_jar was resolved to 0.0.7, which depends on
              http-cookie was resolved to 1.0.5, which depends on
                domain_name was resolved to 0.5.20190[701](https://github.com/chef/chef/runs/6603559553?check_suite_focus=true#step:5:702), which depends on
                  unf was resolved to 0.1.4, which depends on
                    unf_ext

I can reproduce this error on my local windows machine using this:

gem install unf_ext:0.0.8.2

Build Errors

Installing unf_ext 0.0.7.5 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /home/deployer/.rvm/gems/ruby-2.5.3@ctm2/gems/unf_ext-0.0.7.5/ext/unf_ext
/home/deployer/.rvm/rubies/ruby-2.5.3/bin/ruby -r ./siteconf20181029-16459-1j1b4f4.rb extconf.rb
checking for -lstdc++... yes
creating Makefile

current directory: /home/deployer/.rvm/gems/ruby-2.5.3@ctm2/gems/unf_ext-0.0.7.5/ext/unf_ext
make "DESTDIR=" clean

current directory: /home/deployer/.rvm/gems/ruby-2.5.3@ctm2/gems/unf_ext-0.0.7.5/ext/unf_ext
make "DESTDIR="
compiling unf.cc
g++: error: unrecognized command line option ‘-Wmisleading-indentation’
g++: error: unrecognized command line option ‘-Wimplicit-fallthrough=0’
g++: error: unrecognized command line option ‘-Wduplicated-cond’
g++: error: unrecognized command line option ‘-Wrestrict’
make: *** [unf.o] Error 1

make failed, exit code 2

Ruby 2.6 x86-mingw32 support

Hi there! Ruby 2.6 is here, and the x86-mingw32 release on rubygems is bound to < 2.6.

https://rubygems.org/gems/unf_ext/versions/0.0.7.5-x86-mingw32

I don't have a development x86-mingw32 machine to test Ruby 2.6 compatibility myself, so I would appreciate your help in adding support and releasing new packages. Our gem relies on unf_ext, and we have a good number of Windows users 🙂

Let me know if there's anything I can do to help, or if you need any more information.

Build fails if using Xcode 11 toolchain

Noticed this on my machine and also on CircleCI that build fails when using Xcode 11 command line tools. I've switched the tools to Xcode 10.3 and it works fine on my machine, but it gets a bit more complicated when attempting to build on CircleCI.

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

current directory:
/Users/distiller/project/vendor/bundle/ruby/2.3.0/gems/unf_ext-0.0.7.6/ext/unf_ext
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r
./siteconf20190912-536-1ctxvha.rb extconf.rb
mkmf.rb can't find header files for ruby at
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/include/ruby.h

Trying to precompile this gem fails

I was trying to create a precompiled version of this gem and it fails during compilation.

jose@jose-desktop:~/Workspace/Ruby/ruby-unf_ext (master)$ rake native gem
mkdir -p tmp/x86_64-linux/unf_ext/2.3.1
cd tmp/x86_64-linux/unf_ext/2.3.1
/home/jose/.rbenv/versions/2.3.1/bin/ruby -I. ../../../../ext/unf_ext/extconf.rb
checking for main() in -lstdc++... yes
creating Makefile
cd -
cd tmp/x86_64-linux/unf_ext/2.3.1
/usr/bin/make
compiling ../../../../ext/unf_ext/unf.cc
cc1plus: warning: command line option ‘-Wdeclaration-after-statement’ is valid for C/ObjC but not for C++
cc1plus: warning: command line option ‘-Wimplicit-function-declaration’ is valid for C/ObjC but not for C++
linking shared-object unf_ext.so
cd -
mkdir -p tmp/x86_64-linux/stage/lib
cp .document tmp/x86_64-linux/stage/.document
cp .gitignore tmp/x86_64-linux/stage/.gitignore
cp .travis.yml tmp/x86_64-linux/stage/.travis.yml
cp CHANGELOG.md tmp/x86_64-linux/stage/CHANGELOG.md
cp Gemfile tmp/x86_64-linux/stage/Gemfile
cp LICENSE.txt tmp/x86_64-linux/stage/LICENSE.txt
cp README.md tmp/x86_64-linux/stage/README.md
cp Rakefile tmp/x86_64-linux/stage/Rakefile
mkdir -p tmp/x86_64-linux/stage/ext/unf_ext
cp ext/unf_ext/extconf.rb tmp/x86_64-linux/stage/ext/unf_ext/extconf.rb
cp ext/unf_ext/unf.cc tmp/x86_64-linux/stage/ext/unf_ext/unf.cc
mkdir -p tmp/x86_64-linux/stage/ext/unf_ext/unf
cp ext/unf_ext/unf/normalizer.hh tmp/x86_64-linux/stage/ext/unf_ext/unf/normalizer.hh
cp ext/unf_ext/unf/table.hh tmp/x86_64-linux/stage/ext/unf_ext/unf/table.hh
mkdir -p tmp/x86_64-linux/stage/ext/unf_ext/unf/trie
cp ext/unf_ext/unf/trie/char_stream.hh tmp/x86_64-linux/stage/ext/unf_ext/unf/trie/char_stream.hh
cp ext/unf_ext/unf/trie/node.hh tmp/x86_64-linux/stage/ext/unf_ext/unf/trie/node.hh
cp ext/unf_ext/unf/trie/searcher.hh tmp/x86_64-linux/stage/ext/unf_ext/unf/trie/searcher.hh
cp ext/unf_ext/unf/util.hh tmp/x86_64-linux/stage/ext/unf_ext/unf/util.hh
cp lib/unf_ext.rb tmp/x86_64-linux/stage/lib/unf_ext.rb
mkdir -p tmp/x86_64-linux/stage/lib/unf_ext
cp lib/unf_ext/version.rb tmp/x86_64-linux/stage/lib/unf_ext/version.rb
mkdir -p tmp/x86_64-linux/stage/test
cp test/helper.rb tmp/x86_64-linux/stage/test/helper.rb
cp test/normalization-test.txt tmp/x86_64-linux/stage/test/normalization-test.txt
cp test/test_unf_ext.rb tmp/x86_64-linux/stage/test/test_unf_ext.rb
cp unf_ext.gemspec tmp/x86_64-linux/stage/unf_ext.gemspec
install -c tmp/x86_64-linux/unf_ext/2.3.1/unf_ext.so lib/unf_ext.so
cp tmp/x86_64-linux/unf_ext/2.3.1/unf_ext.so tmp/x86_64-linux/stage/lib/unf_ext.so
rake aborted!
NoMethodError: undefined method `split' for nil:NilClass

Tasks: TOP => native => native:x86_64-linux => native:unf_ext:x86_64-linux
(See full trace by running task with --trace)

Gem install fail / Rails 5 / segmentation fault

MacBook High Sierra, V10.13.3, Rails V5.2.0; Ruby V2.4.0p0.
Attempt to bundle installed failed with the following error:

Installing unf_ext 0.0.7.5 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/jseidel/.rvm/gems/ruby-2.4.0/gems/unf_ext-0.0.7.5/ext/unf_ext
/Users/jseidel/.rvm/rubies/ruby-2.4.0/bin/ruby -r ./siteconf20180609-26885-1c0cete.rb extconf.rb
checking for -lstdc++... yes
creating Makefile

current directory: /Users/jseidel/.rvm/gems/ruby-2.4.0/gems/unf_ext-0.0.7.5/ext/unf_ext
make "DESTDIR=" clean

current directory: /Users/jseidel/.rvm/gems/ruby-2.4.0/gems/unf_ext-0.0.7.5/ext/unf_ext
make "DESTDIR="
compiling unf.cc
make: *** [unf.o] Segmentation fault: 11

make failed, exit code 2

Gem files will remain installed in /Users/jseidel/.rvm/gems/ruby-2.4.0/gems/unf_ext-0.0.7.5 for inspection.
Results logged to /Users/jseidel/.rvm/gems/ruby-2.4.0/extensions/x86_64-darwin-15/2.4.0/unf_ext-0.0.7.5/gem_make.out

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

In Gemfile:
  attachinary was resolved to 1.3.1, which depends on
    cloudinary was resolved to 1.1.7, which depends on
      rest-client was resolved to 2.0.2, which depends on
        http-cookie was resolved to 1.0.3, which depends on
          domain_name was resolved to 0.5.20180417, which depends on
            unf was resolved to 0.1.4, which depends on
              unf_ext

Log file:

current directory: /Users/jseidel/.rvm/gems/ruby-2.4.0/gems/unf_ext-0.0.7.5/ext/unf_ext
/Users/jseidel/.rvm/rubies/ruby-2.4.0/bin/ruby -r ./siteconf20180609-26885-1c0cete.rb extconf.rb
checking for -lstdc++... yes
creating Makefile

current directory: /Users/jseidel/.rvm/gems/ruby-2.4.0/gems/unf_ext-0.0.7.5/ext/unf_ext
make "DESTDIR=" clean

current directory: /Users/jseidel/.rvm/gems/ruby-2.4.0/gems/unf_ext-0.0.7.5/ext/unf_ext
make "DESTDIR="
compiling unf.cc
make: *** [unf.o] Segmentation fault: 11

make failed, exit code 2

Building fails with Mac 14, Xcode 11.2, ruby 2.3.7

When running bundle install with following, error occurs...
Xcode 11.2.1
Build version 11B500
macOS 10.14.6
ruby version ruby 2.3.7p456 (2018-03-28 revision 63024) [universal.x86_64-darwin18]
Bundler version 2.1.4

Installing unf_ext 0.0.7.7 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/Users/myteam/.jenkins/workspace/myapp-fastlane-distribution/myaap/ios/vendor/bundle/ruby/2.3.0/gems/unf_ext-0.0.7.7/ext/unf_ext
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r
./siteconf20200421-10002-1r7wtfv.rb extconf.rb
mkmf.rb can't find header files for ruby at
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in
/Users/myteam/.jenkins/workspace/myapp-fastlane-distribution/myaap/ios/vendor/bundle/ruby/2.3.0/gems/unf_ext-0.0.7.7
for inspection.
Results logged to
/Users/myteam/.jenkins/workspace/myapp-fastlane-distribution/myaap/ios/vendor/bundle/ruby/2.3.0/extensions/universal-darwin-18/2.3.0/unf_ext-0.0.7.7/gem_make.out

An error occurred while installing unf_ext (0.0.7.7), and Bundler cannot
continue.
Make sure that `gem install unf_ext -v '0.0.7.7' --source
'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  fastlane was resolved to 2.145.0, which depends on
    faraday-cookie_jar was resolved to 0.0.6, which depends on
      http-cookie was resolved to 1.0.3, which depends on
        domain_name was resolved to 0.5.20190701, which depends on
          unf was resolved to 0.1.4, which depends on
            unf_ext

Error compiling on Ruby 1.8.7

g++ -I. -I. -I/opt/rubies/ruby-1.8.7-p371/lib/ruby/1.8/x86_64-linux -I. -DHAVE_RUBY_ENCODING_H    -fPIC -g -O2    -c unf.cc
In file included from unf.cc:5:0:
/usr/include/ruby/encoding.h:101:68: error: expected identifier before numeric constant
/usr/include/ruby/encoding.h:101:68: error: expected ‘,’ or ‘...’ before numeric constant
/usr/include/ruby/encoding.h:101:73: error: expected constructor, destructor, or type conversion before ‘;’ token
In file included from unf.cc:5:0:
/usr/include/ruby/encoding.h:213:65: error: declaration of C function ‘long int rb_memsearch(const void*, long int, const void*, long int, rb_encoding*)’ conflicts with
In file included from /opt/rubies/ruby-1.8.7-p371/lib/ruby/1.8/x86_64-linux/ruby.h:756:0,
                 from unf.cc:3:
/opt/rubies/ruby-1.8.7-p371/lib/ruby/1.8/x86_64-linux/intern.h:387:6: error: previous declaration ‘long int rb_memsearch(const void*, long int, const void*, long int)’ here
make: *** [unf.o] Error 1

It does successfully build on Ruby 1.9.3. I would be OK if unf_ext set gemspec.required_ruby_version to >= 1.9.1.

Latest version doesn't contain a binary for Windows

In rubygems, version 0.0.7.6 doesn't have binary packages:

0.0.7.6 - April 20, 2019 (390 KB)
0.0.7.5 - February 06, 2018 x64-mingw32 (6.35 MB)
0.0.7.5 - February 06, 2018 x86-mingw32 (6.07 MB)
0.0.7.5 - February 06, 2018 (390 KB)

Compilation Error with non-trivial designated initializers when installing unf_ext (0.0.9) on Ruby 2.3.1 on Linux

Issue Summary

I am encountering an issue while trying to install the unf_ext gem. The installation fails with a compilation error, and I believe it might be related to non-trivial designated initializers.

Environment

  • Ruby version: 2.3.1
  • Operating system: Linux
  • Installation command: gem install unf_ext -v 0.0.9

Error Message

Building native extensions. This could take a while...
ERROR: Error installing unf_ext:
ERROR: Failed to build gem native extension.

current directory: /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/unf_ext-0.0.9/ext/unf_ext
/opt/rubies/ruby-2.3.1/bin/ruby -r ./siteconf20231113-4568-rh260p.rb extconf.rb
checking for main() in -lstdc++... yes
creating Makefile

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

/opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/extensions/x86_64-linux/2.3.0-static/unf_ext-0.0.9/mkmf.log

current directory: /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/unf_ext-0.0.9/ext/unf_ext
make "DESTDIR=" clean

current directory: /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/unf_ext-0.0.9/ext/unf_ext
make "DESTDIR="
compiling unf.cc
cc1plus: warning: command line option ‘-Wdeclaration-after-statement’ is valid for C/ObjC but not for C++ [enabled by default]
cc1plus: warning: command line option ‘-Wimplicit-function-declaration’ is valid for C/ObjC but not for C++ [enabled by default]
unf.cc:39:3: sorry, unimplemented: non-trivial designated initializers not supported
   };
   ^
unf.cc:39:3: sorry, unimplemented: non-trivial designated initializers not supported
make: *** [unf.o] Error 1

make failed, exit code 2

Gem files will remain installed in /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/gems/unf_ext-0.0.9 for inspection.
Results logged to /opt/rubies/ruby-2.3.1/lib/ruby/gems/2.3.0/extensions/x86_64-linux/2.3.0-static/unf_ext-0.0.9/gem_make.out

Additional Information

I have checked the mkmf.log file, and it seems to be pointing to an issue with non-trivial designated initializers. I am using Ruby 2.3.1 on a Linux system, and the installation command used is as mentioned above.

Problem installing 0.0.5

While 0.0.4 installs fine, when I try to install 0.0.5 on Ubuntu 12.04 using rvm ruby 1.9.3-p327 I get this error:

checking for main() in -lstdc++... yes
checking for ruby/encoding.h... yes
creating Makefile

make
compiling unf.cc
cc1plus: warning: command line option ‘-Wdeclaration-after-statement’ is valid for C/ObjC but not for C++ [enabled by default]
cc1plus: warning: command line option ‘-Wimplicit-function-declaration’ is valid for C/ObjC but not for C++ [enabled by default]
In file included from unf/normalizer.hh:10:0,
                 from unf.cc:1:
unf/table.hh:5757:56: error: invalid suffix "xB70D1" on integer constant
unf/table.hh:5637:47: error: ‘B900CAF6’ was not declared in this scope
make: *** [unf.o] Error 1

Problem compiling with MSVC++

Hi,

I'm trying to build this with Microsoft Visual C++ on Windows 7, with Ruby 1.9.3-p194. However, I'm having a bit of trouble.

ruby 1.9.3p194 (2012-04-20 revision 35410) [i386-mswin32_100]

c:\Users\djberge\Repositories\ruby-unf_ext\ext\unf_ext>nmake

Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation.  All rights reserved.

generating unf_ext-i386-mswin32_100.def
compiling unf.cc
unf.cc
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\xlocale(323) : warning C4530: C++ exception handler used,
 but unwind semantics are not enabled. Specify /EHsc
c:\users\djberge\repositories\ruby-unf_ext\ext\unf_ext\unf.cc(48) : error C4716: 'unf_delete' : must return a value
NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.EXE"' : return code '0x2'
Stop.

I can add /EHsc to the Makefile and recompile to eliminate the warning, but I can't work around the error. The code in question is this:

VALUE unf_delete(UNF::Normalizer* ptr) {
    ptr->~Normalizer();
    ruby_xfree(ptr);
  }

It seems ruby_xfree does not actually return a VALUE. What should I do to make this work?

I tried altering "VALUE" to "void" in both the function and the prototype and that seemed to work. Was that the right thing to do?

Regards,

Dan

Release new gem (post-0.0.7.2) with ARM fixes, new Unicode 9 support

Now that #15 has been committed, the next step is to cut a new bug fix release that would include the ARM changes and that would in turn allow Ruby code that uses unf_ext to be ported to ARM (Raspberry Pi, ThunderX, and a bunch of systems in between) without doing anything special for this gem.

In addition, it would be sensible to incorporate in the updates from upstream that bring in support for Unicode 9, see #29 for that issue.

Solaris sparc compile fails: Compiler options invalid UNIX 03, POSIX.1-2001, c99

On a Solaris 11 sparc server patched to include fixes from 08/2017 and using the gcc 4.8 compiler I get this message:

#include "unf/normalizer.hh"
^
In file included from /usr/include/wchar.h:8:0,
from /usr/gcc/4.8/include/c++/4.8.2/cwchar:44,
from /usr/gcc/4.8/include/c++/4.8.2/bits/postypes.h:40,
from /usr/gcc/4.8/include/c++/4.8.2/bits/char_traits.h:40,
from /usr/gcc/4.8/include/c++/4.8.2/string:40,
from unf/normalizer.hh:5,
from unf.cc:1:
/usr/include/sys/feature_tests.h:358:2: error: #error "Compiler or options invalid; UNIX 03 and POSIX.1-2001 applications require the use of c99"
#error "Compiler or options invalid; UNIX 03 and POSIX.1-2001 applications
^
make: *** [unf.o] Error 1

I added this code to extconf.rb to get the make it work. -std=c99 and -std=c++11 directly address the compile issue. I added -m32 because later version of the compiler will default to m64 builds which will fail for other reasons. I would make this a pull request but I really don't know what I'm doing with this code.

if RbConfig::CONFIG['host_os'] =~ /solaris(!?2.1[0-2])/
$CFLAGS = $CFLAGS.gsub(/-std=c99/,'')
$CFLAGS << " -m32 -std=c++11"
$CPPFLAGS = $CFLAGS.gsub(/-std=c99/,'')
$CPPFLAGS << " -m32 -std=c++11"
$CXXFLAGS = $CFLAGS.gsub(/-std=c99/,'')
$CXXFLAGS << " -m32 -std=c++11"
end

create_makefile 'unf_ext'

Tests don't actually test.

Currently, the tests load the cases in the wrong order for the given normalization files. This isn't caught because the tests also use assert instead of assert_equal, so all tests pass because the arguments are truthy and not because they actually match the expected behaviour.

Fixed by #25.

Gem install fails for 2.2.3-clang (OS X 10.11.3)

On OS X 10.11.3 installing unf_ext fails under CRuby 2.2.3-clang fails from not having system-level dependencies:

» rvm use ruby-2.2.3-clang
Using /Users/pewpewpew/.rvm/gems/ruby-2.2.3-clang
Anthonys-MacBook-Pro :: Documents/lol/catz ‹wip› » gem install gooddata
Building native extensions.  This could take a while...
ERROR:  Error installing gooddata:
    ERROR: Failed to build gem native extension.

    /Users/pewpewpew/.rvm/rubies/ruby-2.2.3-clang/bin/ruby -r ./siteconf20160214-65070-41cxnb.rb extconf.rb
checking for main() in -lstdc++... *** 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=/Users/pewpewpew/.rvm/rubies/ruby-2.2.3-clang/bin/$(RUBY_BASE_NAME)
    --with-static-libstdc++
    --without-static-libstdc++
    --with-stdc++lib
    --without-stdc++lib
/Users/pewpewpew/.rvm/rubies/ruby-2.2.3-clang/lib/ruby/2.2.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from /Users/pewpewpew/.rvm/rubies/ruby-2.2.3-clang/lib/ruby/2.2.0/mkmf.rb:541:in `try_link0'
    from /Users/pewpewpew/.rvm/rubies/ruby-2.2.3-clang/lib/ruby/2.2.0/mkmf.rb:556:in `try_link'
    from /Users/pewpewpew/.rvm/rubies/ruby-2.2.3-clang/lib/ruby/2.2.0/mkmf.rb:735:in `try_func'
    from /Users/pewpewpew/.rvm/rubies/ruby-2.2.3-clang/lib/ruby/2.2.0/mkmf.rb:966:in `block in have_library'
    from /Users/pewpewpew/.rvm/rubies/ruby-2.2.3-clang/lib/ruby/2.2.0/mkmf.rb:911:in `block in checking_for'
    from /Users/pewpewpew/.rvm/rubies/ruby-2.2.3-clang/lib/ruby/2.2.0/mkmf.rb:351:in `block (2 levels) in postpone'
    from /Users/pewpewpew/.rvm/rubies/ruby-2.2.3-clang/lib/ruby/2.2.0/mkmf.rb:321:in `open'
    from /Users/pewpewpew/.rvm/rubies/ruby-2.2.3-clang/lib/ruby/2.2.0/mkmf.rb:351:in `block in postpone'
    from /Users/pewpewpew/.rvm/rubies/ruby-2.2.3-clang/lib/ruby/2.2.0/mkmf.rb:321:in `open'
    from /Users/pewpewpew/.rvm/rubies/ruby-2.2.3-clang/lib/ruby/2.2.0/mkmf.rb:347:in `postpone'
    from /Users/pewpewpew/.rvm/rubies/ruby-2.2.3-clang/lib/ruby/2.2.0/mkmf.rb:910:in `checking_for'
    from /Users/pewpewpew/.rvm/rubies/ruby-2.2.3-clang/lib/ruby/2.2.0/mkmf.rb:961:in `have_library'
    from extconf.rb:6:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /Users/pewpewpew/.rvm/gems/ruby-2.2.3-clang/gems/unf_ext-0.0.7.2 for inspection.
Results logged to /Users/pewpewpew/.rvm/gems/ruby-2.2.3-clang/extensions/x86_64-darwin-14/2.2.0-static/unf_ext-0.0.7.2/gem_make.out

However, this is not the case on standard CRuby 2.2.3, unf_ext installs fine

Install for Windows fails

I'm using this in a gem being built on OS X but its destined for an environment where RUBY_PLATFORM is i386-mingw32. So I tried to play it safe and did in my Gemfile:

gem 'unf_ext', :platform => [ :mswin, :mswin_18, :mswin_19, :mswin_20,
      :mswin_21, :mswin_22, :mswin_23, :mswin_24, :mswin_25, :mswin64,
      :mswin64_19, :mswin64_20, :mswin64_21, :mswin64_22, :mswin64_23,
      :mswin64_24, :mswin64_25, :mingw, :mingw_18, :mingw_19,
      :mingw_20, :mingw_21, :mingw_22, :mingw_23, :mingw_24,
      :mingw_25, :x64_mingw, :x64_mingw_20, :x64_mingw_21,
      :x64_mingw_22, :x64_mingw_23, :x64_mingw_24, :x64_mingw_25 ]

I think that covered all the bases but when I run the program, I get

Could not find unf_ext-0.0.7.4-x86-mingw32 in any of the sources

I was thinking you were distributing prebuilt binaries per platform? if so, Is there a way to say that in the gem file?

Install on MacOS 10.9.5 -- Issues with bundle install and Ruby 1.9.3

I have been trying to get the gem to install using bundle but I'm never able to get very far. It seems to install when I use gem or bundle install --gemfile= but when I attempt to do the regular bundle install for my app it results in the following:

/Users/user-folder/.rbenv/versions/1.9.3-p327/bin/ruby extconf.rb
checking for main() in -lstdc++... yes
checking for ruby/encoding.h... yes
creating Makefile

make
compiling unf.cc
cc1plus: warning: command line option ‘-Wdeclaration-after-statement’ is valid for C/ObjC but not for C++ [enabled by default]
cc1plus: warning: command line option ‘-Wimplicit-function-declaration’ is valid for C/ObjC but not for C++ [enabled by default]
In file included from unf.cc:1:0:
unf/normalizer.hh:4:18: fatal error: vector: No such file or directory
compilation terminated.
make: *** [unf.o] Error 1

Another error that I get is the following when I use the other bundle install method above:
Could not find unf_ext-0.0.6 in any of the sources

I haven't been able to track down a definitive source of the problem, although I have updated python, update xCode and GCC to 4.6.2 ... sorta at a loss as to where I should go from here--any guidance would be truly appreciated.

Build fail on Linux

This occured to me when trying to install jekyll-webmention_io, see aarongustafson/jekyll-webmention_io#75.

$ bundle install
Fetching gem metadata from https://rubygems.org/..........                                                                                                              
Fetching gem metadata from https://rubygems.org/.                                                                                                                       
Resolving dependencies...                                                                                                                                               
Using public_suffix 2.0.5                                                                                                                                               
Using addressable 2.5.1                                                                                                                                                 
Using bundler 1.16.0                                                                                                                                                    
Using colorator 1.1.0                                                                                                                                                   
Fetching unf_ext 0.0.7.5                                                                                                                                                
Installing unf_ext 0.0.7.5 with native extensions                                                                                                                       
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.                                                                                                      
                                                                                                                                                                        
    current directory: $HOME/.gem/ruby/2.3.0/gems/unf_ext-0.0.7.5/ext/unf_ext                                                                                    
/usr/bin/ruby23 -r ./siteconf20180225-16640-mruchr.rb extconf.rb                                                                                                        
checking for main() in -lstdc++... *** 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}/lib64                                                                                                                              
        --with-make-prog                                                                                                                                                
        --without-make-prog                                                                                                                                             
        --srcdir=.                                                                                                                                                      
        --curdir                                                                                                                                                        
        --ruby=/usr/bin/$(RUBY_BASE_NAME)23                                                                                                                             
        --with-static-libstdc++                                                                                                                                         
        --without-static-libstdc++                                                                                                                                      
        --with-stdc++lib                                                                                                                                                
        --without-stdc++lib                                                                                                                                             
/usr/lib64/ruby/2.3.0/mkmf.rb:456:in `try_do': The compiler failed to generate an                                                                                       
executable file. (RuntimeError)                                                                                                                                         
You have to install development tools first.                                                                                                                            
        from /usr/lib64/ruby/2.3.0/mkmf.rb:541:in `try_link0'                                                                                                           
        from /usr/lib64/ruby/2.3.0/mkmf.rb:556:in `try_link'                                                                                                            
        from /usr/lib64/ruby/2.3.0/mkmf.rb:765:in `try_func'                                                                                                            
        from /usr/lib64/ruby/2.3.0/mkmf.rb:997:in `block in have_library'
        from /usr/lib64/ruby/2.3.0/mkmf.rb:942:in `block in checking_for'
        from /usr/lib64/ruby/2.3.0/mkmf.rb:350:in `block (2 levels) in postpone'
        from /usr/lib64/ruby/2.3.0/mkmf.rb:320:in `open'
        from /usr/lib64/ruby/2.3.0/mkmf.rb:350:in `block in postpone'
        from /usr/lib64/ruby/2.3.0/mkmf.rb:320:in `open'
        from /usr/lib64/ruby/2.3.0/mkmf.rb:346:in `postpone'
        from /usr/lib64/ruby/2.3.0/mkmf.rb:941:in `checking_for'
        from /usr/lib64/ruby/2.3.0/mkmf.rb:992:in `have_library'
        from extconf.rb:6:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be                                                                                     
found here:                                                                                                                                                             
                                                                                                                                                                        
$HOME/.gem/ruby/2.3.0/extensions/x86_64-linux/2.3.0/unf_ext-0.0.7.5/mkmf.log                                                                                     
                                                                                                                                                                        
extconf failed, exit code 1                                                                                                                                             
                                                                                                                                                                        
Gem files will remain installed in $HOME/.gem/ruby/2.3.0/gems/unf_ext-0.0.7.5                                                                                    
for inspection.                                                                                                                                                         
Results logged to                                                                                                                                                       
$HOME/.gem/ruby/2.3.0/extensions/x86_64-linux/2.3.0/unf_ext-0.0.7.5/gem_make.out                                                                                 
                                                                                                                                                                        
An error occurred while installing unf_ext (0.0.7.5), and Bundler cannot                                                                                                
continue.
Make sure that `gem install unf_ext -v '0.0.7.5'` succeeds before bundling.

In Gemfile:
  jekyll-webmention_io was resolved to 2.8.5, which depends on
    http was resolved to 2.2.2, which depends on
      http-cookie was resolved to 1.0.3, which depends on
        domain_name was resolved to 0.5.20170404, which depends on
          unf was resolved to 0.1.4, which depends on
            unf_ext

0.0.7.2 fails to build on arm with gcc6 (i.e. C++14)

0.0.7.2 fails to build on armv7hl with gcc 6 development version on Fedora 24 as https://kojipkgs.fedoraproject.org//work/tasks/6081/12886081/build.log

In file included from unf/normalizer.hh:10:0,
                 from unf.cc:1:
unf/table.hh:13539:25: error: narrowing conversion of '-27' from 'int' to 'char' inside { } [-Wnarrowing]
  -77, -39,-124, -39,-123};
                         ^
unf/table.hh:13539:25: error: narrowing conversion of '-113' from 'int' to 'char' inside { } [-Wnarrowing]
unf/table.hh:13539:25: error: narrowing conversion of '-81' from 'int' to 'char' inside { } [-Wnarrowing]
unf/table.hh:13539:25: error: narrowing conversion of '-27' from 'int' to 'char' inside { } [-Wnarrowing]
(and many others)

Note that gcc6 faults to -std=gnu++14, and "char" on arm is "unsigned" by default. So converting -113 (for example) to char on arm is narrowing conversion and C++11 prohibits this on initializer.

Installation fails in Docker and Ruby 3 preview

Here is the command:

docker run --rm -it ruby:3.0.0-preview2-alpine sh -c "apk add build-base && gem i unf_ext"

And the output:

fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.12/community/x86_64/APKINDEX.tar.gz
(1/17) Installing binutils (2.34-r1)
(2/17) Installing libmagic (5.38-r0)
(3/17) Installing file (5.38-r0)
(4/17) Installing isl (0.18-r0)
(5/17) Installing libgomp (9.3.0-r2)
(6/17) Installing libatomic (9.3.0-r2)
(7/17) Installing libgphobos (9.3.0-r2)
(8/17) Installing mpfr4 (4.0.2-r4)
(9/17) Installing mpc1 (1.1.0-r1)
(10/17) Installing gcc (9.3.0-r2)
(11/17) Installing musl-dev (1.1.24-r10)
(12/17) Installing libc-dev (0.7.2-r3)
(13/17) Installing g++ (9.3.0-r2)
(14/17) Installing make (4.3-r0)
(15/17) Installing fortify-headers (1.1-r0)
(16/17) Installing patch (2.7.6-r6)
(17/17) Installing build-base (0.5-r2)
Executing busybox-1.31.1-r19.trigger
OK: 218 MiB in 53 packages
Fetching unf_ext-0.0.7.7.gem
Building native extensions. This could take a while...
ERROR:  Error installing unf_ext:
	ERROR: Failed to build gem native extension.

    current directory: /usr/local/bundle/gems/unf_ext-0.0.7.7/ext/unf_ext
/usr/local/bin/ruby -I /usr/local/lib/ruby/3.0.0 -r ./siteconf20201219-1-1w1k8f.rb extconf.rb
checking for -lstdc++... yes
creating Makefile

current directory: /usr/local/bundle/gems/unf_ext-0.0.7.7/ext/unf_ext
make "DESTDIR=" clean

current directory: /usr/local/bundle/gems/unf_ext-0.0.7.7/ext/unf_ext
make "DESTDIR="
compiling unf.cc
make: I.: No such file or directory
make: [Makefile:213: unf.o] Error 127 (ignored)
linking shared-object unf_ext.so
make: shared: No such file or directory
make: [Makefile:262: unf_ext.so] Error 127 (ignored)

current directory: /usr/local/bundle/gems/unf_ext-0.0.7.7/ext/unf_ext
make "DESTDIR=" install
compiling unf.cc
make: I.: No such file or directory
make: [Makefile:213: unf.o] Error 127 (ignored)
linking shared-object unf_ext.so
make: shared: No such file or directory
make: [Makefile:262: unf_ext.so] Error 127 (ignored)
/usr/bin/install -c -m 0755 unf_ext.so ./.gem.20201219-1-nf46qg
install: can't stat 'unf_ext.so': No such file or directory
make: *** [Makefile:190: install-so] Error 1

make install failed, exit code 2

Gem files will remain installed in /usr/local/bundle/gems/unf_ext-0.0.7.7 for inspection.
Results logged to /usr/local/bundle/extensions/x86_64-linux-musl/3.0.0/unf_ext-0.0.7.7/gem_make.out

Build fail on Alpine Linux

bash-4.3# ruby -v
ruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-linux]
bash-4.3# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-alpine-linux-musl/6.1.0/lto-wrapper
Target: x86_64-alpine-linux-musl
Configured with: /home/buildozer/aports/main/gcc/src/gcc-6.1.0/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --build=x86_64-alpine-linux-musl --host=x86_64-alpine-linux-musl --target=x86_64-alpine-linux-musl --with-pkgversion='Alpine 6.1.0' --enable-checking=release --disable-fixed-point --disable-libstdcxx-pch --disable-multilib --disable-nls --disable-werror --disable-symvers --enable-__cxa_atexit --enable-default-pie --enable-cloog-backend --enable-languages=c,c++,objc,java,fortran,ada --disable-libssp --disable-libmpx --disable-libmudflap --disable-libsanitizer --enable-shared --enable-threads --enable-tls --with-system-zlib
Thread model: posix
gcc version 6.1.0 (Alpine 6.1.0)
bash-4.3# g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-alpine-linux-musl/6.1.0/lto-wrapper
Target: x86_64-alpine-linux-musl
Configured with: /home/buildozer/aports/main/gcc/src/gcc-6.1.0/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --build=x86_64-alpine-linux-musl --host=x86_64-alpine-linux-musl --target=x86_64-alpine-linux-musl --with-pkgversion='Alpine 6.1.0' --enable-checking=release --disable-fixed-point --disable-libstdcxx-pch --disable-multilib --disable-nls --disable-werror --disable-symvers --enable-__cxa_atexit --enable-default-pie --enable-cloog-backend --enable-languages=c,c++,objc,java,fortran,ada --disable-libssp --disable-libmpx --disable-libmudflap --disable-libsanitizer --enable-shared --enable-threads --enable-tls --with-system-zlib
Thread model: posix
gcc version 6.1.0 (Alpine 6.1.0)
bash-4.3# ruby extconf.rb && make && make install
checking for main() in -lstdc++... yes
creating Makefile
make: Warning: File 'Makefile' has modification time 3 s in the future
compiling unf.cc
In file included from /usr/local/include/ruby-2.2.0/ruby/defines.h:68:0,
                 from /usr/local/include/ruby-2.2.0/ruby/ruby.h:29,
                 from /usr/local/include/ruby-2.2.0/ruby.h:33,
                 from unf.cc:3:
/usr/local/include/ruby-2.2.0/ruby/missing.h:163:29: error: 'int isinf(double)' conflicts with a previous declaration
 RUBY_EXTERN int isinf(double);
                             ^
In file included from /usr/include/c++/6.1.0/math.h:36:0,
                 from /usr/local/include/ruby-2.2.0/ruby/missing.h:23,
                 from /usr/local/include/ruby-2.2.0/ruby/defines.h:68,
                 from /usr/local/include/ruby-2.2.0/ruby/ruby.h:29,
                 from /usr/local/include/ruby-2.2.0/ruby.h:33,
                 from unf.cc:3:
/usr/include/c++/6.1.0/cmath:618:3: note: previous declaration 'constexpr bool std::isinf(double)'
   isinf(double __x)
   ^~~~~
In file included from /usr/local/include/ruby-2.2.0/ruby/defines.h:68:0,
                 from /usr/local/include/ruby-2.2.0/ruby/ruby.h:29,
                 from /usr/local/include/ruby-2.2.0/ruby.h:33,
                 from unf.cc:3:
/usr/local/include/ruby-2.2.0/ruby/missing.h:170:29: error: 'int isnan(double)' conflicts with a previous declaration
 RUBY_EXTERN int isnan(double);
                             ^
In file included from /usr/include/c++/6.1.0/math.h:36:0,
                 from /usr/local/include/ruby-2.2.0/ruby/missing.h:23,
                 from /usr/local/include/ruby-2.2.0/ruby/defines.h:68,
                 from /usr/local/include/ruby-2.2.0/ruby/ruby.h:29,
                 from /usr/local/include/ruby-2.2.0/ruby.h:33,
                 from unf.cc:3:
/usr/include/c++/6.1.0/cmath:643:3: note: previous declaration 'constexpr bool std::isnan(double)'
   isnan(double __x)
   ^~~~~
make: *** [Makefile:206: unf.o] Error 1
bash-4.3#

I have no idea how to fix this. :(

Error compiling with Ruby 2.0

Using Ruby 1.9.3 is no problem, but compiling with Ruby 2.0 fails.

Here's the output of the /gems/unf_ext-0.0.6/ext/unf_ext/gem_make.out

/Users/jc/.rvm/rubies/ruby-2.0.0-p0/bin/ruby extconf.rb 
checking for main() in -lstdc++... yes
checking for ruby/encoding.h... yes
creating Makefile

make
compiling unf.cc
unf.cc:1: error: bad value (native) for -march= switch
unf.cc:1: error: bad value (native) for -mtune= switch
make: *** [unf.o] Error 1

@igorpeshansky I have tested the patch and wanted to bring to your attention a potential compatibility concern with Ruby versions lower than 2.7.0, despite the gemspec specifying a requirement of ">= 2.2". The error encountered during compilation in Ruby version 2.3.1 is as follows:

          @igorpeshansky I have tested the patch and wanted to bring to your attention a potential compatibility concern with Ruby versions lower than 2.7.0, despite the gemspec specifying a requirement of ">= 2.2". The error encountered during compilation in Ruby version 2.3.1 is as follows:
compiling unf.cc
cc1plus: warning: command line option ‘-Wdeclaration-after-statement’ is valid for C/ObjC but not for C++ [enabled by default]
cc1plus: warning: command line option ‘-Wimplicit-function-declaration’ is valid for C/ObjC but not for C++ [enabled by default]
unf.cc:45:3: error: ‘rb_data_type_struct::<anonymous struct>’ has no non-static data member named ‘dcompact’
   };
   ^
make: *** [unf.o] Error 1

The "dcompact" member, which I believe was introduced in Ruby version 2.7.0, is the source of this issue. This patch appears to not fully resolve the issue introduced by #72

Originally posted by @ABHIJITH-EA in #75 (comment)

Bundle Install not working.

I am attempting to set up Stripe on a website I am building. unf_ext is installed as a dependency for their gem. I encountered the error below. It duplicates when I try to install unf_ext as a standalone gem as well. When running bundle install I receive this error:

/Users/me/.rbenv/versions/2.2.2/bin/ruby -r ./siteconf20151006-77029-11oqg9a.rb extconf.rb
checking for main() in -lstdc++... *** 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=/Users/techapoe/.rbenv/versions/2.2.2/bin/$(RUBY_BASE_NAME)
    --with-static-libstdc++
    --without-static-libstdc++
    --with-stdc++lib
    --without-stdc++lib
/Users/techapoe/.rbenv/versions/2.2.2/lib/ruby/2.2.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from /Users/techapoe/.rbenv/versions/2.2.2/lib/ruby/2.2.0/mkmf.rb:541:in `try_link0'
    from /Users/techapoe/.rbenv/versions/2.2.2/lib/ruby/2.2.0/mkmf.rb:556:in `try_link'
    from /Users/techapoe/.rbenv/versions/2.2.2/lib/ruby/2.2.0/mkmf.rb:735:in `try_func'
    from /Users/techapoe/.rbenv/versions/2.2.2/lib/ruby/2.2.0/mkmf.rb:966:in `block in have_library'
    from /Users/techapoe/.rbenv/versions/2.2.2/lib/ruby/2.2.0/mkmf.rb:911:in `block in checking_for'
    from /Users/techapoe/.rbenv/versions/2.2.2/lib/ruby/2.2.0/mkmf.rb:351:in `block (2 levels) in postpone'
    from /Users/techapoe/.rbenv/versions/2.2.2/lib/ruby/2.2.0/mkmf.rb:321:in `open'
    from /Users/techapoe/.rbenv/versions/2.2.2/lib/ruby/2.2.0/mkmf.rb:351:in `block in postpone'
    from /Users/techapoe/.rbenv/versions/2.2.2/lib/ruby/2.2.0/mkmf.rb:321:in `open'
    from /Users/techapoe/.rbenv/versions/2.2.2/lib/ruby/2.2.0/mkmf.rb:347:in `postpone'
    from /Users/techapoe/.rbenv/versions/2.2.2/lib/ruby/2.2.0/mkmf.rb:910:in `checking_for'
    from /Users/techapoe/.rbenv/versions/2.2.2/lib/ruby/2.2.0/mkmf.rb:961:in `have_library'
    from extconf.rb:6:in `<main>'

extconf failed, exit code 1

I am using OS X 10.11. I have x-code installed and updated. Help is appreciated!

Build fails on OSX 10.10.2

Hi there,

when trying to build and install beaker I've noticed that unf_ext fails to build:

uilding native extensions. This could take a while...
ERROR: Error installing unf_ext:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb

checking for main() in -lstdc++... yes
creating Makefile

make "DESTDIR="
compiling unf.cc
In file included from unf.cc:1:
In file included from ./unf/normalizer.hh:4:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/vector:265:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/__bit_reference:15:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/algorithm:628:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:604:
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/iterator:341:10: fatal error: '__debug' file not found

include <__debug>

     ^

1 error generated.
make: *** [unf.o] Error 1

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/unf_ext-0.0.7.1 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/unf_ext-0.0.7.1/ext/unf_ext/gem_make.out

Any change to fix this? Tell me, if you need further information.

Thanks and best Regards,
Patrick

Gem compile fails

gem install unf_ext --verbose
HEAD https://rubygems.org/latest_specs.4.8.gz
304 Not Modified
Installing gem unf_ext-0.0.7.5
/usr/local/share/gems/gems/unf_ext-0.0.7.5/.document
/usr/local/share/gems/gems/unf_ext-0.0.7.5/.gitignore
/usr/local/share/gems/gems/unf_ext-0.0.7.5/.travis.yml
/usr/local/share/gems/gems/unf_ext-0.0.7.5/CHANGELOG.md
/usr/local/share/gems/gems/unf_ext-0.0.7.5/Gemfile
/usr/local/share/gems/gems/unf_ext-0.0.7.5/LICENSE.txt
/usr/local/share/gems/gems/unf_ext-0.0.7.5/README.md
/usr/local/share/gems/gems/unf_ext-0.0.7.5/Rakefile
/usr/local/share/gems/gems/unf_ext-0.0.7.5/ext/unf_ext/extconf.rb
/usr/local/share/gems/gems/unf_ext-0.0.7.5/ext/unf_ext/unf.cc
/usr/local/share/gems/gems/unf_ext-0.0.7.5/ext/unf_ext/unf/normalizer.hh
/usr/local/share/gems/gems/unf_ext-0.0.7.5/ext/unf_ext/unf/table.hh
/usr/local/share/gems/gems/unf_ext-0.0.7.5/ext/unf_ext/unf/trie/char_stream.hh
/usr/local/share/gems/gems/unf_ext-0.0.7.5/ext/unf_ext/unf/trie/node.hh
/usr/local/share/gems/gems/unf_ext-0.0.7.5/ext/unf_ext/unf/trie/searcher.hh
/usr/local/share/gems/gems/unf_ext-0.0.7.5/ext/unf_ext/unf/util.hh
/usr/local/share/gems/gems/unf_ext-0.0.7.5/lib/unf_ext.rb
/usr/local/share/gems/gems/unf_ext-0.0.7.5/lib/unf_ext/version.rb
/usr/local/share/gems/gems/unf_ext-0.0.7.5/test/helper.rb
/usr/local/share/gems/gems/unf_ext-0.0.7.5/test/normalization-test.txt
/usr/local/share/gems/gems/unf_ext-0.0.7.5/test/test_unf_ext.rb
/usr/local/share/gems/gems/unf_ext-0.0.7.5/unf_ext.gemspec
Building native extensions.  This could take a while...
/usr/bin/ruby extconf.rb
mkmf.rb can't find header files for ruby at /usr/share/include/ruby.h
ERROR:  Error installing unf_ext:
	ERROR: Failed to build gem native extension.

    Building has failed. See above output for more information on the failure.

Gem files will remain installed in /usr/local/share/gems/gems/unf_ext-0.0.7.5 for inspection.
Results logged to /usr/local/share/gems/gems/unf_ext-0.0.7.5/ext/unf_ext/gem_make.out

Versions:

gem --version
2.0.14.1 
ruby --version
ruby 2.0.0p648 (2015-12-16) [x86_64-linux]

On RHEL, Development Tools package is installed

yum groupinstall "Development Tools"
Loaded plugins: amazon-id, rhui-lb, search-disabled-repos
Maybe run: yum groups mark install (see man yum)
No packages in any requested group available to install or update

I've tried the previous version 0.0.7.4 and getting same issue. Attempting to use both System ruby which is the version above, and embedded sensu ruby which is at 2.4.0. gcc-c++ and libstdc++ are both installed.

UPDATE

Apparently the rhui-REGION-rhel-server-optional repo became disabled in our base AMI, no idea how. I reenabled that and installed ruby-devel (normally this is installed via puppet). I'm able to install and compile the gem via system ruby now, so i suppose this isn't an issue with the gem. I'll go start harassing sensu now.

Closing this issue.

ANOTHER UPDATE

Looks like this got fixed by upgrading binutils.

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

I have ruby 2.3.1 in Ubantu 14.04 LTS system, when I excute sudo -u git -H bundle install --deployment --without development test mysql, I got those errors.

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

    current directory: /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/unf_ext-0.0.7.2/ext/unf_ext
/usr/local/bin/ruby -r ./siteconf20160901-32338-giivbf.rb extconf.rb
checking for main() in -lstdc++... yes
creating Makefile

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

  /home/git/gitlab/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0-static/unf_ext-0.0.7.2/mkmf.log

current directory: /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/unf_ext-0.0.7.2/ext/unf_ext
make "DESTDIR=" clean

current directory: /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/unf_ext-0.0.7.2/ext/unf_ext
make "DESTDIR="
compiling unf.cc
cc1plus: warning: command line option ‘-Wdeclaration-after-statement’ is valid for C/ObjC but not for C++ [enabled by default]
cc1plus: warning: command line option ‘-Wimplicit-function-declaration’ is valid for C/ObjC but not for C++ [enabled by default]
virtual memory exhausted: Cannot allocate memory
make: *** [unf.o] Error 1

make failed, exit code 2

Gem files will remain installed in /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/unf_ext-0.0.7.2 for inspection.
Results logged to /home/git/gitlab/vendor/bundle/ruby/2.3.0/extensions/x86_64-linux/2.3.0-static/unf_ext-0.0.7.2/gem_make.out

Release current master please

Hi there. With the merging of the AIX and Solaris fixes any chance you can push up a new version of the gem. It would be really helpful for our work at Chef.

Thanks,
Tim

Can't install 0.0.8.1-x64-mingw32 in ruby 3.1

I'm trying to install 0.0.8.1-x64-mingw32 in a x64-mingw ruby 3.1.1 system but I get the following error.

Your bundle is locked to unf_ext (0.0.8.1-x64-mingw32) from rubygems repository
https://rubygems.org/ or installed locally, but that version can no longer be
found in that source. That means the author of unf_ext (0.0.8.1-x64-mingw32) has
removed it. You'll need to update your bundle to a version other than unf_ext
(0.0.8.1-x64-mingw32) that hasn't been removed in order to install.

I can successfully install 0.0.8.1-x86-mingw32 in a x86-mingw ruby 3.1.1 system.

I noticed 0.0.8.1-x64-mingw32 has required ruby version: >= 2.4, < 3.1.DEV. Shouldn't it be >= 2.4, < 3.2.DEV, the same as 0.0.8.1-x86-mingw32?

Lots of warnings on OSX

Hi,

I'm seeing lots of warnings with gcc 4.2.1 on Snow Leopard and Ruby 1.9.3-p194. They don't seem to stop it from building, but I thought I should mention it.

ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin10.8.0]
>g++ -v
Using built-in specs.
Target: i686-apple-darwin10
Configured with: /var/tmp/gcc/gcc-5666.3~6/src/configure --disable-checking --enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin10 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 --target=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Apple Inc. build 5666) (dot 3)
>rake compile
WARNING: 'require 'rake/rdoctask'' is deprecated.  Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead.
    at /opt/local/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/rdoctask.rb
mkdir -p tmp/x86_64-darwin10.8.0/unf_ext/1.9.3
cd tmp/x86_64-darwin10.8.0/unf_ext/1.9.3
/opt/local/bin/ruby -I. ../../../../ext/unf_ext/extconf.rb
checking for main() in -lstdc++... yes
checking for ruby/encoding.h... yes
creating Makefile
cd -
cd tmp/x86_64-darwin10.8.0/unf_ext/1.9.3
make
compiling ../../../../ext/unf_ext/unf.cc
cc1plus: warning: command line option "-Wdeclaration-after-statement" is valid for C/ObjC but not for C++
cc1plus: warning: command line option "-Wimplicit-function-declaration" is valid for C/ObjC but not for C++
In file included from ../../../../ext/unf_ext/unf/trie/char_stream.hh:6,
                 from ../../../../ext/unf_ext/unf/trie/searcher.hh:4,
                 from ../../../../ext/unf_ext/unf/normalizer.hh:8,
                 from ../../../../ext/unf_ext/unf.cc:1:
../../../../ext/unf_ext/unf/trie/../util.hh: In function ‘const char* UNF::Util::nearest_utf8_char_start_point(const char*)’:
../../../../ext/unf_ext/unf/trie/../util.hh:13: warning: suggest a space before ‘;’ or explicit braces around empty body in ‘for’ statement
../../../../ext/unf_ext/unf/trie/../util.hh: In function ‘void UNF::Util::eat_until_utf8_char_start_point(CharStream&)’:
../../../../ext/unf_ext/unf/trie/../util.hh:19: warning: suggest a space before ‘;’ or explicit braces around empty body in ‘for’ statement
In file included from ../../../../ext/unf_ext/unf/trie/searcher.hh:4,
                 from ../../../../ext/unf_ext/unf/normalizer.hh:8,
                 from ../../../../ext/unf_ext/unf.cc:1:
../../../../ext/unf_ext/unf/trie/char_stream.hh: In member function ‘unsigned int UNF::Trie::CompoundCharStream::offset() const’:
../../../../ext/unf_ext/unf/trie/char_stream.hh:52: warning: implicit conversion shortens 64-bit value into a 32-bit value
../../../../ext/unf_ext/unf/trie/char_stream.hh: In member function ‘void UNF::Trie::CharStreamForComposition::mark_as_last_valid_point()’:
../../../../ext/unf_ext/unf/trie/char_stream.hh:89: warning: implicit conversion shortens 64-bit value into a 32-bit value
In file included from ../../../../ext/unf_ext/unf/normalizer.hh:8,
                 from ../../../../ext/unf_ext/unf.cc:1:
../../../../ext/unf_ext/unf/trie/searcher.hh: In member function ‘void UNF::Trie::CanonicalCombiningClass::sort(char*, std::vector >&) const’:
../../../../ext/unf_ext/unf/trie/searcher.hh:49: warning: implicit conversion shortens 64-bit value into a 32-bit value
../../../../ext/unf_ext/unf/trie/searcher.hh:59: warning: implicit conversion shortens 64-bit value into a 32-bit value
In file included from ../../../../ext/unf_ext/unf.cc:1:
../../../../ext/unf_ext/unf/normalizer.hh: In member function ‘void UNF::Normalizer::decompose_one(const char*, const char*, const UNF::Trie::NormalizationForm&, std::string&)’:
../../../../ext/unf_ext/unf/normalizer.hh:60: warning: implicit conversion shortens 64-bit value into a 32-bit value
linking shared-object unf_ext.bundle
cd -
install -c tmp/x86_64-darwin10.8.0/unf_ext/1.9.3/unf_ext.bundle lib/unf_ext.bundle

Do a 1.0.0 release?

Hi,
many companies require 'stable' software in their production environment. This mostly means a 1.0.0 release with a stable semver API. Would you mind releasing 1.0.0?

Please set a value for LC_VERSION_MIN_MACOSX so that the compiled Mac binaries have it in their Mach-O headers

Hello there

Please could you set a value for LC_VERSION_MIN_MACOSX, such that this load command is embedded into the Mach-O headers of the compiled .o files.

This is to ensure that they pass the stricter code validation in Xcode 7 for certain distribution targets e.g. Mac App Store - currently the Xcode build breaks for my app under these conditions.

You might be able to do this by passing the mmacosx-version-min=[some value] argument to clang, possibly by adding it in extconf.rb.

Note that this translates into 2 values, and they can either be different (you'd have to look up how to set that) or the same:

  • Base SDK - this must be as close to the current OS X release SDK as possible, as Apple vigorously deprecates support for old ones.
  • Deployment target - this is the more interesting value of the two. It can be set to the earliest OS X release that your code will run on. But you might want to draw the line at an OS X release which has not yet been EOL'd by Apple.

Steps to reproduce:

  1. Include compiled unf_ext .o files in an Xcode project in some way, e.g. indirectly in the resources folder, or directly by linking against them.
  2. Build and then validate the archive for certain distribution targets e.g. Mac App Store.
  3. Note that the compiled .o files appear in the 'binaries and entitlements' list in the Validate dialog - this is because Xcode is analysing them as if they were part of your project's actual code.
  4. The validation step of the build then breaks. The error is that it cannot find an LC_VERSION_MIN_MACOSX load command in the Mach-O headers of the .o files.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.