-
Notifications
You must be signed in to change notification settings - Fork 743
Problems binding to Resonance Audio - failing cargo layout tests, methods generated as free functions, probable struct return problem #1392
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
Comments
That's #380 I think. A standalone test-case that reproduces the issues would be much appreciated.
Which OS is this? How do you create a class? I don't think such simple method should crash. |
MSVC x64, windows 10 1803. The arguments to both the constructor and source creation function are also very simple - just ints. Maybe the other possibility is a problem with how the constructor from Rust is defined.
|
I'll also test the equivalent code in C++ just to be 100% sure. |
Yeah, IIRC the reason we don't generate methods on MSVC is because they use the |
That should allow you to call |
Hm, I think I'm already using nightly. In build.rs, I have
Is there something else I need to do to enable it? I'm on the latest nightly currently, MSVC 2017.8. |
Hmm, that's weird, we allow generating Is that method virtual by any chance, or something like that? May that explain that / the crash? Again, a test-case that repros this in a standalone manner is the best way to investigate. |
@emilio I'll try installing creduce using the windows subsystem for linux, once the |
I have the following in the .sh file:
and am invoking it in the same directory where I cloned bindgen. I've also placed Then I tried pointing it to |
While trying to run
|
Looks like we need to normalize the path here: But not sure what's the format rust expects or what not. |
Do those tests compile fine in Linux? |
Yes |
(We run them on automation) |
But on linux the path separator is of course different. It may be a matter of changing that |
That appears to do the trick, but now I get the following errors. Pasting all 12 errors which are the same, just different occurances in the same file, in case source code changes are needed to fix. I'm on a 64 bit machine, I wonder if this is caused by a nightly bug.
|
Are you compiling with a 32-bit target by any chance? |
|
(on the root bindgen directory). |
Nope, unless rust-bindgen itself is configured to. I have only the x86-64 (64-bit) toolchain installed. |
Running |
I've just tried defining a struct, and attempting to transmute its address into a u32, and it fails, as expected. So I think its something to do with those specific files Bindgen has specifically. |
Hmm, can it be that the rust What does |
I'm not at my computer currently, but based on this page after some googling and my own memory, I'm almost certain that longs are 32-bit, even on 64 bit windows, and that you need long long for 64-bit integers. I'll test once I'm back. |
On MSVC 2017.8.2, x86 and x64. source
output
|
Is there a way for me to only run the win32 nightly.rs test file to circumvent these errors? Also, how do I use the |
Oh god, I feel so stupid.
I only noticed the extra I'm not sure how conversion is defined to |
I ran into another access violation when trying to call some other methods on this class, even though the layout test for this class passes. The method does create instances of objects which have failing layout tests, so I'm not sure if that might be the cause. In this case, I was able to work around it by having some glue code in C++ which returns a pointer to an instance of this object on the heap, and using that as the this pointer. |
If you could reduce the test-case for the layout failures I'd be interested in taking a look when I have the time. So sorry for the lag in replying here, too :( |
How do I use the |
Hi,
I'm attempting to create bindings for Resonance audio. Here are some things I've noticed, which I'm not sure might be part of the cause:
cargo test
, there are numerous failures, and I noticed the failing test cases are either:comes out as
The text was updated successfully, but these errors were encountered: