-
- Downloads
SARIF output: fix schema URL [§3.13.3, PR116603]
We were using https://raw.githubusercontent.com/oasis-tcs/sarif-spec/master/Schemata/sarif-schema-2.1.0.json as the URL for the SARIF 2.1 schema, but this is now a 404. Update it to the URL listed in the spec (§3.13.3 "$schema property"), which is: https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json and update the copy in gcc/testsuite/lib/sarif-schema-2.1.0.json used by the "verify-sarif-file" DejaGnu directive to the version found at that latter URL; the sha256 sum changes from: 2b19d2358baef0251d7d24e208d05ffabf1b2a3ab5e1b3a816066fc57fd4a7e8 to: c3b4bb2d6093897483348925aaa73af03b3e3f4bd4ca38cef26dcb4212a2682e Doing so added a validation error on c-c++-common/diagnostic-format-sarif-file-pr111700.c for which we emit this textual output: this-file-does-not-exist.c: warning: #warning message [-Wcpp] with no line number, and these invalid SARIF regions within the physical location of the warning: "region": {"startColumn": 2, "endColumn": 9}, "contextRegion": {} This is due to this directive: # 0 "this-file-does-not-exist.c" with line number 0. The patch fixes this by not creating regions that have startLine <= 0. gcc/ChangeLog: PR other/116603 * diagnostic-format-sarif.cc (SARIF_SCHEMA): Update URL. (sarif_builder::maybe_make_region_object): Don't create regions with startLine <= 0. (sarif_builder::maybe_make_region_object_for_context): Likewise. gcc/testsuite/ChangeLog: PR other/116603 * gcc.dg/plugin/diagnostic-test-metadata-sarif.py (test_basics): Update expected schema URL. * gcc.dg/plugin/diagnostic-test-paths-multithreaded-sarif.py: Likewise. * gcc.dg/sarif-output/test-include-chain-1.py: Likewise. * gcc.dg/sarif-output/test-include-chain-2.py: Likewise. * gcc.dg/sarif-output/test-missing-semicolon.py: Likewise. * gcc.dg/sarif-output/test-no-diagnostics.py: Likewise. * gcc.dg/sarif-output/test-werror.py: Likewise. * lib/sarif-schema-2.1.0.json: Update with copy downloaded from https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json Signed-off-by:David Malcolm <dmalcolm@redhat.com>
Showing
- gcc/diagnostic-format-sarif.cc 19 additions, 6 deletionsgcc/diagnostic-format-sarif.cc
- gcc/testsuite/gcc.dg/plugin/diagnostic-test-metadata-sarif.py 1 addition, 1 deletion...testsuite/gcc.dg/plugin/diagnostic-test-metadata-sarif.py
- gcc/testsuite/gcc.dg/plugin/diagnostic-test-paths-multithreaded-sarif.py 1 addition, 1 deletion...cc.dg/plugin/diagnostic-test-paths-multithreaded-sarif.py
- gcc/testsuite/gcc.dg/sarif-output/test-include-chain-1.py 1 addition, 1 deletiongcc/testsuite/gcc.dg/sarif-output/test-include-chain-1.py
- gcc/testsuite/gcc.dg/sarif-output/test-include-chain-2.py 1 addition, 1 deletiongcc/testsuite/gcc.dg/sarif-output/test-include-chain-2.py
- gcc/testsuite/gcc.dg/sarif-output/test-missing-semicolon.py 1 addition, 1 deletiongcc/testsuite/gcc.dg/sarif-output/test-missing-semicolon.py
- gcc/testsuite/gcc.dg/sarif-output/test-no-diagnostics.py 1 addition, 1 deletiongcc/testsuite/gcc.dg/sarif-output/test-no-diagnostics.py
- gcc/testsuite/gcc.dg/sarif-output/test-werror.py 1 addition, 1 deletiongcc/testsuite/gcc.dg/sarif-output/test-werror.py
- gcc/testsuite/lib/sarif-schema-2.1.0.json 46 additions, 27 deletionsgcc/testsuite/lib/sarif-schema-2.1.0.json
Loading
Please register or sign in to comment