-
Notifications
You must be signed in to change notification settings - Fork 62
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
Is cargo-bitbake useless? (at least for newer Yocto releases) #83
Comments
This repository is like a honey-pot for wasted effort up-rev'ing dependencies:
|
Yeah and even the repository is a landfill of PRs and issues. Some, like #82, are even getting approved. For what? |
My company is sadly still stuck on dunfell (lol don't ask), and in many ways we really just don't have the yocto knowledge to not use things like cargo bitbake. It's that one arcane thing we reached for forever ago, and now we are deeply dependent on it and a host of other hacks. We also maintain our own fork, but are excited to get off the tool as soon as we can upgrade to some yocto distribution that has something better (or ideally separating our Rust toolchain management from yocto so we also can stop using Rust 1.71! As soon as we find the time lol) I even have my own cursed PR where I just read from the Cargo.lock file in the landfill (#71), because when I looked into cargo bitbake I was real confused and didn't understand why we needed to do package resolution. I'm not sure if there's a "Guide to using Rust with Yocto: 10 things you should avoid, and patterns you should be using" but I would love to see it, and couldn't help but +1 this issue |
Good to know this is an option. I'm guessing what you describe is only available since Scarthgarp? Like I said in #75 , I've been meaning to fork At least until we can all limp by and get to Scarthgarp. |
You don’t need to fork. You can use this repo. Nobody has offered to maintain it. |
We recently upgraded to Yocto styhead. After going through yet another problem with cargo-bitbake (
WORKDIR
becomingUNPACKDIR
), we looked at how Rust recipes were being managed upstream these days, specifically inpoky
, and found that they have all migrated away fromcargo-bitbake
1.What basically happened, as far as we could tell, is that cargo-bitbake was replaced with a normally written recipe (no more auto-generated
.bb
file) and a new bitbake command (bitbake -c update_crates RECIPE_NAME
) that converts theCargo.lock
coming from the repository into a list of crates 2. This is similar to how cargo-bitbake works but I'd argue the file structure is much better organized, since auto-generated content (the list of crates and hashes) sits in a secondary file instead of the main one.We immediately converted all of our Rust recipes to this new system and found the whole thing to be much faster and cleaner to manage. This led to the deprecation of our fork of cargo-bitbake given that we don't care about previous Yocto versions 3.
The conversion can be done by:
1 Writing a "standard"
.bb
file, just like you would do with any other language2.
inherit
ingcargo
andcargo-update-recipe-crates
3.
require ${BPN}-crates.inc
4. Create an empty file for
${BPN}-crates.inc
5. Run
bitbake -c update_crates RECIPE_NAME
6. Repeat step 5 when updating the package to a new version
I'm not sure if this was obvious to everyone else, but we happened to find this out by pure chance, and after doing a little digging in the documentation we found both the new method and cargo-bitbake suggested as possible solutions for Rust packaging 4, while thinking about our own experience we would never touch cargo-bitbake again now that a better solution is available. Is it time to let cargo-bitbake die?
Footnotes
https://git.yoctoproject.org/poky/tree/meta-selftest/recipes-extended/hello-rs/hello-rs_0.1.0.bb?h=styhead ↩
https://git.yoctoproject.org/poky/tree/meta-selftest/recipes-extended/hello-rs/hello-rs-crates.inc?h=styhead ↩
https://github.com/m4ss-Code/cargo-bitbake ↩
https://docs.yoctoproject.org/5.1/singleindex.html#cargo-update-recipe-crates ↩
The text was updated successfully, but these errors were encountered: