-
-
Notifications
You must be signed in to change notification settings - Fork 989
Add compiler warning tracking tooling failure remediation guidance #1364
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
Changes from 3 commits
780b372
3a6d880
db3ed48
cf4d962
f6395aa
3aeb0c9
6ca97f8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,3 +9,4 @@ Development tools | |
| gdb | ||
| clang | ||
| coverity | ||
| warnings | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,69 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| .. warnings: | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| Tools for tracking compiler warnings | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ==================================== | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| The compiler warning tracking tooling is intended to alert developers to new | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. changed to about
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
We can use this to set the default highlight of the file.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, though we only two code-blocks with different highlights :)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added the default anyway! |
||||||||||||||||||||||||||||||||||||||||||||||||||
| compiler warnings introduced by their contributions. The tooling consists of | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Python script which is ran by a few GitHub Actions workflows. These | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
hugovk marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| GitHub Actions jobs run the warning checking tooling: | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Applied suggestion to make this more concise. |
||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| - Ubuntu/Build and Test | ||||||||||||||||||||||||||||||||||||||||||||||||||
| - macOS/Build and Test | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
hugovk marked this conversation as resolved.
Outdated
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Included links to the configuration files |
||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| The help text for the :cpy-file:`Tools/build/check_warnings.py` is as follows: | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| .. code-block:: text | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| usage: check_warnings.py [-h] | ||||||||||||||||||||||||||||||||||||||||||||||||||
| -c COMPILER_OUTPUT_FILE_PATH | ||||||||||||||||||||||||||||||||||||||||||||||||||
| [-i WARNING_IGNORE_FILE_PATH] [-x] [-X] -t {json,clang} | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| options: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| -h, --help show this help message and exit | ||||||||||||||||||||||||||||||||||||||||||||||||||
| -c COMPILER_OUTPUT_FILE_PATH, --compiler-output-file-path COMPILER_OUTPUT_FILE_PATH | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Path to the compiler output file | ||||||||||||||||||||||||||||||||||||||||||||||||||
| -i WARNING_IGNORE_FILE_PATH, --warning-ignore-file-path WARNING_IGNORE_FILE_PATH | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Path to the warning ignore file | ||||||||||||||||||||||||||||||||||||||||||||||||||
| -x, --fail-on-regression | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Flag to fail if new warnings are found | ||||||||||||||||||||||||||||||||||||||||||||||||||
| -X, --fail-on-improvement | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Flag to fail if files that were expected to have warnings have no warnings | ||||||||||||||||||||||||||||||||||||||||||||||||||
| -t {json,clang}, --compiler-output-type {json,clang} | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Type of compiler output file (json or clang) | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
I'm not sure it's a good idea duplicating the help text here, since it might become obsolete if new options are added. If people are going to use the tool, they might as well just use
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably a good idea. I figured this was a quick way for the reader to get an intuition of what inputs are going to the script if their only exposure to the tooling is that a CI failure has sent them here. I removed it to future-proof this guide. |
||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| The script can be run locally by providing the compiler output and the | ||||||||||||||||||||||||||||||||||||||||||||||||||
| compiler output type to see a list of unique warnings. | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| :: | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
hugovk marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| $ python Tools/build/check_warnings.py -c <compiler_output_file> -t <compiler_output_type> | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
hugovk marked this conversation as resolved.
Outdated
hugovk marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| .. | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| Note: `-fdiagnostics-format=json` flag is required when compiling with GCC | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| for the script to properly parse the compiler output. | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
hugovk marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| .. _warning-check-failure: | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| What to do if a warning check fails GitHub CI | ||||||||||||||||||||||||||||||||||||||||||||||||||
| --------------------------------------------- | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| The warning check tooling will fail if the compiler generates more or less | ||||||||||||||||||||||||||||||||||||||||||||||||||
| warnings than expected for a given source file as defined in the | ||||||||||||||||||||||||||||||||||||||||||||||||||
| platform-specific warning ignore file. The warning ignore file is either | ||||||||||||||||||||||||||||||||||||||||||||||||||
| :cpy-file:`Tools/build/.warningignore_ubuntu` or :cpy-file:`Tools/build/.warningignore_macos` | ||||||||||||||||||||||||||||||||||||||||||||||||||
| depending on the platform. | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is supposed to be shorthand to link to a file with the same basename already referenced in the document? When build the dev guide with the suggestion it would take me to I put in the full path for now.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The Note that an alternative would have been
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| If a warning check fails with: | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| * Unexpected Warnings | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
hugovk marked this conversation as resolved.
Outdated
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I kept the language the same but fixed the capitalization. The reason being that the script actually labels warnings as "Unexpected improvements" and "Unexpected warnings" |
||||||||||||||||||||||||||||||||||||||||||||||||||
| * Attempt to refactor the code to avoid the warning. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| * If it is not possible to avoid the warning document in the PR why it is | ||||||||||||||||||||||||||||||||||||||||||||||||||
| reasonable to ignore and add the warning to the platform specific | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
hugovk marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| warning ignore file. If the file exists in the warning ignore file | ||||||||||||||||||||||||||||||||||||||||||||||||||
| increment the count by the number of new introduced warnings. | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
hugovk marked this conversation as resolved.
Outdated
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed spacing |
||||||||||||||||||||||||||||||||||||||||||||||||||
| * Unexpected Imrpovements (Less Warnings) | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
hugovk marked this conversation as resolved.
Outdated
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I kept the language the way it was but fixed the capitalization, same reason as above the script actually labels specific warnings as such. |
||||||||||||||||||||||||||||||||||||||||||||||||||
| * Document in the PR that the change reduces the number of compiler | ||||||||||||||||||||||||||||||||||||||||||||||||||
| warnings. Decrement the count in the platform specific warning | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
hugovk marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| ignore file or remove the file if the count is now zero. | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed spacing |
||||||||||||||||||||||||||||||||||||||||||||||||||

Uh oh!
There was an error while loading. Please reload this page.