Open redeexpressos opened 1 month ago
I don't think calling apt-get install
, etc. would make sense in the Yocto context. I suggest to try to modify your bit bake recipe to include protoc in the native sysroot, that's hopefully in the path. Something like DEPENDS += " protobuf-native"
@tronical Thanks for answering. However, doesn't this layer use cross
to build? When I use Cross, I also have to install protoc
via a Cross.toml
like this:
[build]
default-target = "armv7-unknown-linux-gnueabihf"
pre-build = [
"dpkg --add-architecture $CROSS_DEB_ARCH",
"apt-get update && apt-get --assume-yes install protobuf-compiler:$CROSS_DEB_ARCH",
]
However, doesn't this layer use cross to build?
No, meta-rust-bin
does not use cross
to build. In fact, it doesn't build rust, it fetches the right binaries and makes them available (via bit bake classes) to recipes for invocation. The actual build of crates compiled with meta-rust-bin happen inside the yocto/bitbake environment, not inside a docker container (like cross). In short, cross-compilation with meta-rust-bin
is like calling cargo build --target=aarch64-unknown-linux-gnu
(or similar), along with a cargo config set up to invoke the correct linker, set the right sysroot, etc - behind the scenes.
Trying to build a crate that depends on
protoc
. When cross-compiling, I have to addCross.toml
:How can I add that configuration when compiling with this layer?