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

zephyr: Support cmake args. Add -Werror in CI #4733

Merged
merged 4 commits into from
Sep 9, 2021

Conversation

marc-hb
Copy link
Collaborator

@marc-hb marc-hb commented Sep 8, 2021

4 commits. Main ones:

  • support CMake arguments
  • Add -Werror in CI

main() was growing too big. Zero functional change.

Also rename the too generic "build()" to build_all()

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Like this:

  xtensa-build-zephyr.sh -a -- -DEXTRA_CFLAGS='-Werror -Wextra'

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Allows passing compilation flags and any other argument.

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Because we can. This would have caught this regression from
commit 287a5f9 ("ssp: mclk/bclk turned off unexpectedly")

-DEXTRA_CFLAGS is not very well documented but it is what Zephyr uses,
try `git -C zephyr grep -C 5 EXTRA_CFLAGS and see.

```
sof/src/drivers/intel/ssp/ssp.c: In function 'ssp_set_config_tplg':
sof/zephyr/include/sof/trace/trace.h:44:11: warning:
                   too many arguments for format [-Wformat-extra-args]
   44 |    printk("%llu: " format "\n", platform_timer_get(NULL), \
      |           ^~~~~~~~
  ...
sof/src/drivers/intel/ssp/ssp.c:763:4: note: in expansion of macro 'dai_info'
  763 |    dai_info(dai, "ssp_set_config(): hw_free stage:
                     ignore since there is still user", dai->index);
```

Using -Werror only in CI avoids slowing down developers with temporary
warnings they intend on fixing later (but before submission)

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
@marc-hb
Copy link
Collaborator Author

marc-hb commented Sep 8, 2021

https://github.com/thesofproject/sof/pull/4733/checks?check_run_id=3548978888 with both -Werror and -Wextra failed as expected.

@marc-hb
Copy link
Collaborator Author

marc-hb commented Sep 8, 2021

No CML_SKU0955_HDA device was available in https://sof-ci.01.org/sofpr/PR4733/build10246/devicetest/. Everything else is green on that page and everywhere else (it's almost suspicious)

Zephyr builds were all successful (there's no Zephyr testing in PR at the moment, only in daily tests)

@marc-hb marc-hb changed the title zephyr: support cmake args. Add -Werror in CI zephyr: Support cmake args. Add -Werror in CI Sep 9, 2021
Copy link
Member

@lgirdwood lgirdwood left a comment

Choose a reason for hiding this comment

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

@marc-hb what's the long term plan here ? It seem like -Werror and also --std=c99 need to be default arguments in the build (automatically defined in cmake rules). I would assume these would need to be in Zephyr cmake and be inherited by SOF cmake ? @andyross ?

@marc-hb
Copy link
Collaborator Author

marc-hb commented Sep 9, 2021

what's the long term plan here ? It seem like -Werror and also --std=c99 need to be default arguments in the build (automatically defined in cmake rules)

I don't know about -std=c99 and Zephyr. I heard some C99 features are missing from XCC.

In general -Werror by default in the build can be UNproductive because it slows down iterative development, see one of my commit messages here. In upstream Zephyr -Werror is not in the build by default, it's added in the test suite (in twister).

Anyway this PR adds flexibility to add any flag anywhere later (and I have another, unrelated PR textually depending on it)

@lgirdwood lgirdwood merged commit 9a23191 into thesofproject:main Sep 9, 2021
@marc-hb marc-hb deleted the zephyr-cmake-args branch September 9, 2021 15:38
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.

3 participants