Do not install cargo-fingerprinted binaries for examples#229
Open
wdouglass wants to merge 2 commits intorust-embedded:masterfrom
Open
Do not install cargo-fingerprinted binaries for examples#229wdouglass wants to merge 2 commits intorust-embedded:masterfrom
wdouglass wants to merge 2 commits intorust-embedded:masterfrom
Conversation
Cargo generates examples in two files: one is the example name, and the other is suffixed with a fingerprint. these extra binaries do not need to be installed, so check for this condition in the install step.
nastevens
reviewed
Jan 14, 2026
classes/cargo_bin.bbclass
Outdated
| @@ -147,9 +147,14 @@ cargo_bin_do_install() { | |||
| if [ -d "$tgt" ]; then | |||
| for example in "$tgt/"*; do | |||
| if [ -f "$example" ] && [ -x "$example" ]; then | |||
Member
There was a problem hiding this comment.
Thanks for the PR! It'd be simpler and clearer to exclude those files with a bash regex match instead:
Suggested change
| if [ -f "$example" ] && [ -x "$example" ]; then | |
| if [[ -f "$example" && -x "$example" && ! "$example" =~ '-[[:xdigit:]]{16}$' ]]; then |
Contributor
Author
There was a problem hiding this comment.
Thank you! I'll revise.
Contributor
Author
There was a problem hiding this comment.
i did some experimenting with your change here, and unfortunately it did not filter as i expected. Looking through the documentation i found this:
https://docs.yoctoproject.org/bitbake/2.4/bitbake-user-manual/bitbake-user-manual-metadata.html#shell-functions
that section includes the sentence You should not use Bash-specific script (bashisms).
I do agree that this should be simplified, and i'm exploring some other options
This filters in the original line, and also checks to see that the un-suffixed version of the file exists. conditional shortcutting should keep this from being too expensive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cargo generates examples in two files: one is the example name, and the other is suffixed with a fingerprint. these extra binaries do not need to be installed, so check for this condition in the install step.