github / codeql-coding-standards

This repository contains CodeQL queries and libraries which support various Coding Standards.
MIT License
119 stars 48 forks source link

Seems to have problems with CodeQL Bundle v2.16.0 #496

Closed Mi-La closed 6 months ago

Mi-La commented 7 months ago

Describe the bug Workflow was working with CodeQL Bundle v2.15.5 - together wtih CodeQL Coding Standards v2.23.0-pre, but with new release of CodeQL Bunlde 2.16.0 it doesn't work and analyze action fires errors.

To Reproduce

  1. Set-up codeql-action/init@v3 (uses CodeQL Bundle latest release ->v2.16.0)
    languages: cpp
    config: |
     disable-default-queries: true
     queries:
       - uses: "codeql-coding-standards/cpp/autosar/src/codeql-suites/autosar-default.qls"
  2. Bulild project
  3. codeql-action/analyze@v3
    • fires the following error with CodeQL Coding Standards v2.23.0-pre:
      Error: Error running analysis for cpp: Encountered a fatal error while running 
      "/opt/hostedtoolcache/CodeQL/2.16.0/x64/codeql/codeql database 
      run-queries --ram=14567 --threads=4 /home/runner/work/_temp/codeql_databases/cpp 
      --min-disk-free=1024 -v --expect-discarded-cache --intra-layer-parallelism". 
      Exit code was 2 and last log line was: 
      ERROR: Could not resolve type UserDefinedLiteral
      (/home/runner/work/zserio/zserio/build/codeql-coding-standards/cpp/autosar/src/rules/A13-1-2/UserDefinedLiteralOperatorSuffixViolation.ql:20,6-24).
      See the logs for more details.
    • fires the following error with CodeQL Coding Standards v2.24.0:
      Error: Error running analysis for cpp: Encountered a fatal error while running
      "/opt/hostedtoolcache/CodeQL/2.15.5/x64/codeql/codeql database
      run-queries --ram=14567 --threads=4 /home/runner/work/_temp/codeql_databases/cpp
      --min-disk-free=1024 -v --expect-discarded-cache --intra-layer-parallelism".
      Exit code was 2 and last log line was:
      ERROR: test is always false, as Assignment::AssignPointerSubExpr is incompatible with the expression type AssignBitwiseOperation.extends.
      (/home/runner/work/zserio/zserio/build/codeql-coding-standards/cpp/common/src/codingstandards/cpp/Bitwise.qll:17,27-52).
      See the logs for more details.
      • note that v2.24.0 reports the same error with CodeQL Bundle v2.15.5

Expected behavior Analysis should work as with the older CodeQL Bundle release.

Environment

Additional context Maybe we have some misunderstanding in our workflow, but it was somehow working before the CodeQL Bundle release.

rvermeulen commented 6 months ago

Hi @Mi-La,

The Coding Standards queries are targeting software that is developed according to ISO26262 and therefore their development have to adhere to that standard. Practically this means the queries do not support the latest CodeQL CLI. For each release you can consult the supported CodeQL CLI and CodeQL bundle by looking at the file supported_codeql_configs.json in the root of the repository tagged with the release.

For our latest release 2.24 you can CodeQL CLI 2.14.6 or CodeQL bundle 2.14.6.

For how best to use the Coding standards you can refer to the user manual

Mi-La commented 6 months ago

@rvermeulen Thank you! It seems that with the proper version it's working again. We missed that part of the documentation.