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

Support mruby 2.1.0 #75

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Support mruby 2.1.0 #75

wants to merge 11 commits into from

Conversation

take-cheeze
Copy link

@take-cheeze take-cheeze commented Dec 17, 2019

  • These tests are disabled temporary:
    • Use after free GC test
    • Nested exception raise test
  • Dropped support of 1.10 since staticcheck(ex-megacheck) doesn't support it
  • Using mruby-error gem(mrb_protect function) instead for exception handling.

@erikh
Copy link
Collaborator

erikh commented Dec 17, 2019

Hey! Awesome!

If you don't mind at least making sure it tests on 1.13 I would greatly appreciate it. It's in the .travis.yml file at the root of the repo.

I can work on 1.12 and getting go modules working after this patch is ready.

Thanks for contributing!

@erikh
Copy link
Collaborator

erikh commented Dec 17, 2019

oh, to clarify, I think dropping 1.10, and 1.11 support is probably worth it if it causes you to write unnecessary workarounds or other complexity.

@mitchellh I think I'm making a safe judgment call, but please shout out if you disagree.

@take-cheeze
Copy link
Author

@erikh CI should be working now

Copy link
Collaborator

@erikh erikh left a comment

Choose a reason for hiding this comment

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

Looks great! However, two tests are being ignored in the suite, which I think should be resolved or at least discussed before I can comfortably merge this.

@@ -14,11 +14,11 @@ lint:
sh golint.sh

megacheck:
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we rename this task to 'staticcheck'? also, nice catch, thanks!

@@ -11,7 +11,7 @@ type CompileContext struct {
ctx *C.mrbc_context
filename string
mrb *Mrb
captureErrors bool
// captureErrors bool
Copy link
Collaborator

Choose a reason for hiding this comment

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

please remove this line if it's not being used

@@ -43,7 +43,9 @@ func TestIsDead(t *testing.T) {

mrb.Close()

/*
Copy link
Collaborator

Choose a reason for hiding this comment

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

why is this test commented out?

Copy link
Author

Choose a reason for hiding this comment

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

This causes use after free in sanitizer enabled env and it shouldn't be tested with go test

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the major point of this test is to run that block that's commented out; is there any way to re-enable the test? This feels like a change in API.

Copy link
Author

Choose a reason for hiding this comment

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

I don't care how you feel.
You should never touch freed memory.

@@ -635,6 +635,10 @@ func TestMrbStackedException(t *testing.T) {
}

mrb.Close()

// TODO(take-cheeze): Test below
return
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's make sure we pass all tests before merge.

Copy link
Author

Choose a reason for hiding this comment

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

I need to fix mruby itself to make this work.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I need this functionality for my own projects that depend on go-mruby. What changed between 1.2 and 2.1 that caused this to break?

Copy link
Author

Choose a reason for hiding this comment

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

@mitchellh
Copy link
Owner

oh, to clarify, I think dropping 1.10, and 1.11 support is probably worth it if it causes you to write unnecessary workarounds or other complexity.

@mitchellh I think I'm making a safe judgment call, but please shout out if you disagree.

Totally safe. I think generally N, and N-1 are the versions you want to support which gives you 1 year of backwards support (Go is on 6mo cycles). Go 1.13 in particular was a rough version for a lot of projects to upgrade to due to major changes in Go modules behavior (we struggled at HashiCorp).

This is awesome though. Thanks @take-cheeze and @erikh!

enable_debug
end

gem core: 'mruby-error'
Copy link
Collaborator

Choose a reason for hiding this comment

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

I didn't notice this before, and I'm sorry about this. We can't depend on external gems here, I hope you realize. The whole point of having this environment this way is that the user can customize it.

This breaks nearly everything I depend on in this library. Is there any way we can bring in the changes that mruby-error provides directly? We had healthy gc arena code in the codebase before. was it removed?

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.

None yet

4 participants