[MacRuby] #756: NArray won't build with MacRuby
#756: NArray won't build with MacRuby --------------------------------+------------------------------------------- Reporter: mike@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: --------------------------------+------------------------------------------- The NArray gem won't build under MacRuby {{{
sudo macgem install narray Password: Building native extensions. This could take a while... ERROR: While executing gem ... (TypeError) can't convert Float into String can't convert Float into String (TypeError) }}}
-- Ticket URL: <http://www.macruby.org/trac/ticket/756> MacRuby <http://macruby.org/>
#756: NArray won't build with MacRuby --------------------------------+------------------------------------------- Reporter: mike@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: --------------------------------+------------------------------------------- Comment(by mike@…): Looks like this extension uses the RCLASS macro from ruby.h that doesn't seem to exist in MacRuby. Looks like its implementation specific? So, perhaps this isn't portable to MacRuby? -- Ticket URL: <http://www.macruby.org/trac/ticket/756#comment:1> MacRuby <http://macruby.org/>
#756: NArray won't build with MacRuby --------------------------------+------------------------------------------- Reporter: mike@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: --------------------------------+------------------------------------------- Comment(by martinlagardette@…): I'd say the portability is kind of unlikely. `RCLASS` is a cast to `struct RClass`, which does not exist in MacRuby. We tend to think it is '''not''' a good idea to give access to the internal structures, especially since it's implementation dependent. Unfortunately, a lot of extension developers abuse this availability, most often unjustified though. What might be possible it to talk with the `narray` developer and try to see if there is another way to do whatever (s)he does with the class struct. -- Ticket URL: <http://www.macruby.org/trac/ticket/756#comment:2> MacRuby <http://macruby.org/>
#756: NArray won't build with MacRuby --------------------------------+------------------------------------------- Reporter: mike@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: --------------------------------+------------------------------------------- Comment(by lsansonetti@…): Do we know how narray uses the RCLASS macro exactly? RCLASS could simply be emulated as `#define RCLASS(o) ((Class)o)'. -- Ticket URL: <http://www.macruby.org/trac/ticket/756#comment:3> MacRuby <http://macruby.org/>
#756: NArray won't build with MacRuby --------------------------------+------------------------------------------- Reporter: mike@… | Owner: lsansonetti@… Type: defect | Status: new Priority: blocker | Milestone: Component: MacRuby | Keywords: --------------------------------+------------------------------------------- Comment(by martinlagardette@…): After inspection in the code, the dev is using `RCLASS` to determine wether or not an object is an instance of `NArray`: {{{ #!c static void na_check_class_narray(VALUE v) { if (TYPE(v) != T_CLASS) { rb_raise(rb_eRuntimeError, "class required"); } while (v) { if (v == cNArray || RCLASS(v)->m_tbl == RCLASS(cNArray)->m_tbl) return; v = RCLASS_SUPER(v); } rb_raise(rb_eRuntimeError, "need NArray or its subclass"); } }}} We do not use `m_tbl`, so this cannot be emulated :-(. I am looking for a solution right now. We do have an equivalent of what is being done, but it is totally different and would require ugly `#ifdef MACRUBY` etc. Instead we'd rather find a solution that can be used with ruby and macruby :-) -- Ticket URL: <http://www.macruby.org/trac/ticket/756#comment:4> MacRuby <http://macruby.org/>
#756: NArray won't build with MacRuby --------------------------------+------------------------------------------- Reporter: mike@… | Owner: lsansonetti@… Type: defect | Status: closed Priority: blocker | Milestone: Component: MacRuby | Resolution: wontfix Keywords: | --------------------------------+------------------------------------------- Changes (by lsansonetti@…): * status: new => closed * resolution: => wontfix Comment: We won't support the m_tbl field, sorry. The NArray developer has to fix the extension. I suspect other rubies (but MRI) will have the same problem too. -- Ticket URL: <http://www.macruby.org/trac/ticket/756#comment:5> MacRuby <http://macruby.org/>
participants (1)
-
MacRuby