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

samples: change smart_amp_test prefix smart_amp_ to smart_amp_test_ #8441

Merged
merged 1 commit into from
Nov 6, 2023

Conversation

marc-hb
Copy link
Collaborator

@marc-hb marc-hb commented Nov 3, 2023

Avoids conflicts with the "real" smart_amp.c when the "stub" compilation check enables everything and compiles everything.

Also makes git grep smart_thing a bit more convenient in some cases.

Only the IPC3 sample clashed because the real code does not use MODULE_ADAPTER(). Pre-emptively rename the IPC4 sample too for consistency and in case the real code changes its mind later.

Only global symbols are renamed; no need to git churn private symbols.

Fixes commit ba2cfe3 ("app/stub*.conf: add
CONFIG_SAMPLE_SMART_AMP=y") which clashed with commit d4d0a0c ("smart_amp: fix code and re-enable it on stub builds")

CI did not detect the clash because these two commits were merged at the same time.

In case anyone is interested, the CI "fix" to prevent this type of race is a GitHub feature called "merge queue" (resp. "merge train" in Gitlab, "commit queue" in the older Chrome infrastructure, etc.) It would be a heavy lift, overkill for the small size and concurrency of the sof git repo and how rarely these accidents happen (a couple times/year)

Avoids conflicts with the "real" smart_amp.c when the "stub" compilation
check enables everything and compiles everything.

Also makes `git grep smart_thing` a bit more convenient in some cases.

Only the IPC3 sample clashed because the real code does not use
MODULE_ADAPTER(). Pre-emptively rename the IPC4 sample too for
consistency and in case the real code changes its mind later.

Only global symbols are renamed; no need to git churn private symbols.

Fixes commit ba2cfe3 ("app/stub*.conf: add
CONFIG_SAMPLE_SMART_AMP=y") which clashed with commit
d4d0a0c ("smart_amp: fix code and re-enable it on stub builds")

CI did not detect the clash because these two commits were merged at the
same time.

In case anyone is interested, the CI "fix" to prevent this type of race
is a GitHub feature called "merge queue" (resp. "merge train" in Gitlab,
"commit queue" in the older Chrome infrastructure, etc.)  It would be a
heavy lift, overkill for the small size and concurrency of the sof git
repo and how rarely these accidents happen (a couple times/year)

Signed-off-by: Marc Herbert <[email protected]>
@marc-hb marc-hb force-pushed the fix-smart-amp-clash branch from f5c97a5 to 3fdf70f Compare November 3, 2023 19:37
Copy link
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm 100% not sure if the ability to compile real and non-real smart-amp together in the same build, can cause problems in some case. Previously this was not possible due to build time error, but with this change, one can build such an image and the UUID will be the same. This is good for a build test, but may cause weird'ish errors on more complicated functional checks when/if the same uuid is used. Update: The real smart-amp uuids are different, so not an issue.

Approving as I still am pretty confident this will work.

Another approach would be to make a Kconfig depends for smart_amp_tests so that they could not be enabled if the a real smart-amp is enabled in the build.

@cujomalainey
Copy link
Contributor

Thanks for fixing up my half bake

@kv2019i kv2019i merged commit 216be69 into thesofproject:main Nov 6, 2023
43 of 44 checks passed
@dbaluta
Copy link
Collaborator

dbaluta commented Nov 6, 2023

Thanks for fixing this :) I wanted to send a patch on Friday but couldn't understand exactly what names should I use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants