classes/rust_bin-common: avoid failing when os does not match #202
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.
The rust_bin-common defines rust_target(), a function called at parsing time by bitbake. Calling bb.fatal() in a multiconfig context builds is problematic, because the alternate config might not build for Linux. For example when building a baremetal companion firmware.
Yet, our multiconfig recipes are still evaluated during parsing, and in this case, it makes more sense skipping the recipe rather than producing an error. Use bb.parse.SkipRecipe() instead of bb.fatal().
This can be easily reproduced by trying to build with meta-rust-bin and the
beagleplay
machine in the meta-ti-bsp layer. The multiconfig build (k3r5) will trigger hundreds of errors.