RDKE-1123: Added recipe version creation - #29
Merged
vbabypublic merged 2 commits intoAug 3, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends BitBake’s -s (“show versions”) output to additionally write a recipe_versions.txt file containing recipe/version selections, intended to be produced before running a build.
Changes:
- Write a
recipe_versions.txtfile under${TOPDIR}duringCooker.showVersions(). - Filter out certain recipe variants from the file output (native/cross/sdk-related) and de-duplicate some
lib32-entries. - Keep the existing console table output intact.
Suppressed comments (1)
bitbake/lib/bb/cooker.py:558
- The new file write in showVersions() can raise an unhandled OSError (e.g., read-only TOPDIR) and abort
-sentirely. Also, filtering with substring checks like "-sdk" will exclude legitimate target recipes such ascore-image-sato-sdk/core-image-rt-sdk(seemeta/recipes-*/images/*-sdk.bb). Consider making file output best-effort and use the established native/cross detection patterns (e.g.,meta/classes/sstate.bbclass:isNativeCross()/meta/classes/multilib_global.bbclass).
with open(output_file, "w") as f:
for p in sorted(self.recipecaches[''].pkg_pn):
preferred = preferred_versions[p]
latest = latest_versions[p]
requiredstr = ""
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Suppressed comments (3)
bitbake/lib/bb/cooker.py:555
- This change introduces new behavior (writing
recipe_versions.txtand filtering entries) but there are no unit tests covering it (no references torecipe_versionsexist underbitbake/lib/bb/tests). Adding a test would help prevent regressions and clarify the intended filtering semantics.
all_recipes = set(self.recipecaches[''].pkg_pn.keys())
output_file = os.path.join(self.data.getVar('TOPDIR'), "recipe_versions.txt")
with open(output_file, "w") as f:
for p in sorted(self.recipecaches[''].pkg_pn):
bitbake/lib/bb/cooker.py:572
- The filter
"-sdk" not in pis over-broad and will exclude legitimate recipe names that merely contain "-sdk" in the middle (not just SDK variant recipes). For example, recipes likepackagegroup-go-sdk-target.bb/ PNpackagegroup-go-sdk-targetwould be omitted fromrecipe_versions.txt, causing the file contents to diverge frombitbake -soutput.
if "-native" not in p and "-cross" not in p and "-sdk" not in p and "nativesdk" not in p:
bitbake/lib/bb/cooker.py:555
open(output_file, "w")can raise OSError (e.g., TOPDIR not writable) and will currently surface as a Python traceback. Since this is a user-facing-spath, it should fail with a clear BitBake error message.
output_file = os.path.join(self.data.getVar('TOPDIR'), "recipe_versions.txt")
with open(output_file, "w") as f:
for p in sorted(self.recipecaches[''].pkg_pn):
vbabypublic
approved these changes
Aug 3, 2026
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.
This is to create version file before invoking the build using bitbake command. This is within the "-s" option to print the recipes and the versions