Skip to content
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

fix: bundle.bbclass: varflags expansion #289

Merged
merged 2 commits into from
Jan 8, 2024

Conversation

Jarsop
Copy link
Contributor

@Jarsop Jarsop commented Nov 8, 2023

Python anonymous functions are evaluated before = which expand the final variable value. This fix set the getVarFlags kwarg expand to True (default is False) to be able to assign varflag with bitbake variable (${...}) or python inline syntax (${@...}).

Python anonymous functions are evaluated before the = sign and Python tasks do not expand variables. This fix introduces a set of varflags via RAUC_VARFLAGS_SLOTS and RAUC_VARFLAGS_HOOKS variables.
It sets the getVarFlags keyword argument expand to the respective list (default is False). This allows for assigning varflags using bitbake variables (${...}) or Python inline syntax (${@...}).

@Jarsop
Copy link
Contributor Author

Jarsop commented Nov 8, 2023

Same remark with ci commit, see #290 (comment)

@Jarsop Jarsop force-pushed the fix/varflags-expansion branch 3 times, most recently from 62361bf to 27faf42 Compare November 10, 2023 20:02
@Jarsop Jarsop force-pushed the fix/varflags-expansion branch 2 times, most recently from dbd96fc to 992e1f0 Compare November 10, 2023 20:24
@Jarsop
Copy link
Contributor Author

Jarsop commented Nov 10, 2023

@ejoerns Second commit introduce a refactoring as it's dependent from the first but it can be push through another branch if needed.
BTW have we a test bundle recipes ? If no maybe can I create a dedicated test meta layer to have some test recipes to test our different classes ? (And sorry for the notifications noise but I had an issue with my git history...)

@Jarsop Jarsop changed the title fix(bundle.bbclass): varflags expansion in python anonymous function fix: bundle.bbclass: varflags expansion Nov 10, 2023
@ejoerns ejoerns added the fix label Dec 7, 2023
Jarsop added 2 commits January 7, 2024 22:24
Python anonymous functions are evaluated before the `=` sign and Python tasks
do not expand variables. This fix introduces a set of varflags via
`RAUC_VARFLAGS_SLOTS` and `RAUC_VARFLAGS_HOOKS` variables.
It sets the `getVarFlags` keyword argument `expand` to
the respective list (default is `False`). This allows for assigning
varflags using bitbake variables (`${...}`) or Python inline syntax (`${@...}`).

Signed-off-by: Jean-Pierre Geslin <[email protected]>
By assigning a dictionary as a default value, the code
can be greatly simplified.
This makes the code clearer and more "Pythonic".

Signed-off-by: Jean-Pierre Geslin <[email protected]>
@ejoerns ejoerns force-pushed the fix/varflags-expansion branch from 992e1f0 to 71086ac Compare January 7, 2024 21:26
@ejoerns
Copy link
Member

ejoerns commented Jan 7, 2024

@Jarsop I really appreciate your changes! Especially the dict handling simplification looks really useful!

I have slightly modified the commit title to better match our conventions (removed conventional commit prefix).

@ejoerns Second commit introduce a refactoring as it's dependent from the first but it can be push through another branch if needed.

Should not be necessary, thx.

BTW have we a test bundle recipes ? If no maybe can I create a dedicated test meta layer to have some test recipes to test our different classes ? (And sorry for the notifications noise but I had an issue with my git history...)

No, we currently don't have but actually should. So feel free to make a proposal!

@Jarsop
Copy link
Contributor Author

Jarsop commented Jan 7, 2024

@Jarsop I really appreciate your changes! Especially the dict handling simplification looks really useful!

I have slightly modified the commit title to better match our conventions (removed conventional commit prefix).

You're welcome and thanks for the realignment.

No, we currently don't have but actually should. So feel free to make a proposal!

Ok, I will think about that and will make a proposal, maybe fake images, parsing around bitbake -e etc.

@Jarsop
Copy link
Contributor Author

Jarsop commented Jan 7, 2024

@ejoerns can we consider using kas to configure and build recipes/test images ?

@ejoerns
Copy link
Member

ejoerns commented Jan 8, 2024

@ejoerns can we consider using kas to configure and build recipes/test images ?

I'd prefer using new built-in layer tooling, but if kas actually gives a benefit there, I would not strictly be against it.

@ejoerns ejoerns merged commit ffba61f into rauc:master Jan 8, 2024
2 checks passed
@ejoerns
Copy link
Member

ejoerns commented Sep 9, 2024

backported to kirkstone.

@ejoerns ejoerns added master kirkstone kirkstone release-related scarthgap labels Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants