Skip to content

analyze-build: incorrect exit code when using --sarif and --status-bugs #162037

@correctmost

Description

@correctmost

Description

I get an exit code of 0 when I run analyze-build --sarif --status-bugs on any codebase that has analyzer warnings. The exit code is non-zero if I use --plist or --sarif-html instead of --sarif.

The root cause seems to be that the bug reporting code only analyzes .plist and .html files for bug entries:

# get the right parser for the job.
parser = parse_bug_html if html else parse_bug_plist
# get the input files, which are not empty.
pattern = os.path.join(output_dir, "*.html" if html else "*.plist")
bug_files = (file for file in glob.iglob(pattern) if not empty(file))
for bug_file in bug_files:
for bug in parser(bug_file):
if not duplicate(bug):
yield bug

Version info

clang version 20.1.8 on Arch Linux

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions