Skip to content
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

Linux support #3

Closed
dylanede opened this Issue Feb 5, 2015 · 21 comments

Comments

Projects
None yet
3 participants
@dylanede
Copy link
Owner

dylanede commented Feb 5, 2015

I have tested cef-sys bindings on Mac and Windows, but I need to run rust-bindgen on Linux before it will work on that platform.

@dylanede dylanede added the enhancement label Feb 5, 2015

@palodequeso

This comment has been minimized.

Copy link

palodequeso commented Feb 10, 2015

Can you send me the ffi.h file again, along with the bindgen command to get this going? I think it was my clang version but have since formatted and re-installed linux and forgot to back this information up.

@dylanede

This comment has been minimized.

Copy link
Owner Author

dylanede commented Feb 10, 2015

OK. The ffi.h is here. The command to run is

bindgen ffi.h -I include -I include/capi -o ffi.rs -match cef_

And, most importantly, the version of CEF required is 3.2271.1981, downloadable from here. Click on More revisions to get the list of older versions.

Thanks!

@palodequeso

This comment has been minimized.

Copy link

palodequeso commented Feb 10, 2015

Crap, same exact issue.

douglas@douglas-lappy:~/Downloads/cef_binary_3.2271.1981_linux64$ LD_PRELOAD=/usr/lib/libclang.so bindgen ffi.h -I include -I include/capi -o ffi.rs -match cef_
include/capi/cef_app_capi.h:41:10: fatal error: 'include/capi/cef_base_capi.h' file not found
ERROR:bindgen: include/capi/cef_app_capi.h:41:10: fatal error: 'include/capi/cef_base_capi.h' file not found
@dylanede

This comment has been minimized.

Copy link
Owner Author

dylanede commented Feb 10, 2015

Hmm. Maybe try using ./include instead of include for local paths?

Edit: Or maybe even just use full absolute paths.

@palodequeso

This comment has been minimized.

Copy link

palodequeso commented Feb 10, 2015

No dice.

On Tue Feb 10 2015 at 1:50:06 PM Dylan Ede notifications@github.com wrote:

Hmm. Maybe try using ./include instead of include for local paths?


Reply to this email directly or view it on GitHub
#3 (comment).

@dylanede

This comment has been minimized.

Copy link
Owner Author

dylanede commented Feb 10, 2015

See my edit to my comment.
On 10 Feb 2015 18:54, "Douglas Eugene Reisinger II" <
notifications@github.com> wrote:

No dice.

On Tue Feb 10 2015 at 1:50:06 PM Dylan Ede notifications@github.com
wrote:

Hmm. Maybe try using ./include instead of include for local paths?


Reply to this email directly or view it on GitHub
#3 (comment).


Reply to this email directly or view it on GitHub
#3 (comment).

@palodequeso

This comment has been minimized.

Copy link

palodequeso commented Feb 10, 2015

This is what I tried:

LD_PRELOAD=/usr/lib/libclang.so bindgen ffi.h -I /home/douglas/Downloads/cef_binary_3.2271.1981_linux64/include -I /home/douglas/Downloads/cef_binary_3.2271.1981_linux64/include/capi -o ffi.rs -match cef_

I still get the same error.

@dylanede

This comment has been minimized.

Copy link
Owner Author

dylanede commented Feb 10, 2015

Ah, maybe you should add -I ..

@dylanede

This comment has been minimized.

Copy link
Owner Author

dylanede commented Feb 10, 2015

So the command should be

bindgen ffi.h -I . -I include -I include/capi -o ffi.rs -match cef_
@palodequeso

This comment has been minimized.

Copy link

palodequeso commented Feb 10, 2015

That makes a lot of sense, now it's complaining about some other missing header:

douglas@douglas-lappy:~/Downloads/cef_binary_3.2271.1981_linux64$ LD_PRELOAD=/usr/lib/libclang.so bindgen ffi.h -I . -I include -I include/capi -o ffi.rs -match cef_
/usr/include/limits.h:123:16: fatal error: 'limits.h' file not found
ERROR:bindgen: /usr/include/limits.h:123:16: fatal error: 'limits.h' file not found

What's interesting is limits.h is definitely in /usr/include. I'm wondering if clang needs some other ordering for it to use the right one first.

@dylanede

This comment has been minimized.

Copy link
Owner Author

dylanede commented Feb 10, 2015

Try adding -I /usr/include.

@jdm

This comment has been minimized.

Copy link

jdm commented Feb 10, 2015

My experience with rust-bindgen is that I occasionally need to include arguments like -isystem /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/ to get it to find the right system headers. See https://github.com/servo/rust-mozjs/blob/master/gen.py for an example.

@palodequeso

This comment has been minimized.

Copy link

palodequeso commented Feb 10, 2015

Try adding -I /usr/include.

Unfortunately, that didn't work either.

My experience with rust-bindgen is that I occasionally need to include arguments like -isystem /usr/lib/gcc/x86_64-redhat-linux/4.7.0/include/ to get it to find the right system headers. See https://github.com/servo/rust-mozjs/blob/master/gen.py for an example.

I'll give that a go.

@dylanede

This comment has been minimized.

Copy link
Owner Author

dylanede commented Feb 10, 2015

Then maybe it should be -isystem /usr/include

@jdm

This comment has been minimized.

Copy link

jdm commented Feb 10, 2015

@dylanede It seems to be finding /usr/include/limits.h already, since that's where the error is. I'm presuming the line in question is an #include_next or whatever gcc uses to forward to a special system header.

@palodequeso

This comment has been minimized.

Copy link

palodequeso commented Feb 10, 2015

nah, it has to point to the actual include files, not anything wrapping those files:
Check out https://github.com/servo/rust-mozjs/blob/master/gen.py

I'm going to try to make it mimic that.

@palodequeso

This comment has been minimized.

Copy link

palodequeso commented Feb 10, 2015

This worked:

LD_PRELOAD=/usr/lib/libclang.so bindgen ffi.h -I . -I include -I include/capi -o ffi.rs -match cef_ -isyem /usr/lib/llvm-3.5/lib/clang/3.5.0/include/

https://gist.github.com/palodequeso/c13b08b8e95a968fc7dd

@palodequeso

This comment has been minimized.

Copy link

palodequeso commented Feb 10, 2015

@dylanede is that what you needed?

@dylanede

This comment has been minimized.

Copy link
Owner Author

dylanede commented Feb 10, 2015

That should do the trick, thanks! I don't have the time immediately to check the validity of the result but I should be able to within the next hour. Thanks again!

@dylanede dylanede referenced this issue Feb 10, 2015

Merged

Linux support #4

@dylanede

This comment has been minimized.

Copy link
Owner Author

dylanede commented Feb 10, 2015

@palodequeso Could you try the linux_support branch to see if this works? Be warned that this is probably a few nightlies behind. I haven't tested with the latest one to see if anything is broken.

@palodequeso

This comment has been minimized.

Copy link

palodequeso commented Feb 11, 2015

I made a comment on the branch. :)

@dylanede dylanede closed this in #4 Feb 12, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.