Simplify setup by updating mspec, using a mrbgem and a MSpec config file #1

Merged
merged 1 commit into from Sep 18, 2016

Conversation

Projects
None yet
2 participants
@eregon
Contributor

eregon commented Sep 16, 2016

This also uses the bin/mspec binary which sets up the proper environment variables.

@eregon eregon referenced this pull request in ruby/mspec Sep 16, 2016

Closed

Support mruby #16

@@ -22,7 +22,8 @@
conf.gem :mgem => "mruby-onig-regexp"
conf.gem :mgem => "mruby-method"
conf.gem :mgem => "mruby-catch-throw"
- conf.gem :github => "kou/mruby-pp"
+ conf.gem :github => 'haconiwa/mruby-exec'

This comment has been minimized.

@ksss

ksss Sep 17, 2016

Owner

Where do you use?

@ksss

ksss Sep 17, 2016

Owner

Where do you use?

This comment has been minimized.

@ksss

ksss Sep 17, 2016

Owner

OK, I found here

@ksss

ksss Sep 17, 2016

Owner

OK, I found here

This comment has been minimized.

@eregon

eregon Sep 17, 2016

Contributor

Yes, it's going to be much more practical to use other commands as well.
But maybe we can avoid the exec if we can see that the target ruby is the same.

@eregon

eregon Sep 17, 2016

Contributor

Yes, it's going to be much more practical to use other commands as well.
But maybe we can avoid the exec if we can see that the target ruby is the same.

todo/rbconfig.rb
-
- def split(path)
- [File.dirname(path), File.basename(path)]
- end

This comment has been minimized.

@ksss

ksss Sep 17, 2016

Owner

Yes, File.split doesn't use on ruby/mspec.
But, ruby/spec is using it. (e.g. require_spec and of cause File.split)

How do you think in this case?

@ksss

ksss Sep 17, 2016

Owner

Yes, File.split doesn't use on ruby/mspec.
But, ruby/spec is using it. (e.g. require_spec and of cause File.split)

How do you think in this case?

This comment has been minimized.

@eregon

eregon Sep 17, 2016

Contributor

I think this should get implemented in a mrbgem and not here then, since it does not prevent running other specs. But if you use it to validate mruby-require then of course it's a good workaround in the meantime.

@eregon

eregon Sep 17, 2016

Contributor

I think this should get implemented in a mrbgem and not here then, since it does not prevent running other specs. But if you use it to validate mruby-require then of course it's a good workaround in the meantime.

This comment has been minimized.

@eregon

eregon Sep 17, 2016

Contributor

I removed the commit removing this.

@eregon

eregon Sep 17, 2016

Contributor

I removed the commit removing this.

This comment has been minimized.

@ksss

ksss Sep 18, 2016

Owner

I agree that we should get implemented in a mrbgems.

However, require-spec should remove dependency to File.split.
But I also think that it's difficult to remove all dependency.

It's OK like this.

@ksss

ksss Sep 18, 2016

Owner

I agree that we should get implemented in a mrbgems.

However, require-spec should remove dependency to File.split.
But I also think that it's difficult to remove all dependency.

It's OK like this.

@ksss

This comment has been minimized.

Show comment
Hide comment
@ksss

ksss Sep 17, 2016

Owner

I've been tried this branch.
This fix really awesome.

But, I want to method to debug by gdb or lldb.
In this cause, I cannot do.
Because over the exec(2).

$ lldb mruby/bin/mruby
(lldb) target create "mruby/bin/mruby"
Current executable set to 'mruby/bin/mruby' (x86_64).
(lldb) run mspec/bin/mspec -B mruby.mspec spec/language
Process 73052 launched: '/Users/yuki/src/github.com/ksss/mruby-spec/mruby/bin/mruby' (x86_64)
Process 73052 stopped
* thread #1: tid = 0x396a94, 0x00007fff5fc01000 dyld`_dyld_start, stop reason = exec
    frame #0: 0x00007fff5fc01000 dyld`_dyld_start
dyld`_dyld_start:
->  0x7fff5fc01000 <+0>: popq   %rdi
    0x7fff5fc01001 <+1>: pushq  $0x0
    0x7fff5fc01003 <+3>: movq   %rsp, %rbp
    0x7fff5fc01006 <+6>: andq   $-0x10, %rsp

And I also try do mspec/bin/mruby-run.
But this way cannot end process.
(Maybe cause is ruby/spec@9daa861)

$ mruby/bin/mruby mspec/bin/mspec-run spec/core/nil
[| |                   0%                     | 00:00:00]      0F      0E^C
Process aborted!

$ ruby mspec/bin/mspec-run spec/core/nil
[| |                   0%                     | 00:00:00]      0F      0E^C
Process aborted!

ruby/spec: ruby/spec@9daa861
ruby/mspec: ruby/mspec@ef6e996

How do you think?

Owner

ksss commented Sep 17, 2016

I've been tried this branch.
This fix really awesome.

But, I want to method to debug by gdb or lldb.
In this cause, I cannot do.
Because over the exec(2).

$ lldb mruby/bin/mruby
(lldb) target create "mruby/bin/mruby"
Current executable set to 'mruby/bin/mruby' (x86_64).
(lldb) run mspec/bin/mspec -B mruby.mspec spec/language
Process 73052 launched: '/Users/yuki/src/github.com/ksss/mruby-spec/mruby/bin/mruby' (x86_64)
Process 73052 stopped
* thread #1: tid = 0x396a94, 0x00007fff5fc01000 dyld`_dyld_start, stop reason = exec
    frame #0: 0x00007fff5fc01000 dyld`_dyld_start
dyld`_dyld_start:
->  0x7fff5fc01000 <+0>: popq   %rdi
    0x7fff5fc01001 <+1>: pushq  $0x0
    0x7fff5fc01003 <+3>: movq   %rsp, %rbp
    0x7fff5fc01006 <+6>: andq   $-0x10, %rsp

And I also try do mspec/bin/mruby-run.
But this way cannot end process.
(Maybe cause is ruby/spec@9daa861)

$ mruby/bin/mruby mspec/bin/mspec-run spec/core/nil
[| |                   0%                     | 00:00:00]      0F      0E^C
Process aborted!

$ ruby mspec/bin/mspec-run spec/core/nil
[| |                   0%                     | 00:00:00]      0F      0E^C
Process aborted!

ruby/spec: ruby/spec@9daa861
ruby/mspec: ruby/mspec@ef6e996

How do you think?

@eregon

This comment has been minimized.

Show comment
Hide comment
@eregon

eregon Sep 17, 2016

Contributor

mspec-run was not really designed to be run directly as it needed some specific environment setup.
But I fixed it, so now it should work, at least for basic cases, could you retry with latest mspec and rubyspec?

We could also try running a spec file directly, but we would need a way to tell mruby to add mspec/lib to the load path (and it does not seem to support -I).

Contributor

eregon commented Sep 17, 2016

mspec-run was not really designed to be run directly as it needed some specific environment setup.
But I fixed it, so now it should work, at least for basic cases, could you retry with latest mspec and rubyspec?

We could also try running a spec file directly, but we would need a way to tell mruby to add mspec/lib to the load path (and it does not seem to support -I).

@ksss

This comment has been minimized.

Show comment
Hide comment
@ksss

ksss Sep 18, 2016

Owner

Great work.
Thank you for improving.

Owner

ksss commented Sep 18, 2016

Great work.
Thank you for improving.

@ksss ksss merged commit 9743ba6 into ksss:master Sep 18, 2016

@eregon eregon deleted the eregon:use_mrbgem_and_config branch Sep 18, 2016

eregon added a commit to ruby/spec that referenced this pull request Sep 18, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment