s_clang_scan does not account for different Clang versions

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Build
    • None
    • Storage Engines - Foundations
    • 365.326
    • None
    • None

      The purpose of this script is to run the Clang Static Analyzer on the WiredTiger codebase.

      The script exits with an error unless Clang is 19.1.7. This seems unnecessarily restrictive. We should also allow newer versions.

      Impact:

      • The static analyzer catches style issues, bug-prone code, and undefined behavior.
      • Developers who are not using an Evergreen workstation with the MongoDB v5 toolchain cannot run static analysis locally. They have to push code to a PR or run a manual Evergreen patch build to see the results, which is poor developer UX.
      • Because the script refuses to run with newer versions of Clang, we cannot see what additional warnings a newer release would surface. There may be issues we do not yet know about.

      Scope:

      • Update the script to allow newer versions of Clang instead of hard-coding a single expected version.
      • See what happens when s_clang_scan is run with a newer version of Clang. Does it still pass? Does the pass/fail logic need to be more flexible to account for the improved detection in newer versions?
      • Answer the following: Should we standardize on the latest Clang version for static analysis so we catch as many bugs as possible? The Clang version used for static analysis does not necessarily need to match the version used for compilation. Since this task only scans the code and does not produce a binary or any other artifact that ships in the final product, the standard MongoDB toolchain is not required.

            Assignee:
            [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            Salman Javed
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: