-
Notifications
You must be signed in to change notification settings - Fork 707
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
Bindgen doesn't work on with MSVC #67
Comments
@emilio could you have a look? |
It's choking to parse some LLVM3.9-specific type that isn't handled. I'm looking into it, shouldn't be hard to fix. Seems like a good moment to upgrade to LLVM 3.9 by default. |
I've been using llvm 3.9 for quite a while, so I suppose that may not be relevant. |
The rewrite chokes on errors and doesn't just ignore it, so yeah, it is relevant. |
Problems found:
|
The mangling crash looks very much a clang bug. It always crashes at static const I guess we may want to switch off mangling for now, and probably try to file a bug to clang. |
It crashes with this minimal example: template<class M> struct A;
template<class C> struct A<void(C::*)()> { static int v; }; Wait... but how can a static variable in a template class has a mangling name?! It isn't linkable at all, so it actually makes no sense to try to generate mangling name for it. |
Hmmm, bindgen fails to work again on Windows. It panicked for nonexisting item:
|
This one looks like a bindgen bug, could you post a RUST_LOG=bindgen On Oct 19, 2016 7:50 AM, "Xidorn Quan" [email protected] wrote:
|
I'm somewhat surprised that the latest changes have introduced MSVC-only regressions, but I guess... #85 is the most likely regressor? Either that, or MSVC headers have changed and now have more dark magic. |
I'm not aware of any update to MSVC's headers, so I suppose that is not the reason. |
The log: log.zip |
This is the file in question: xtr1common.zip Looks like the unrecognized thing is the alias template. |
The file in question itself doesn't actually cause the bindgen to panic. Then I have no idea. |
So, after reading the log I think I know what's going on, and I don't like that at all. So turns out clang can generate duplicated Basically, what I think happens after reading the log is something like:
In any case, this is fixable (I think), by storing the type we just found as a resolved type refernce to the new type found. I think this is the proper and elegant solution and shouldn't be hard. Another less elegant solution is adding a fallible canonical name to do the whitelist checking, since it seems we choke at that point. |
I think we can close this for now :) |
I tried to investigate this, but failed. It throws lots of errors. See the attached log: bindgen.zip
This log gives me an impression that it just fails to parse everything.
My Clang version is:
The text was updated successfully, but these errors were encountered: