rubyomr-preview / ruby

The Ruby+OMR Preview
Other
68 stars 9 forks source link

`gem install syck` fails to build native extensions #38

Open graemej opened 7 years ago

graemej commented 7 years ago

Reproduce via:

Observe the following output:

Fetching: syck-1.2.0.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing syck:
    ERROR: Failed to build gem native extension.

Digging into the compile error the rb_omr_markstate_t definition is missing:

In file included from syck.h:20:0,
                 from gram.y:16:
/usr/local/include/ruby-2.2.0/ruby/st.h:180:27: error: unknown type name 'rb_omr_markstate_t'
 void rb_omr_mark_st_table(rb_omr_markstate_t ms, st_table *table);
mgaudet commented 7 years ago

I'll have to rope in @charliegracie on this -- this starts to head into the GC patch section, and there's some structure here I'm not sure about.

I can however add a few details:

  1. Doesn't just fail in the docker container: A fresh checkout of ruby_2_2_omr built and installed has the same failure.
  2. Attempting to fix by patching st.h with the following doesn't fix it

    diff --git a/include/ruby/st.h b/include/ruby/st.h
    index 7722760..ce76473 100644
    --- a/include/ruby/st.h
    +++ b/include/ruby/st.h
    @@ -43,6 +43,9 @@ typedef unsigned LONG_LONG st_data_t;
     # endif
     #endif
    
    +struct rb_omr_markstate;
    +typedef struct rb_omr_markstate * rb_omr_markstate_t;
    +
     typedef struct st_table st_table;
    
     typedef st_data_t st_index_t;

    This brings new failures:

    In file included from syck.h:20:0,
                     from gram.y:16:
    /home/magaudet/.rbenv/versions/ruby_2_2_omr/include/ruby-2.2.0/ruby/st.h: In function ‘st_remove_packed_entry_inline’:
    /home/magaudet/.rbenv/versions/ruby_2_2_omr/include/ruby-2.2.0/ruby/st.h:254:2: warning: implicit declaration of function ‘MEMMOVE’ [-Wimplicit-function-declaration]
      MEMMOVE(&table->as.packed.entries[i], &table->as.packed.entries[i+1],
      ^

    I'm tempted to say there was an expectation ruby.h was going to be included everwhere... but it's pretty clear that's not the case here.