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
mrbc 3.2.0 - custom module method not resolved #5993
Comments
I need more information. Could you provide the whole process to create and execute your program, please? |
Yes, sorry for the late reply. In the makefile I have a line that take a
Then in the C program, // main.c
#include "test.c"
// ...
mrb_rng_init(mrb); // function that call mrb_define_module and mrb_define_module_function
v = mrb_load_irep(mrb, test_rb);
// ... After that I just run the C exectuable. mrbc -v on 3.2.0
mrbc -v on 3.1.0
|
I could not reproduce the issue with mruby 3.2.0 on both Linux and MacOS. |
Sure, here under you can find the whole code. Thank you for your help! |
It still works for me. I needed to tweak a little for Linux environment, though.
I'm confusing. We used very similar environments and we got very different results. Do you use Intel Mac or M1 (or M2)? According to your report, |
The core of this issue is the following compiled binary:
If I can reproduce this file on my machine, I am sure I can fix the issue. If you can regenerate the above file, please explain how to regenerate the file in the step by step description. |
I'm using an intel mac. I can reproduce this file everytime I use mrbc from 3.2.0 (either with mrbc I get when I compile mruby from source on the master branch, or with mrbc from homebrew install) for example
And 3.1.0
|
OK, I will try to get Intel Mac. |
By the way, do you use clang version 13? We see similar issues with clang 13 lately. |
I don't remember if it was clang 13. I think I've updated my system since then. Right now I have clang 14.0.0 |
Could you tell us more information please? Versions of OS, clang, type of CPU or whatever that may affect? |
Here are some more information Please tell me if you need more details.
I compiled mruby from this commit: 87260e7 (tag: 3.2.0) |
Could you please try the latest master if possible? |
I think I finally understood 🫣 I noticed there are two mrbc binaries.
On master and 3.2.0, only On ruby 3.1.0 tag branch, both mrbc work. |
Hello.
I recently tried to update from 3.1.0 to 3.2.0
But I'm encountering a weird problem with mrbc.
For example, in the C program, I define the following module and method:
And I have the following mruby script that I want to call from the C program:
When I compile it with
mrbc 3.2.0
I get the following output:If I execute the C program, I get the following error from mruby
We can see in the mrb disassembly above
000000a0 [...] Rng...sum
With
mrbc 3.1.0
, I don't get the same issue,randint
symbol is left as is, as we can see in the hexdump below:If I modify the script slightly:
Now I get
Rng...100.0
with mrbc 3.2.0. So it seems to take the last symbol of the script instead ofrandint
.I don't really understand what's going on. I couldn't find any information in the release note or in the issues. Has anything changed about how mrbc operates ?
I've compiled mruby myself, on macos 13.1
I get the same error with mruby from homebrew.
The text was updated successfully, but these errors were encountered: