-
Notifications
You must be signed in to change notification settings - Fork 7
RDKE-1024 : Add target toolchain libs feed support for docker #343
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
base: develop
Are you sure you want to change the base?
Changes from all commits
40ebc66
e944537
8247b5f
70e8b68
1372102
825ce58
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -25,6 +25,11 @@ LAYER_EXTENSION ?= "" | |||||||||||||||||||||||||||||||||||||||||||||||||||||
| OSS_LAYER_ARCH = "${@get_oss_arch(d)}${LAYER_EXTENSION}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PACKAGE_EXTRA_ARCHS:append = " ${OSS_LAYER_ARCH}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| TOOLCHAIN_LAYER_ARCH = "${@get_oss_arch(d)}-toolchain" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PACKAGE_EXTRA_ARCHS:append = " ${TOOLCHAIN_LAYER_ARCH}" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PACKAGE_EXTRA_ARCHS:append = " ${TOOLCHAIN_LAYER_ARCH}" | |
| PACKAGE_EXTRA_ARCHS:append = " ${TOOLCHAIN_LAYER_ARCH}" | |
| # Toolchain feed configuration: | |
| # - TOOLCHAIN_TARGET_LIBS_URI: | |
| # URI of the remote IPK feed that provides target toolchain libraries | |
| # for ${TOOLCHAIN_LAYER_ARCH}. When non-empty, this URI is appended | |
| # to IPK_FEED_URIS, unless one of the local/alternative mechanisms | |
| # below is in use. | |
| # | |
| # - ENABLE_DOCKER_TARGET_TOOLCHAIN_FEED: | |
| # When set to "1", a Docker image is expected to provide the target | |
| # toolchain libraries, so no remote TOOLCHAIN_TARGET_LIBS_URI feed | |
| # is added for ${TOOLCHAIN_LAYER_ARCH}. | |
| # | |
| # - PREBUILT_TOOLCHAIN_TARGET_LIBS: | |
| # Absolute path to a directory on the build host that contains | |
| # prebuilt target toolchain libraries. If this variable is set and | |
| # points to an existing directory (os.path.isdir(...)), the local | |
| # directory is used instead of the remote TOOLCHAIN_TARGET_LIBS_URI | |
| # feed. | |
| # | |
| # The IPK_FEED_URIS:append expression below adds TOOLCHAIN_TARGET_LIBS_URI | |
| # only when a remote feed is configured (TOOLCHAIN_TARGET_LIBS_URI != "") | |
| # and neither a Docker-provided feed nor a valid PREBUILT_TOOLCHAIN_TARGET_LIBS | |
| # directory is in use. |
Copilot
AI
Feb 4, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The conditional logic in this line is complex and could be difficult to maintain. Consider refactoring this into a helper function that clearly expresses the intent. For example:
def should_add_toolchain_feed_uri(d):
"""
Add toolchain feed URI if:
- TOOLCHAIN_TARGET_LIBS_URI is defined AND
- (Docker feed is not enabled OR prebuilt directory doesn't exist)
"""
if not d.getVar('TOOLCHAIN_TARGET_LIBS_URI'):
return False
docker_feed_enabled = d.getVar('ENABLE_DOCKER_TARGET_TOOLCHAIN_FEED') == '1'
prebuilt_dir = d.getVar('PREBUILT_TOOLCHAIN_TARGET_LIBS') or ''
prebuilt_exists = os.path.isdir(prebuilt_dir)
return not docker_feed_enabled or not prebuilt_existsThis would make the code more readable and easier to test. The inline expression could then be simplified to use this helper function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TOOLCHAIN_LAYER_ARCH does not include LAYER_EXTENSION, unlike OSS_LAYER_ARCH which does include it (line 25). This means toolchain libraries will be shared across all layer extensions. Verify this is intentional - if different LAYER_EXTENSION values represent incompatible build configurations, toolchain libraries from different extensions might have ABI incompatibilities. If this sharing is intentional to optimize storage/bandwidth, consider adding a comment explaining this design decision.