-
Notifications
You must be signed in to change notification settings - Fork 349
topology: cmake: comments explaining why alsatplg is so verbose #2626
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
Conversation
... and why it's very difficult to fix. Learned the hard way. Signed-off-by: Marc Herbert <marc.herbert@intel.com>
| add_custom_command( | ||
| OUTPUT ${output}.tplg | ||
| # - In alsa-utils commit v1.2.2~15-gcbabe7a3f0cc, alsatplg (accidentally?) | ||
| # dropped the verbosity level; -v became a boolean. |
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.
"accident" at alsa-project/alsa-utils@cbabe7a3f0cc84ecd3#r38034335
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.
I'm not sure if I understand. What do you mean by 'bacame a boolean', what other arg do I have to pass instead of -v <level>, something like -v true?
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.
I'm not 100% sure what happens when you misconfigure getopt but in my testing I observed that -v whatever is verbose, including -v 0
| # dropped the verbosity level; -v became a boolean. | ||
| # - It unfortunately does not seem possible to base '-v' on ${VERBOSE} | ||
| # without adding a new layer of indirection / script between cmake and | ||
| # alsatplg |
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.
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.
This comment is not true. It is possible in many other ways. I'm not sure how you'd like to use it but if you want to base it on VERBOSE env variable, it can be done with parameter expressions or some subshells invoked inline. If you want to base it on alsa version then you'd need to do some checks here in cmake.
If your problem is that you want to just be able to override this -v 1 part, then we can add VERBOSE_ALSA env var switch for this. So it'd look like COMMAND alsatplg \${VERBOSE_ALSA--v 1} -c ${output}.conf -o ${output}.tplg and you can launch it with VERBOSE_ALSA="" make ..., to disable verbose.
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.
it can be done with parameter expressions
To be portable, cmake COMMAND invokes tries hard to quote everything away from the shell (especially with VERBATIM) - unless you explicitly ask for a non-portable shellalsatplg directly, it doesn't go through an OS dependent shell
So it'd look like COMMAND alsatplg ${VERBOSE_ALSA--v 1}
First thing I naively tried was something like this: ${VERBOSE:+-v 1}. cmake (correctly) quotes everything to make sure alsatplg gets passed exactly this and that the intermediate shell does nothing with it.
some subshells invoked inline
= adding a new (subshell) layer of indirection. I can rephrase to include that.
you'd need to do some checks here in cmake.
VERBOSE works after cmake has run, that's the beauty of it. So yes, you can probably decide this at cmake time (I can give it a try) but not at make/ninja time because by then cmake has run, it's too late.
This comment is not true.
I suggest a closer look at the level of cmake wizardry in the Zephyr project before assuming
zephyrproject-rtos/zephyr@4971d2a08452494d69 didn't know what they were doing :-)
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.
some subshells invoked inline
= adding a new (subshell) layer of indirection. I can rephrase to include that.
Well, yea, you can think of it as level of indirection ;)
However, you still can do this with params expressions, they just need to be properly escaped - You can disable VERBATIM if it helps. We support windows only for stuff that is really done there like building FW, I guess no1 is going to run alsa tools on windows and I was adding VERBATIM usually cos of cross-platform support.
I didn't try the sample that I wrote (\${VERBOSE_ALSA--v 1}), it was just hint . You may need to escape $ as $$ instead of \$.
|
The only "Internal Intel CI System/merge/build" failure is: It happened only ICL_SSP and only for TestDmicBothFifoSimpleCapture16000hz16b16b2ch ?! |
As long as you change only comments, we can ignore pretty much any CI except checkpatch. |
Successfully tested with both Make and Ninja on Linux. Non-portable but approved by @jajanusz in former PR thesofproject#2626 With this commit: $ make -C tools/build_tools/ | wc -l 770 $ VERBOSE=anything make -C tools/build_tools/ | wc -l 10387 Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Done in PR #2654 |
... and why it's very difficult to fix. Learned the hard way.
Signed-off-by: Marc Herbert marc.herbert@intel.com