-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
llext-edk: rework, read data from build_info.yml
and .config
#83705
Draft
pillo79
wants to merge
12
commits into
zephyrproject-rtos:main
Choose a base branch
from
pillo79:pr-llext-edk-rework
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
This introductory commit refactors the `yaml_set` function separating the bodies of list operations into internal functions while preserving their original behavior. The conditions that cause the value to be interpreted as a list are also verified only once, avoiding multiple checks. Signed-off-by: Luca Burelli <[email protected]>
This introductory commit removes the ignored 'actual' variable from the 'yaml_set()' calls in the tests to make the code cleaner. Also, a badly indented block is fixed in the 'message()' macro. No functional change is introduced by this commit. Signed-off-by: Luca Burelli <[email protected]>
This test verifies that the APPEND LIST operation in yaml_set() works as expected. Signed-off-by: Luca Burelli <[email protected]>
To verify proper functionality, the YAML module test suite is now run twice: once in the regular CMake project mode and once in the CMake script mode. Signed-off-by: Luca Burelli <[email protected]>
This commit adds support for generator expressions in values and lists to the yaml module. Generator expressions can only be expanded by CMake after all configuration code has been executed and the final values of the project properties are defined. This means that contexts that contain generator expressions are written twice: - the first time, during yaml_save(), a comment with the raw unexpanded string is saved instead of the key that uses generator expressions in the YAML file; - the second time, as a pre-build step of a target, the generator expressions are expanded, and the final YAML file is written. This two-step process also allows to overcome the issue of lists that are extracted from generator expressions, whose elements would be expanded into a single string if written directly to the YAML file. Instead, the lists are stored in their CMake string format with a special marker, expanded by CMake into a temporary JSON file, and the conversion to a proper list is performed during the pre-build step. Note that when generator expressions are used in the context: - the GENEX keyword must be provided to yaml_set(), to mark the context as containing generator expressions; this is necessary to avoid storing the genexes as raw strings in the YAML. - the YAML file must be written providing the TARGET parameter to yaml_save(). If it is not provided, a warning will be issued and only the partial file will be written. Signed-off-by: Luca Burelli <[email protected]>
Add tests to the YAML suite for generator expressions. The test checks that generator expressions are handled as expected at different stages: - immediately after yaml_save(), the file must contain only non-genex entries; - at a later time, after the target has been built, the file must contain all the expanded genex values. Signed-off-by: Luca Burelli <[email protected]>
This introductory commit refactors 'build_info()' to use the standard `cmake_parse_arguments()` and Zephyr helper functions instead of manually parsing the argument list, to allow additional arguments to be added. No functional change is intended in this commit. Signed-off-by: Luca Burelli <[email protected]>
This patch enables support for generator expressions in the `build_info()` function by passing the GENEX flag to yaml_set(). This is currently not supported with PATH values, because the actual contents of the list (whose paths are to be converted) are not known until after the cmake code has been processed. Signed-off-by: Luca Burelli <[email protected]>
This commit refactors the code that generates the Makefile and CMake EDK files into functions that accept the file type as an argument. No functional changes are introduced in this commit. Signed-off-by: Luca Burelli <[email protected]>
This commit removes all CMake- or Makefile-specific variables from the code and instead uses a single list for each type of flag. Where a difference is needed between the two, a special marker is used. These markers are replaced later in the target-specific area of the write functions. Escaping of problematic characters is also added to the write functions, to ensure that quotes and backslashes in the flags are properly handled. Signed-off-by: Luca Burelli <[email protected]>
Currently, the llext-edk.cmake script requires a number of variables to be passed in from the main CMakeLists.txt file as arguments to be able to customize the generated files. To improve this rigid approach, the script is modified to read in the following files in the build directory: * 'zephyr/.config', for the final set of Kconfig options used; * 'build_info.yml', for the cmake-related variables. This is more flexible and also easier to maintain, as it doesn't require manual changes to the main CMakelists.txt file when new variables need to be referenced. Signed-off-by: Luca Burelli <[email protected]>
Extend the documentation for the LLEXT EDK to include information about the target and toolchain information that is now exported by the EDK and the new output format. Signed-off-by: Luca Burelli <[email protected]>
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 PR improves the LLEXT EDK in several ways:
It is effectively a subset of #78727 that does not add any new information to the LLEXT EDK.
Note
The first 6 commits, up and including
0600b1c
, are the contents of PR #80007 and will be removed once that PR is merged.