brianmario / escape_utils

Faster string escaping routines for your ruby apps
MIT License
513 stars 52 forks source link

Error installing version 1.1.0 #60

Closed grv87 closed 8 years ago

grv87 commented 9 years ago

I have an error installing version 1.1.0:

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

    C:/root/Ruby/19E105~1.3/bin/ruby.exe extconf.rb
creating Makefile

make  clean

make
generating escape_utils-i386-mingw32.def
compiling buffer.c
buffer.c: In function 'gh_buf_cmp':
buffer.c:245:2: warning: implicit declaration of function 'MIN'
buffer.c: In function 'gh_buf_init':
buffer.c:36:1: warning: visibility attribute not supported in this configuration; ignored
buffer.c: In function 'gh_buf_try_grow':
buffer.c:82:1: warning: visibility attribute not supported in this configuration; ignored
buffer.c: In function 'gh_buf_free':
buffer.c:92:1: warning: visibility attribute not supported in this configuration; ignored
buffer.c: In function 'gh_buf_clear':
buffer.c:99:1: warning: visibility attribute not supported in this configuration; ignored
buffer.c: In function 'gh_buf_set':
buffer.c:114:1: warning: visibility attribute not supported in this configuration; ignored
buffer.c: In function 'gh_buf_sets':
buffer.c:119:1: warning: visibility attribute not supported in this configuration; ignored
buffer.c: In function 'gh_buf_putc':
buffer.c:127:1: warning: visibility attribute not supported in this configuration; ignored
buffer.c: In function 'gh_buf_put':
buffer.c:136:1: warning: visibility attribute not supported in this configuration; ignored
buffer.c: In function 'gh_buf_puts':
buffer.c:142:1: warning: visibility attribute not supported in this configuration; ignored
buffer.c: In function 'gh_buf_vprintf':
buffer.c:176:1: warning: visibility attribute not supported in this configuration; ignored
buffer.c: In function 'gh_buf_printf':
buffer.c:188:1: warning: visibility attribute not supported in this configuration; ignored
buffer.c: In function 'gh_buf_copy_cstr':
buffer.c:206:1: warning: visibility attribute not supported in this configuration; ignored
buffer.c: In function 'gh_buf_swap':
buffer.c:213:1: warning: visibility attribute not supported in this configuration; ignored
buffer.c: In function 'gh_buf_detach':
buffer.c:225:1: warning: visibility attribute not supported in this configuration; ignored
buffer.c: In function 'gh_buf_attach':
buffer.c:241:1: warning: visibility attribute not supported in this configuration; ignored
buffer.c: In function 'gh_buf_cmp':
buffer.c:248:1: warning: visibility attribute not supported in this configuration; ignored
buffer.c: At top level:
buffer.c:248:1: warning: visibility attribute not supported in this configuration; ignored
buffer.c:248:1: warning: visibility attribute not supported in this configuration; ignored
compiling escape_utils.c
compiling houdini_href_e.c
houdini_href_e.c: In function 'houdini_escape_href':
houdini_href_e.c:115:1: warning: visibility attribute not supported in this configuration; ignored
compiling houdini_html_e.c
houdini_html_e.c: In function 'houdini_escape_html0':
houdini_html_e.c:83:1: warning: visibility attribute not supported in this configuration; ignored
houdini_html_e.c: In function 'houdini_escape_html':
houdini_html_e.c:89:1: warning: visibility attribute not supported in this configuration; ignored
compiling houdini_html_u.c
In file included from houdini_html_u.c:6:0:
html_unescape.gperf: In function 'find_entity':
html_unescape.gperf:174:1: warning: visibility attribute not supported in this configuration; ignored
houdini_html_u.c: In function 'houdini_unescape_html':
houdini_html_u.c:121:1: warning: visibility attribute not supported in this configuration; ignored
compiling houdini_js_e.c
houdini_js_e.c: In function 'houdini_escape_js':
houdini_js_e.c:89:1: warning: visibility attribute not supported in this configuration; ignored
compiling houdini_js_u.c
houdini_js_u.c: In function 'houdini_unescape_js':
houdini_js_u.c:59:1: warning: visibility attribute not supported in this configuration; ignored
compiling houdini_uri_e.c
houdini_uri_e.c: In function 'houdini_escape_uri':
houdini_uri_e.c:94:1: warning: visibility attribute not supported in this configuration; ignored
houdini_uri_e.c: In function 'houdini_escape_uri_component':
houdini_uri_e.c:100:1: warning: visibility attribute not supported in this configuration; ignored
houdini_uri_e.c: In function 'houdini_escape_url':
houdini_uri_e.c:106:1: warning: visibility attribute not supported in this configuration; ignored
compiling houdini_uri_u.c
houdini_uri_u.c: In function 'houdini_unescape_uri':
houdini_uri_u.c:55:1: warning: visibility attribute not supported in this configuration; ignored
houdini_uri_u.c: In function 'houdini_unescape_uri_component':
houdini_uri_u.c:61:1: warning: visibility attribute not supported in this configuration; ignored
houdini_uri_u.c: In function 'houdini_unescape_url':
houdini_uri_u.c:67:1: warning: visibility attribute not supported in this configuration; ignored
compiling houdini_xml_e.c
houdini_xml_e.c: In function 'houdini_escape_xml':
houdini_xml_e.c:136:1: warning: visibility attribute not supported in this configuration; ignored
linking shared-object escape_utils/escape_utils.so
buffer.o: In function `gh_buf_cmp':
C:\root\Ruby\19E105~1.3\lib\ruby\gems\1.9.1\gems\escape_utils-1.1.0\ext\escape_utils/buffer.c:245: undefined reference to `MIN'
collect2: ld returned 1 exit status
make: *** [escape_utils.so] Error 1

make failed, exit code 2

There is no problem with previous versions, e.g. 1.0.0.

aj-michael commented 9 years ago

The same error existed in 0.3.0

https://github.com/brianmario/escape_utils/issues/29

ZaDarkSide commented 8 years ago

9 months passed since this issue was posted and I'm getting the same error now in 2016, any solution for this yet?

ZaDarkSide commented 8 years ago

OK, studied the problem a little and the solution is already merged in, modify ext/escape_utils/buffer.h and add manually this patch https://github.com/brianmario/escape_utils/pull/62/files after that run gem spec ../../cache/escape_utils-1.1.0.gem --ruby > ../../specifications/escape_utils-1.1.0.gemspec until the new version is released and really fixes the problem.

kenny-evitt commented 8 years ago

I was getting the same error when trying to install another Gem that uses this gem; my output:

C:\Users\kevitt\Documents\@cases, open\1999>gem install csvlint
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing csvlint:
        ERROR: Failed to build gem native extension.

    c:/Ruby22/bin/ruby.exe -r ./siteconf20160125-11900-o7zzgt.rb extconf.rb
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
generating escape_utils-i386-mingw32.def
compiling buffer.c
buffer.c: In function 'gh_buf_cmp':
buffer.c:245:2: warning: implicit declaration of function 'MIN' [-Wimplicit-func
tion-declaration]
compiling escape_utils.c
compiling houdini_href_e.c
compiling houdini_html_e.c
compiling houdini_html_u.c
compiling houdini_js_e.c
compiling houdini_js_u.c
compiling houdini_uri_e.c
compiling houdini_uri_u.c
compiling houdini_xml_e.c
linking shared-object escape_utils/escape_utils.so
buffer.o: In function `gh_buf_cmp':
c:\Ruby22\lib\ruby\gems\2.2.0\gems\escape_utils-1.1.0\ext\escape_utils/buffer.c:
245: undefined reference to `MIN'
collect2.exe: error: ld returned 1 exit status
make: *** [escape_utils.so] Error 1

make failed, exit code 2

Gem files will remain installed in c:/Ruby22/lib/ruby/gems/2.2.0/gems/escape_uti
ls-1.1.0 for inspection.
Results logged to c:/Ruby22/lib/ruby/gems/2.2.0/extensions/x86-mingw32/2.2.0/esc
ape_utils-1.1.0/gem_make.out

My versions:

At the suggestion of @ZaDarkSide, I modified _ext/escapeutils/buffer.h and then ran the following:

C:\Ruby22\lib\ruby\gems\2.2.0\gems\escape_utils-1.1.0\ext\escape_utils>ruby extc
onf.rb
creating Makefile

C:\Ruby22\lib\ruby\gems\2.2.0\gems\escape_utils-1.1.0\ext\escape_utils>C:\Ruby\D
evKit-mingw64-32-4.7.2-20130224-1151-sfx\devkitvars.bat
Adding the DevKit to PATH...

C:\Ruby22\lib\ruby\gems\2.2.0\gems\escape_utils-1.1.0\ext\escape_utils>make
compiling buffer.c
compiling escape_utils.c
compiling houdini_href_e.c
compiling houdini_html_e.c
compiling houdini_html_u.c
compiling houdini_js_e.c
compiling houdini_js_u.c
compiling houdini_uri_e.c
compiling houdini_uri_u.c
compiling houdini_xml_e.c
linking shared-object escape_utils/escape_utils.so

C:\Ruby22\lib\ruby\gems\2.2.0\gems\escape_utils-1.1.0\ext\escape_utils>make inst
all
/usr/bin/install -c -m 0755 escape_utils.so /c/Ruby22/lib/ruby/site_ruby/2.2.0/i
386-msvcrt/escape_utils

C:\Ruby22\lib\ruby\gems\2.2.0\gems\escape_utils-1.1.0\ext\escape_utils>cd ..\..

C:\Ruby22\lib\ruby\gems\2.2.0\gems\escape_utils-1.1.0>gem spec ../../cache/escap
e_utils-1.1.0.gem --ruby > ../../specifications/escape_utils-1.1.0.gemspec
[c:/Ruby22/lib/ruby/gems/2.2.0/specifications/escape_utils-1.1.0.gemspec] isn't
a Gem::Specification (NilClass instead).

Note that C:\Ruby\DevKit-mingw64-32-4.7.2-20130224-1151-sfx is the directory where I installed the Ruby DevKit.

After the above, I was able to install the gem that uses this gem without error.

kenny-evitt commented 8 years ago

@ZaDarkSide A new version of _escapeutils is available on RubyGems.org. I asked the owner to publish a new version and he was gracious enough to do so a few days ago.

ZaDarkSide commented 8 years ago

Thank you very much for announcing it @kenny-evitt, the people running Ruby on Windows and using this extension are happy now :+1:

The issue can be closed now

kenny-evitt commented 8 years ago

@grv87 This should be fixed; a new version of the gem is available.

grv87 commented 8 years ago

Can't test since I have another error during install.

@ZaDarkSide confirms fix, so I'm closing this issue.

ZaDarkSide commented 8 years ago
>gem install escape_utils
Building native extensions.  This could take a while...
Successfully installed escape_utils-1.2.0
Parsing documentation for escape_utils-1.2.0
Installing ri documentation for escape_utils-1.2.0
Done installing documentation for escape_utils after 1 seconds
1 gem installed

Confirmed fix.

kenny-evitt commented 8 years ago

I was also able to install the latest version of the gem.