-
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
west: sign.py: add "REM" support to pass comments through cpp #67019
Conversation
Finding original files is not convenient. Use unnecessary, double 'REM #' for better syntax highlighting. This depends on zephyrproject-rtos/zephyr#67019 Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Successfully tested in commit https://github.com/marc-hb/sof/commits/toml-REM/ |
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.
No complaints from me, seems like a useful feature. I will say though that this smells a little like a workaround for a design flaw: SOF, heh, sort of has a habit[1] of picking weak languages, trying to do complicated things with them, and then having to bolt on some kind of preprocessing to make up for the lack of programmability in the original.
So we have (here) rimage writing its config file in TOML, but then having to suck in non-trivial macrobatics to do what needs to be done, which requires debugging, which requires comments that survive the translation.
Maybe it might be time to think about generating the rimage config in a first class programming language (which you can simplify with a DSL layer as needed) rather than trying to build up toward a first class language with simpler tools?
[1] The true case study here was the attempt to bolt M4 around ALSA config files to generate topologies. The tplg2 stuff walked that back, but now that too is being passed through cpp!
Thanks for the review!
"requires" sounds too strong; this PR is a "quality of life" enhancement.
Thanks for preaching to the choir (again) :-)
In theory, practice and theory are the same. In practice, people choose the languages they know and (think they) are the most productive with. To be fair, this cpp-based solution seems very convenient to access https://www.youtube.com/watch?v=w8GgP3h0M8M
I'm not familiar with topologies, do you have a link? |
That commit message is confusing because it talks about how SOF builds things and not upstream Zephyr. |
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.
That commit message is confusing because it talks about how SOF builds things and not upstream Zephyr.
Thanks, I'll rephrase to be more neutral. Note the .toml pre-processing seems quite SOF-specific for now though.
CMake-based build systems like Zephyr's use separate build directories; one for each build configuration. Even Zephyr's multi-build system "sysbuild" (which is not relevant here) uses separate subdirectories. So there is only one pre-processed, .toml file generated by build directory and no need to vary its filename based on the platform name or any other configuration parameter. It can and should keep the same filename across build directories as zephyr.elf and all other build artefacts do. Moreover, when building a collection of configurations (as for instance `sof/scripts/xtensa-build-zephyr.py` does), keeping all build directories consistent with each other simplifies installation, checksumming and any other post-processing. "Fixes" recent commit 1533604 ("west: sign.py: generate platf.toml from platf.toml.h with cc -E") Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Zero-functional change. Also move it to a separate line so it's more convenient to temporarily comment it out. Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Generated outputs can be difficult to read, preserving comments helps a lot and they often provide good `git grep` search keywords. Signed-off-by: Marc Herbert <marc.herbert@intel.com>
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.
refresh +1
Having to find source files to read comments is not convenient. This depends on zephyrproject-rtos/zephyr#67019 which was merged a while ago. Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Having to find source files to read comments is not convenient. This depends on zephyrproject-rtos/zephyr#67019 which was merged a while ago. Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Having to find source files to read comments is not convenient. This depends on zephyrproject-rtos/zephyr#67019 which was merged a while ago. Signed-off-by: Marc Herbert <marc.herbert@intel.com>
3 sign.py commits. Main commit:
west: sign.py: add "REM" support to pass comments through cpp
Generated outputs can be difficult to read, preserving comments helps a
lot and they often provide good
git grep
search keywords.