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

Incorporate bindgen support #96

Open
nastevens opened this issue Feb 10, 2021 · 4 comments
Open

Incorporate bindgen support #96

nastevens opened this issue Feb 10, 2021 · 4 comments

Comments

@nastevens
Copy link
Member

Adapted from #75

Presumably there is a large crossover between people using meta-rust-bin and people who need to interface C with Rust. Providing a "paved path" for using bindgen would therefore be useful.

I am unaware of any existing recipes/layers to support bindgen in yocto right now but would be happy to be proven wrong.

@hellow554
Copy link
Contributor

#75 (comment)

I'm not sure that it belongs directly in this layer

I mean, where else? This layer is about compiling software with Rust. That includes bindgen as well, because it's part of the rust ecosystem.
So IMHO it should be meta-rust-bins job to tell clang/bindgen where the real sysroot is.

I can see, that this is very specific to one package (namely bindgen) and other may have different quirks (I don't know anything about cbindgen or similar).

So, either we can have a generic environment variable, e.g. CLANG_ARGS which will be accepted by all packages that need to deal with it, or we try to reach the maintainer of said packages and ask for their 2 cents on this topic.

@hellow554
Copy link
Contributor

ping @nastevens :)

@TopperBG
Copy link

Any workout here?
I'm investigate simillar issue with crosscompilation of redisjson and pretty sure that one could be the root of bindgen problems
rust-lang/rust-bindgen#1915
But it's implented patch already ?

@hellow554
Copy link
Contributor

As a Workaround use #75 (comment)

export BINDGEN_EXTRA_CLANG_ARGS
BINDGEN_EXTRA_CLANG_ARGS = "--sysroot=${WORKDIR}/recipe-sysroot -I${WORKDIR}/recipe-sysroot/usr/include"

use it like this:

$ cat my-file.bb
inherit cargo

export BINDGEN_EXTRA_CLANG_ARGS
BINDGEN_EXTRA_CLANG_ARGS = "--sysroot=${WORKDIR}/recipe-sysroot -I${WORKDIR}/recipe-sysroot/usr/include"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants