Build system: allow easy solidification of external Berry #21430
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.
Description:
Addition to the build scripts, that makes it fairly easy to solidify external Berry code into the firmware image.
Provided Berry files must contain only 1 module or 1 class. Otherwise this will lead to undefined behaviour.
Typical use case should be to host specialised code for certain device in a GH repo, but any open or private http server will be fine.
Usage:
Add entry
custom_berry_solidify
to a build environment with one or many Berry files - one per line.Example:
Then just build as usual.
These files must be written in compatible way to be solidified, which is non trivial and out of the scope of this explanation.
Besides other things the name of the module or class must be declared with a special meta comment, which is already used in Tasmotas embedded Berry code:
#@ solidify:class_name
or
#@ solidify:module_name
It is recommended to run a
clean
after compilation, as the source code in the lib folder will temporarily be modified - but not much. This is meant mainly in the context of development to avoid unwanted GIT actions.Currently Windows does not support solidification.
@arendst @s-hadinger
We can leave this PR open until we are sure how to handle the Windows problem. I can turn it off for Windows to avoid user confusion.
Checklist:
NOTE: The code change must pass CI tests. Your PR cannot be merged unless tests pass