-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
rimage: pre-process .toml files with cc -E #66420
Conversation
`west sign` has been invoked by `west build` (through CMake) since commit fad2da3, almost one year ago. During that time, this new workflow has been refined and successfully used by at least two vendors, multiple CIs across both SOF and Zephyr and many developers. At the time, the ability to sign from `west flash` was preserved for backwards compatibility. This means rimage parameters can come from many different places at once and that rimage can be invoked twice during a single `west flash` invocation! Now that Zephyr 3.5 has been released, we need to reduce the number of rimage use cases and the corresponding validation complexity and maintenance workload to simplify and accelerate new features like splitting rimage configuration files (zephyrproject-rtos#65411) Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Zero functional change, preparation for the .toml modularization. RimageSigner.sign() is also way too long and too complex and this helps. Signed-off-by: Marc Herbert <marc.herbert@intel.com>
In the following command, the first argument `for_rimage` is passed to `rimage` whereas `--for west` goes to west. ``` west sign for_rimage --for west ``` This is somehow valid but we really don't want anyone to do that. Signed-off-by: Marc Herbert <marc.herbert@intel.com>
rimage is very verbose by default and has no -q(uiet) option, so saving one line out of more than 100 lines is pointless. RimageSigner.sign() was already very complex and suffering from combinatorial explosion of parameters. With .toml pre-processing (zephyrproject-rtos#65411) it's getting worse, so we really need all build logs to show the complete rimage command. Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Allow using the C pre-processor to generate a `rimage/config/platform.toml` file from a "source" `rimage/config/platform.toml.h` file. This is optional and fully backwards compatible. To use, do not use `-c` and point west sign at a configuration directory instead or let it use the default `rimage/config/` directory and change the files there. Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Mostly works. Tested it with thesofproject/sof#8490 (only modified for a recent renaming) and
|
Thanks @lyakh for the testing!
I admit I did not test the -D option, I will do today. Relative paths can be trickier, can you please confirm that -D works with an absolute path? Also, does a relative path work BEFORE this PR? If the answers are respectively "yes" and "no" then it is a separate issue that should not hold back this entire PR. |
So that went much faster than expected. I tried various relative |
Depending on how old and "hybrid" is your west workspace, you have may two copies of the sof repo:
Make sure you get rid of the one that is not in Also, make sure you have no symbolic link. |
5 commits, main ones:
Remove
west sign
from intel_adspwest flash
Add .toml pre-processing. Should supersede rimage: add TOML preprocessing #65411. Depends on xtensa-build-zephyr.py: don't pass -c $plat.toml to rimage thesofproject/sof#8602 to make an actual difference in SOF.