Skip to content

Conversation

@wdouglass
Copy link
Contributor

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.

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.
*examples)
if [ -d "$tgt" ]; then
for example in "$tgt/"*; do
if [ -f "$example" ] && [ -x "$example" ]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I'll revise.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@wdouglass wdouglass requested a review from nastevens January 15, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants