[MacRuby] #1017: macgem intall error
#1017: macgem intall error ----------------------------+----------------------------------------------- Reporter: tglee@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: macgem ----------------------------+----------------------------------------------- $ macruby -e 'p MACRUBY_VERSION, MACRUBY_REVISION' "0.8" "svn revision 4962 from http://svn.macosforge.org/repository/ruby/MacRuby/trunk" $ sudo macgem i gsl Password: Building native extensions. This could take a while... ERROR: While executing gem ... (TypeError) can't convert Float into String $ -- Ticket URL: <http://www.macruby.org/trac/ticket/1017> MacRuby <http://macruby.org/>
#1017: macgem intall error ----------------------------+----------------------------------------------- Reporter: tglee@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: macgem ----------------------------+----------------------------------------------- Comment(by lsansonetti@…): After investigation, this exception happens in lib/rubygems/installer.rb line 467 {{{ dest_path = File.join @gem_dir, @spec.require_paths.first }}} In this expression, the first argument to File.join is the following array: {{{ (gdb) po ary <Array 0x4016beac0>( /tmp/XXX/gems/narray-0.5.9.7, 0 ) }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/1017#comment:2> MacRuby <http://macruby.org/>
#1017: macgem intall error ----------------------------+----------------------------------------------- Reporter: tglee@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: macgem ----------------------------+----------------------------------------------- Comment(by lsansonetti@…): Looks like a bug in our YAML layer. {{{ irb(main):005:0> s => "--- !ruby/object:Gem::Specification \nrubygems_version: 0.9.4\nspecification_version: 1\nname: narray\nversion: !ruby/object:Gem::Version \n version: 0.5.9.7\ndate: 2009-06-14 00:00:00 +09:00\nsummary: N-dimensional Numerical Array class for Ruby\nrequire_paths: \n- .\nemail: masa16.tanaka@gmail.com\nhomepage: http://narray.rubyforge.org/\nrubyforge_project: narray\ndescription: \nautorequire: \ndefault_executable: \nbindir: bin\nhas_rdoc: false\nrequired_ruby_version: !ruby/object:Gem::Version::Requirement \n requirements: \n - - \">\"\n - !ruby/object:Gem::Version \n version: 0.0.0\n version: \nplatform: ruby\nsigning_key: \ncert_chain: \npost_install_message: \nauthors: \n- Masahiro Tanaka\nfiles: \n- src/ChangeLog\n- src/MANIFEST\n- src/README.en\n- src/README.ja\n- src/SPEC.en\n- src/SPEC.ja\n- src/depend\n- src/extconf.rb\n- src/mkmath.rb\n- src/mknafunc.rb\n- src/mkop.rb\n- src/na_array.c\n- src/na_func.c\n- src/na_index.c\n- src/na_linalg.c\n- src/na_random.c\n- src/narray.c\n- src/narray.def\n- src/narray.h\n- src/narray_local.h\n- src/lib/narray_ext.rb\n- src/lib/nmatrix.rb\n- src/test/statistics.rb\n- src/test/testarray.rb\n- src/test/testbit.rb\n- src/test/testcast.rb\n- src/test/testcomplex.rb\n- src/test/testfftw.rb\n- src/test/testindex.rb\n- src/test/testindexary.rb\n- src/test/testindexset.rb\n- src/test/testmask.rb\n- src/test/testmath.rb\n- src/test/testmath2.rb\n- src/test/testmatrix.rb\n- src/test/testmatrix2.rb\n- src/test/testmatrix3.rb\n- src/test/testminmax.rb\n- src/test/testobject.rb\n- src/test/testpow.rb\n- src/test/testrandom.rb\n- src/test/testround.rb\n- src/test/testsort.rb\n- src/test/teststr.rb\n- src/test/testtrans.rb\n- src/test/testwhere.rb\n- src/bench/all.rb\n- src/bench/bench.m\n- src/bench/bench.py\n- src/bench/bench.rb\n- src/bench/dummy.m\n- src/bench/dummy.py\n- src/bench/dummy.rb\ntest_files: []\n\nrdoc_options: []\n\nextra_rdoc_files: []\n\nexecutables: []\n\nextensions: \n- src/extconf.rb\nrequirements: []\n\ndependencies: []\n\n" irb(main):006:0> YAML.load(s) => {"rubygems_version"=>"0.9.4", "specification_version"=>1, "name"=>"narray", "version"=>{"version"=>"0.5.9.7"}, "date"=>2009-06-13 08:00:00 -0700, "summary"=>"N-dimensional Numerical Array class for Ruby", "require_paths"=>[0.0], "email"=>"masa16.tanaka@gmail.com", "homepage"=>"http://narray.rubyforge.org/", "rubyforge_project"=>"narray", "description"=>nil, "autorequire"=>nil, "default_executable"=>nil, "bindir"=>"bin", "has_rdoc"=>false, "required_ruby_version"=>{"requirements"=>[[">", {"version"=>"0.0.0"}]], "version"=>nil}, "platform"=>"ruby", "signing_key"=>nil, "cert_chain"=>nil, "post_install_message"=>nil, "authors"=>["Masahiro Tanaka"], "files"=>["src/ChangeLog", "src/MANIFEST", "src/README.en", "src/README.ja", "src/SPEC.en", "src/SPEC.ja", "src/depend", "src/extconf.rb", "src/mkmath.rb", "src/mknafunc.rb", "src/mkop.rb", "src/na_array.c", "src/na_func.c", "src/na_index.c", "src/na_linalg.c", "src/na_random.c", "src/narray.c", "src/narray.def", "src/narray.h", "src/narray_local.h", "src/lib/narray_ext.rb", "src/lib/nmatrix.rb", "src/test/statistics.rb", "src/test/testarray.rb", "src/test/testbit.rb", "src/test/testcast.rb", "src/test/testcomplex.rb", "src/test/testfftw.rb", "src/test/testindex.rb", "src/test/testindexary.rb", "src/test/testindexset.rb", "src/test/testmask.rb", "src/test/testmath.rb", "src/test/testmath2.rb", "src/test/testmatrix.rb", "src/test/testmatrix2.rb", "src/test/testmatrix3.rb", "src/test/testminmax.rb", "src/test/testobject.rb", "src/test/testpow.rb", "src/test/testrandom.rb", "src/test/testround.rb", "src/test/testsort.rb", "src/test/teststr.rb", "src/test/testtrans.rb", "src/test/testwhere.rb", "src/bench/all.rb", "src/bench/bench.m", "src/bench/bench.py", "src/bench/bench.rb", "src/bench/dummy.m", "src/bench/dummy.py", "src/bench/dummy.rb"], "test_files"=>[], "rdoc_options"=>[], "extra_rdoc_files"=>[], "executables"=>[], "extensions"=>["src/extconf.rb"], "requirements"=>[], "dependencies"=>[]} }}} Somehow, the require_paths field in YAML is empty but deserialized as 0.0. -- Ticket URL: <http://www.macruby.org/trac/ticket/1017#comment:3> MacRuby <http://macruby.org/>
#1017: macgem intall error ----------------------------+----------------------------------------------- Reporter: tglee@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: macgem ----------------------------+----------------------------------------------- Comment(by watson1978@…): I attach a patch. Please check it. {{{ #!diff diff --git a/ext/libyaml/rubyext.c b/ext/libyaml/rubyext.c index c0eaf82..76827d9 100644 --- a/ext/libyaml/rubyext.c +++ b/ext/libyaml/rubyext.c @@ -290,6 +290,7 @@ is_numeric(const char *str, bool *has_point) } char c; bool point = false; + bool numeric = false; while ((c = *str++) != '\0') { if (!isdigit(c)) { if (c == '.') { @@ -302,9 +303,12 @@ is_numeric(const char *str, bool *has_point) return false; } } + else if (!point) { + numeric = true; + } } *has_point = point; - return true; + return numeric; } static inline bool }}} Test Script: {{{ require 'yaml' require 'test/unit/assertions.rb' include Test::Unit::Assertions assert_equal(["."], YAML.load('- .')) assert_equal([1.0], YAML.load('- 1.')) assert_equal([1.2], YAML.load('- 1.2')) assert_equal(["1.2.3"], YAML.load('- 1.2.3')) assert_equal([".5"], YAML.load('- .5')) puts :ok }}} -- Ticket URL: <http://www.macruby.org/trac/ticket/1017#comment:4> MacRuby <http://macruby.org/>
#1017: macgem intall error ----------------------------+----------------------------------------------- Reporter: tglee@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: macgem ----------------------------+----------------------------------------------- Comment(by lsansonetti@…): Thanks for the quick patch! I merged it into my local repository and verified that the bug disappeared, and that YAML specs still pass as before. Please commit :) Now, installing the gsl gem fails with a different error: {{{ $ sudo /usr/local/bin/macgem install gsl Building native extensions. This could take a while... ERROR: Error installing gsl: ERROR: Failed to build gem native extension. /Library/Frameworks/MacRuby.framework/Versions/0.8/usr/bin/macruby extconf.rb checking for sys/types.h... yes checking for u_int8_t... yes checking for int16_t... yes checking for int32_t... yes checking for u_int32_t... yes creating narray_config.h creating Makefile make Makefile:176: warning: overriding commands for target `/Library/Frameworks/MacRuby.framework/Versions/0.8/usr/lib/ruby/Gems/1.9.2/gems/narray-0.5.9.7/.' Makefile:174: warning: ignoring old commands for target `/Library/Frameworks/MacRuby.framework/Versions/0.8/usr/lib/ruby/Gems/1.9.2/gems/narray-0.5.9.7/.' /usr/bin/gcc -I. -I/Library/Frameworks/MacRuby.framework/Versions/0.8/usr/include/ruby-1.9.2 /universal-darwin11.0 -I/Library/Frameworks/MacRuby.framework/Versions/0.8/usr/include/ruby-1.9.2/ruby/backward -I/Library/Frameworks/MacRuby.framework/Versions/0.8/usr/include/ruby-1.9.2 -I. -DHAVE_SYS_TYPES_H -DHAVE_U_INT8_T -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_U_INT32_T -fno-common -arch i386 -arch x86_64 -fexceptions -fno- common -pipe -O3 -g -Wall -arch i386 -arch x86_64 -o narray.o -c narray.c narray.c: In function ‘na_mark_obj’: narray.c:84: warning: implicit declaration of function ‘rb_gc_mark’ narray.c: In function ‘na_check_class_narray’: narray.c:170: warning: implicit declaration of function ‘RCLASS’ narray.c:170: error: invalid type argument of ‘->’ narray.c:170: error: invalid type argument of ‘->’ narray.c:172: warning: implicit declaration of function ‘class_getSuperclass’ narray.c:172: error: ‘Class’ undeclared (first use in this function) narray.c:172: error: (Each undeclared identifier is reported only once narray.c:172: error: for each function it appears in.) narray.c:172: error: expected ‘)’ before ‘v’ narray.c: In function ‘na_mark_obj’: narray.c:84: warning: implicit declaration of function ‘rb_gc_mark’ narray.c: In function ‘na_check_class_narray’: narray.c:170: warning: implicit declaration of function ‘RCLASS’ narray.c:170: error: invalid type argument of ‘->’ narray.c:170: error: invalid type argument of ‘->’ narray.c:172: warning: implicit declaration of function ‘class_getSuperclass’ narray.c:172: error: ‘Class’ undeclared (first use in this function) narray.c:172: error: (Each undeclared identifier is reported only once narray.c:172: error: for each function it appears in.) narray.c:172: error: expected ‘)’ before ‘v’ lipo: can't open input file: /var/tmp//ccfnTl6u.out (No such file or directory) make: *** [narray.o] Error 1 Gem files will remain installed in /Library/Frameworks/MacRuby.framework/Versions/0.8/usr/lib/ruby/Gems/1.9.2/gems/narray-0.5.9.7 for inspection. Results logged to /Library/Frameworks/MacRuby.framework/Versions/0.8/usr/lib/ruby/Gems/1.9.2/gems/narray-0.5.9.7/src/gem_make.out }}} I remember people reporting that narray won't compile with MacRuby. I believe the extension uses too much APIs that we don't support (like the RCLASS macro to access fields). -- Ticket URL: <http://www.macruby.org/trac/ticket/1017#comment:5> MacRuby <http://macruby.org/>
#1017: macgem install error: narray ----------------------------+----------------------------------------------- Reporter: tglee@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: MacRuby Later Component: MacRuby | Keywords: macgem ----------------------------+----------------------------------------------- Changes (by lsansonetti@…): * milestone: => MacRuby Later Comment: For Later. -- Ticket URL: <http://www.macruby.org/trac/ticket/1017#comment:6> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby