-
Notifications
You must be signed in to change notification settings - Fork 698
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
merge into upstream! #21
Comments
We'd love to. Some of the modifications might be servo-specific though, so we should be careful when merging. |
We've consolidated all the forks we knew about in servo/rust-bindgen. I don't think we were aware of yours. It would be highly preferable for there to be a single rust-bindgen. If it looks possible to consolidate these, I think we'd love to do it. Perhaps we should ask the Rust team if this is appropriate to move to rustlang/bindgen or something more official. |
In fact, crabtw transfered me the ownership since he was inactive since a few months and I was the only commiter ^^ |
Huh. I thought we had asked crabtw to transfer it to us a long time ago and he preferred not to do that. In any case, it's all water under the bridge and we should try and get down to a single bindgen if at all possible. |
I agree. What do you suggest? |
Someone needs to look at the commit history since the forks diverged and see how much work it is to unify, and then we need to do the unification. And then we need to decide where the official repo will be, and then recreate personal forks to be from that one. Finally, we'll need to hook up CI and decide on reviewers and such. I think there are approximately 3-4 people on the Servo team who've been contributing to bindgen. The main piece of work is the first part. The rest is relatively trivial. |
So I tried the "YOLO rebase the world on top of upstream approach" a while ago, and it didn't work as well as I'd expected, there are a lot of non-trivial changes, so I think the way to go is upstreaming features individually. But that's a really time consuming thing to do. Probably one of the easiest part that would simplify a lot upstreaming more features is upstreaming the On top of that, I think the best approach is porting our tests, and making them pass one at a time, since there are a few tricky cases there. I'd love to do this, but unfortunately I don't think I'll have the time to do it near-term. Nonetheless, does that approach sound good to you? |
yeah, yolo is not a good approch in this case ^^ |
in fact, WIP on clang.rs |
Just finished clang.rs. It changes the supported clang version requirement:
See http://llvm.org/releases/. Ok for 3.6, but 3.8 was released on march and 3.9 even after, so it may not be too supported. Are these functions really needed? |
That's one of the reasons we haven't switched to clang-sys completely. We need to be able to compile on stable clang, but llvm 3.9 is needed for SpiderMonkey bindings. We use conditional compilation for that, and it seems to me that clang-sys have added support for that, so we could keep compiling conditionally. |
Could you list the features that needs clang 3.9? |
Basically the ability to detect if a function is inlined and don't generate bindings for these, because they generated missing symbols. The other 3.9 function is the named type thing, which is a backwards incompatible change from clang that was needed to fix bindgen on llvm 3.9 |
In #31 I'm adding the last test from upstream that isn't in our test suite. @Yamakaky, would you consider making this bindgen the canonical one? I think there's no situation yours can handle that ours doesn't, and even though we lose some things, like the change from manual option parsing to docopt, I don't consider those a priority right now. |
Did you go through https://github.com/Yamakaky/rust-bindgen/blob/master/Changelog.md to check? |
FWIW, we need 3.9 for generating Windows bindings, because Clang 3.8 doesn't parse MSVC2015's headers properly. Nevertheless, 3.9 has been released :) |
Not yet in brew though. |
Going back to it! I really want us to merge, especially since your refactoring. I'll try to open issues about features missing in your fork. The main problem I have is the dependency to clang 3.8... Do you think it would be reasonable to use conditional compilation to reduce this version, like disabling c++ support? BTW, would it be possible to add me as a maintainer? |
This fork does not support expression parsing in macros. |
Fair enough, there you go: #219 :) |
@jethrogb did you find other things to merge? |
Just taking a quick look at https://docs.rs/bindgen/0.19.1/bindgen/struct.Builder.html and the same page generated from this fork, there are a bunch of missing features. |
So most of them, at least as far as I know, are intentionally For example:
|
What about:
|
Yeah I really don't know what the best way to handle this would be. You really need more context to say anything about these. As I mentioned in #219 some kind of post-processing could work. Alternatively, the user could pass in a closure that's used for determining the type. |
It seems that the API I added over in #219 is going to help with the macro type thing.
|
That's not the same because it doesn't work at the file level. If I understand correctly, with that API I need to add about 1600 whitelisted items plus I need to go through all the changes everytime there is an upstream update to add more?
This is exactly what rust_enums(false) does.
Ok. It was buggy in upstream but maybe you've fixed everything in that regard :) |
Items are whitelisted recursively, so in practice it's not bad. |
From mbedtls-sys-auto:
I don't think recursiveness is going to help reducing those const and fn numbers. |
You can specify regexes while whitelisting. That should help for any API that is midly consistent. |
Indeed, what we do for Gecko is |
That being said, probably that should be better documented. |
Oh. That's not at all clear from the documentation indeed. That would probably work for me (depending on the interaction with remove_prefix) |
I'll try to run this on mbedTLS sometime this weekend to check. I'm using a lot of bindgen features there but I can't guarantee I'm using all of them, so don't assume my blessing is enough :) |
FWIW, this works as a near drop-in replacement for the crabtw version for my cassandra-sys-rs project. |
Glad to hear that! :) FWIW it is now on crates.io: |
oh i totally missed that. thanks so much. |
Did you consider to merge your modifications into my repo? We both added a lot of features, it would be great if we could join forces.
The text was updated successfully, but these errors were encountered: