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

Add use-after-move check of clang-tidy #8414

Merged
merged 1 commit into from
Jul 23, 2021

Conversation

kghost
Copy link
Contributor

@kghost kghost commented Jul 15, 2021

Problem

#2814
#7044

Change overview

Add build rule to run clang-tidy

Testing

Manually tested.

  gn --root=. gen --check --fail-on-unused-args ./out/debug "--args=target_os=\"all\" is_clang=true pw_command_launcher=\"`pwd`/scripts/helpers/clang-tidy-launcher.py\""
  ninja -v -C out/debug

@kghost
Copy link
Contributor Author

kghost commented Jul 15, 2021

@mspang I'm not quite familiar with GN, please help me check if I'm using it correctly, any suggestions are welcome.

@mspang
Copy link
Contributor

mspang commented Jul 16, 2021

@mspang I'm not quite familiar with GN, please help me check if I'm using it correctly, any suggestions are welcome.

Hm, interesting approach. A couple things make me nervous about this such as needing to duplicate the command line generation.

Could use pw_command_launcher to avoid that. It's probably OK to let the build actually happen and then run the analyzer after.

The other way is to just use compile_commands.json which is what I believe everyone else does (this way also requires building first).

@bzbarsky-apple
Copy link
Contributor

/rebase

Copy link
Contributor

@bzbarsky-apple bzbarsky-apple left a comment

Choose a reason for hiding this comment

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

Not hooked up to any automation yet, right?

Usage:
  gn --root=. gen --check --fail-on-unused-args ./out/debug "--args=target_os=\"all\" is_clang=true pw_command_launcher=\"`pwd`/scripts/helpers/clang-tidy-launcher.py\""
  ninja -v -C out/debug

More checks can be added by modifying .clang-tidy
@github-actions
Copy link

Size increase report for "esp32-example-build" from f382df3

File Section File VM
chip-temperature-measurement-app.elf .flash.text 47 60
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

Comparing ./master_artifact/chip-all-clusters-app.elf and ./pull_artifact/chip-all-clusters-app.elf:

sections,vmsize,filesize

Comparing ./master_artifact/chip-ipv6only-app.elf and ./pull_artifact/chip-ipv6only-app.elf:

sections,vmsize,filesize

Comparing ./master_artifact/chip-temperature-measurement-app.elf and ./pull_artifact/chip-temperature-measurement-app.elf:

sections,vmsize,filesize
[Unmapped],0,4049
.flash.text,60,47

Comparing ./master_artifact/chip-persistent-storage.elf and ./pull_artifact/chip-persistent-storage.elf:

sections,vmsize,filesize

Comparing ./master_artifact/chip-pigweed-app.elf and ./pull_artifact/chip-pigweed-app.elf:

sections,vmsize,filesize

Comparing ./master_artifact/chip-shell.elf and ./pull_artifact/chip-shell.elf:

sections,vmsize,filesize

Comparing ./master_artifact/chip-lock-app.elf and ./pull_artifact/chip-lock-app.elf:

sections,vmsize,filesize


@kghost
Copy link
Contributor Author

kghost commented Jul 23, 2021

Not hooked up to any automation yet, right?

Not yet, there is lots of failure with it enabled, we can make it non mandatory check first.

Waiting for @andy31415 coming back to add a new CI check.

@yufengwangca yufengwangca merged commit fe892ae into project-chip:master Jul 23, 2021
nikita-s-wrk pushed a commit to nikita-s-wrk/connectedhomeip that referenced this pull request Sep 23, 2021
Usage:
  gn --root=. gen --check --fail-on-unused-args ./out/debug "--args=target_os=\"all\" is_clang=true pw_command_launcher=\"`pwd`/scripts/helpers/clang-tidy-launcher.py\""
  ninja -v -C out/debug

More checks can be added by modifying .clang-tidy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants