-
Notifications
You must be signed in to change notification settings - Fork 699
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
Don't force users to manually install llvm/clang #78
Comments
Another issue I've had with this is that every time I |
Building llvm takes forever - we definitely shouldn't vendor it in bindgen. The medium-term plan is just to make llvm a compile-time system dependency of mozilla-central. |
I built it like three times the other day when I kept messing up my bindgen, and that really sucked, but I wouldn't say it was really any worse than three clobber builds on m-c. And if we do the vendoring properly, people will only need to build it the once and never again.
I don't see how this is really that different in practice. Either way, you'll need to compile llvm. Additionally, with statically linking llvm, we won't need to |
This is really bad if you're not on a great machine. Back in the day when I used to have a not-awesome laptop, Servo still used to download rustc and build from scratch. This included an llvm build. This would take 6 hours. But it's a one-time thing so maybe it's fine? |
Can we depend on system libclang being around and just fail compile if it is not detected? That is sort of the normal compromise here. To make it completely foolproof, I don't see a way around building libclang. |
No, because you get it from your system package manager (i.e. brew).
Yes, that is the plan. We will depend on it like we depend on a C++ compiler. |
(And we will need to, because we're going to be generating the bindings on-the-fly when we compile Firefox, and we obviously don't want Firefox builds to start compiling LLVM) |
This is my goal for the JS bindings, as well. And then we would just take snapshots from m-c for servo/[rust-]mozjs (and probably combine them into one repo at that point).
This works for me if we can figure out how to avoid the |
We are doing this near-term for stylo anyway :-) |
Some related thoughts: Whenever I need the Most of the time, I use bindgen as a library in
I know the LLVM stuff is hard, but I wonder if you'd be interested in other ways to reduce the pain of generating bindings on-the-fly, such as stripping out certain dependencies when using bindgen as a library? I could kill two birds with one stone by making |
That's a known pain point, and we'd like to eventually get rid of that feature. LLVM 3.9 is getting a larger adoption now, so it should be doable to remove it. Though a way of making it seamlessly work with older versions would be awesome too (maybe weak linkage or
That seems reasonable, I'd be happy to accept a patch that does that :) |
I think we've decided not to pursue this. I could see maybe |
The
bindgen
installation + use workflow I'd like to have would be:And that's it. No more wrangling
[DY]LD_LIBRARY_PATH
either.Right now, we are very far from that.
I think we need two things to get there:
build.rs
. This seems easy enough.@emilio how feasible do you think this is?
The text was updated successfully, but these errors were encountered: