Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Support mruby 1.4.1 #99

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mlga
Copy link

@mlga mlga commented Oct 21, 2018

In relation to issue: #98 I've also wanted to upgrade to mruby 1.4.1. Applying few hacks (I just wanted to make it run first, then think about doing things properly).

I managed to make mrusty compile but cargo test fails

running 113 tests
error: process didn't exit successfully: `target/debug/deps/mrusty-a7b41d5ff22307c3` (signal: 11, SIGSEGV: invalid memory reference)

@dragostis I know you don't want to spent much time maintaining mrusty anymore but perhaps you can help me with some advice? I don't have much experience with Rust and even less with Ruby.

@@ -126,8 +126,10 @@ void mrb_ext_set_instance_tt(struct RClass* class, enum mrb_vtype type) {
MRB_SET_INSTANCE_TT(class, type);
}

int mrb_ext_ary_len(struct mrb_state* mrb, mrb_value array) {
return mrb_ary_len(mrb, array);
long long mrb_ext_ary_len(struct mrb_state* mrb, mrb_value array) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function has been dropped in favour of RARRAY_LEN

@@ -35,6 +36,9 @@ mkdir -p mruby-out/src/mrbgems

cd mruby-$VERSION

# Use only supported gems.
cat $DIR/mrusty.gembox > mrbgems/default.gembox
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed for minirake not to create _init / _final functions for mruby-io and mruby-bin*.

# Copies all gems.

cp -R mrbgems/* ../mruby-out/src/mrbgems
cp -R build/host/mrbgems/* ../mruby-out/src/mrbgems

# String needs additional mruby header.

sed -i -e $'s/#include "common.h"/#include "mruby.h"\\\n#include "common.h"/g' include/mruby/string.h
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange thing, string.h causes dozen undefined type errors without it.


# Copies header files so they will be available in top level includes.

find include/mruby -type f -name '*.h' -exec cp {} ../mruby-out/include \;
Copy link
Author

@mlga mlga Oct 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mruby-pack has includes in form of header.h instead of mruby/header.h.

# Copies ext header files required by gems.

mkdir -p ../mruby-out/include/mruby/ext
find mrbgems -path '*/ext/*' -name '*.h' -exec cp {} ../mruby-out/include/mruby/ext \;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, copies only ext/io.h.

@@ -0,0 +1,88 @@
MRuby::GemBox.new do |conf|
# Use standard IO/File class
# conf.gem :core => "mruby-io"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one was problematic.

@dragostis
Copy link
Member

Rust crates one binary that runs all the tests. I would suggest isolating this to one specific test first so that you know exactly where the segmentation fault is caused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants