Skip to content

Execution order of the static analyzers - #5049

Merged
bruntib merged 1 commit into
Ericsson:masterfrom
hornokattila:issue-4362
Aug 26, 2026
Merged

Execution order of the static analyzers#5049
bruntib merged 1 commit into
Ericsson:masterfrom
hornokattila:issue-4362

Conversation

@hornokattila

Copy link
Copy Markdown
Contributor

The order in which analyzers (clangsa, clang-tidy, etc.) were scheduled for execution was non-deterministic because check_supported_analyzers() used a set to collect enabled analyzers. This meant that on some runs clang-tidy tasks would be dispatched before clangsa tasks.

This change replaces the set with a list, preserving the iteration order from the supported_analyzers dict. This guarantees clangsa actions are always dispatched to the worker pool first, followed by clang-tidy, cppcheck, etc.

For users with long-running clangsa analyses (e.g. 90+ minutes per file), this ensures those heavy tasks start immediately on available cores, reducing total wall-clock time.

Fixes #4362

@bruntib bruntib left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for the fix!

enabled_analyzers = []
failed_analyzers = set()

for analyzer_name in analyzers:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If I see correctly, the analyzers variable comes from the --enable command line arguments and not from the supported_analyzers. This way the user determines the execution order with this flag.

Nevertheless, I wouldn't think, this is the right place of implementing this feature. The purpose of this check_supported_analyzers() is really performing some check and not ordering the analyzers. I think, an explicit sorting should go to perform_analysis() function in analyzer.py based on supported_analyzers so it is explicitly visible that sorting analyzers is an intentional feature. Also, we could write a comment above supported_analyzers that says something like "please, don't change the order of this list, because analysis execution is intended to happen in this order".

@hornokattila hornokattila Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point! Moved the ordering logic into perform_analysis() where it's explicit. The analyzers are now sorted based on the key order of supported_analyzers.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you!

@bruntib
bruntib merged commit f07afe2 into Ericsson:master Aug 26, 2026
10 checks passed
@hornokattila
hornokattila deleted the issue-4362 branch August 26, 2026 08:47
@bruntib bruntib added this to the release 6.29.0 milestone Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Execution order of the static analyzers

2 participants